diff --git a/src/Compute/Compute.Management.Sdk/Customizations/CapacityReservation.cs b/src/Compute/Compute.Management.Sdk/Customizations/CapacityReservation.cs index 5c3157aa35fc..1876e070458a 100644 --- a/src/Compute/Compute.Management.Sdk/Customizations/CapacityReservation.cs +++ b/src/Compute/Compute.Management.Sdk/Customizations/CapacityReservation.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.Management.Compute.Models { - public partial class CapacityReservation : Resource + public partial class CapacityReservation : TrackedResource { public CapacityReservation(string location, Sku sku, string id, string name, string type, IDictionary tags, string reservationId, IList virtualMachinesAssociated, System.DateTime? provisioningTime, string provisioningState, CapacityReservationInstanceView instanceView, IList zones) : base(location, id, name, type, tags) diff --git a/src/Compute/Compute.Management.Sdk/Customizations/DedicatedHostGroup.cs b/src/Compute/Compute.Management.Sdk/Customizations/DedicatedHostGroup.cs index a19bbf9fe57e..90a47bd83140 100644 --- a/src/Compute/Compute.Management.Sdk/Customizations/DedicatedHostGroup.cs +++ b/src/Compute/Compute.Management.Sdk/Customizations/DedicatedHostGroup.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.Management.Compute.Models { - public partial class DedicatedHostGroup : Resource + public partial class DedicatedHostGroup : TrackedResource { public DedicatedHostGroup(string location, int platformFaultDomainCount, string id, string name, string type, IDictionary tags, IList hosts, DedicatedHostGroupInstanceView instanceView, bool? supportAutomaticPlacement, IList zones) : base(location, id, name, type, tags) diff --git a/src/Compute/Compute.Management.Sdk/Customizations/Disk.cs b/src/Compute/Compute.Management.Sdk/Customizations/Disk.cs index 32f2c7c7a5c8..adaacd7a9be5 100644 --- a/src/Compute/Compute.Management.Sdk/Customizations/Disk.cs +++ b/src/Compute/Compute.Management.Sdk/Customizations/Disk.cs @@ -5,7 +5,7 @@ /// /// Disk resource. /// - public partial class Disk : Resource + public partial class Disk : TrackedResource { /// /// Initializes a new instance of the Disk class. @@ -117,7 +117,7 @@ public partial class Disk : Resource ProvisioningState = provisioningState; DiskIOPSReadWrite = diskIOPSReadWrite; DiskMBpsReadWrite = diskMBpsReadWrite; - DiskIOPSReadOnly = diskIOPSReadOnly; + DiskIopsReadOnly = diskIOPSReadOnly; DiskMBpsReadOnly = diskMBpsReadOnly; DiskState = diskState; Encryption = encryption; @@ -154,7 +154,7 @@ public partial class Disk : Resource ProvisioningState = provisioningState; DiskIOPSReadWrite = diskIOPSReadWrite; DiskMBpsReadWrite = diskMBpsReadWrite; - DiskIOPSReadOnly = diskIOPSReadOnly; + DiskIopsReadOnly = diskIOPSReadOnly; DiskMBpsReadOnly = diskMBpsReadOnly; DiskState = diskState; Encryption = encryption; diff --git a/src/Compute/Compute.Management.Sdk/Customizations/DiskUpdate.cs b/src/Compute/Compute.Management.Sdk/Customizations/DiskUpdate.cs index 1a074c4e4708..be5eb9812cf1 100644 --- a/src/Compute/Compute.Management.Sdk/Customizations/DiskUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Customizations/DiskUpdate.cs @@ -60,7 +60,7 @@ public DiskUpdate(OperatingSystemTypes? osType, int? diskSizeGB, EncryptionSetti EncryptionSettingsCollection = encryptionSettingsCollection; DiskIOPSReadWrite = diskIOPSReadWrite; DiskMBpsReadWrite = diskMBpsReadWrite; - DiskIOPSReadOnly = diskIOPSReadOnly; + DiskIopsReadOnly = diskIOPSReadOnly; DiskMBpsReadOnly = diskMBpsReadOnly; MaxShares = maxShares; Encryption = encryption; @@ -79,7 +79,7 @@ public DiskUpdate(OperatingSystemTypes? osType, int? diskSizeGB, EncryptionSetti EncryptionSettingsCollection = encryptionSettingsCollection; DiskIOPSReadWrite = diskIOPSReadWrite; DiskMBpsReadWrite = diskMBpsReadWrite; - DiskIOPSReadOnly = diskIOPSReadOnly; + DiskIopsReadOnly = diskIOPSReadOnly; DiskMBpsReadOnly = diskMBpsReadOnly; MaxShares = maxShares; Encryption = encryption; @@ -99,7 +99,7 @@ public DiskUpdate(OperatingSystemTypes? osType, int? diskSizeGB, EncryptionSetti EncryptionSettingsCollection = encryptionSettingsCollection; DiskIOPSReadWrite = diskIOPSReadWrite; DiskMBpsReadWrite = diskMBpsReadWrite; - DiskIOPSReadOnly = diskIOPSReadOnly; + DiskIopsReadOnly = diskIOPSReadOnly; DiskMBpsReadOnly = diskMBpsReadOnly; MaxShares = maxShares; Encryption = encryption; @@ -120,7 +120,7 @@ public DiskUpdate(OperatingSystemTypes? osType, int? diskSizeGB, EncryptionSetti EncryptionSettingsCollection = encryptionSettingsCollection; DiskIOPSReadWrite = diskIOPSReadWrite; DiskMBpsReadWrite = diskMBpsReadWrite; - DiskIOPSReadOnly = diskIOPSReadOnly; + DiskIopsReadOnly = diskIOPSReadOnly; DiskMBpsReadOnly = diskMBpsReadOnly; MaxShares = maxShares; Encryption = encryption; @@ -143,7 +143,7 @@ public DiskUpdate(OperatingSystemTypes? osType, int? diskSizeGB, EncryptionSetti EncryptionSettingsCollection = encryptionSettingsCollection; DiskIOPSReadWrite = diskIOPSReadWrite; DiskMBpsReadWrite = diskMBpsReadWrite; - DiskIOPSReadOnly = diskIOPSReadOnly; + DiskIopsReadOnly = diskIOPSReadOnly; DiskMBpsReadOnly = diskMBpsReadOnly; MaxShares = maxShares; Encryption = encryption; @@ -168,7 +168,7 @@ public DiskUpdate(OperatingSystemTypes? osType, int? diskSizeGB, EncryptionSetti EncryptionSettingsCollection = encryptionSettingsCollection; DiskIOPSReadWrite = diskIOPSReadWrite; DiskMBpsReadWrite = diskMBpsReadWrite; - DiskIOPSReadOnly = diskIOPSReadOnly; + DiskIopsReadOnly = diskIOPSReadOnly; DiskMBpsReadOnly = diskMBpsReadOnly; MaxShares = maxShares; Encryption = encryption; diff --git a/src/Compute/Compute.Management.Sdk/Customizations/Snapshot.cs b/src/Compute/Compute.Management.Sdk/Customizations/Snapshot.cs index 0b05bd58e89e..98d3b8d7643c 100644 --- a/src/Compute/Compute.Management.Sdk/Customizations/Snapshot.cs +++ b/src/Compute/Compute.Management.Sdk/Customizations/Snapshot.cs @@ -5,7 +5,7 @@ /// /// Snapshot resource. /// - public partial class Snapshot : Resource + public partial class Snapshot : TrackedResource { /// /// Initializes a new instance of the Snapshot class. diff --git a/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachine.cs b/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachine.cs index 03d7f639114f..e2333ade6981 100644 --- a/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachine.cs +++ b/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachine.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Describes a Virtual Machine. /// - public partial class VirtualMachine : Resource + public partial class VirtualMachine : TrackedResource { public VirtualMachine(string location, string id, string name, string type, IDictionary tags, Plan plan, HardwareProfile hardwareProfile, StorageProfile storageProfile, AdditionalCapabilities additionalCapabilities, OSProfile osProfile, NetworkProfile networkProfile, SecurityProfile securityProfile, DiagnosticsProfile diagnosticsProfile, SubResource availabilitySet, SubResource virtualMachineScaleSet, SubResource proximityPlacementGroup, string priority, string evictionPolicy, BillingProfile billingProfile, SubResource host, SubResource hostGroup, string provisioningState, VirtualMachineInstanceView instanceView, string licenseType, string vmId, string extensionsTimeBudget, int? platformFaultDomain, ScheduledEventsProfile scheduledEventsProfile, string userData, CapacityReservationProfile capacityReservation, ApplicationProfile applicationProfile, IList resources, VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList), ExtendedLocation extendedLocation = default(ExtendedLocation)) : base(location, id, name, type, tags) @@ -490,7 +490,7 @@ public VirtualMachine(string location, string id, string name, string type, IDic Identity = identity; CustomInit(); } - + public VirtualMachine(string location, string id, string name, string type, IDictionary tags, Plan plan, HardwareProfile hardwareProfile, StorageProfile storageProfile, AdditionalCapabilities additionalCapabilities, OSProfile osProfile, NetworkProfile networkProfile, SecurityProfile securityProfile, DiagnosticsProfile diagnosticsProfile, SubResource availabilitySet, SubResource virtualMachineScaleSet, SubResource proximityPlacementGroup, string priority, string evictionPolicy, BillingProfile billingProfile, SubResource host, SubResource hostGroup, string provisioningState, VirtualMachineInstanceView instanceView, string licenseType, string vmId, string extensionsTimeBudget, int? platformFaultDomain, ScheduledEventsProfile scheduledEventsProfile, IList resources) : base(location, id, name, type, tags) { diff --git a/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineRunCommand.cs b/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineRunCommand.cs index 448cd27f99f3..2214f6e52247 100644 --- a/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineRunCommand.cs +++ b/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineRunCommand.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.Management.Compute.Models { - public partial class VirtualMachineRunCommand : Resource + public partial class VirtualMachineRunCommand : TrackedResource { public VirtualMachineRunCommand(string location, string id, string name, string type, IDictionary tags, VirtualMachineRunCommandScriptSource source, IList parameters, IList protectedParameters, bool? asyncExecution, string runAsUser, string runAsPassword, int? timeoutInSeconds, string outputBlobUri, string errorBlobUri,string provisioningState, VirtualMachineRunCommandInstanceView instanceView) : base(location, id, name, type, tags) diff --git a/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSet.cs b/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSet.cs index eb862a0d4e41..fa725294676b 100644 --- a/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSet.cs +++ b/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSet.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Describes a Virtual Machine Scale Set. /// - public partial class VirtualMachineScaleSet : Resource + public partial class VirtualMachineScaleSet : TrackedResource { public VirtualMachineScaleSet(string location, string id, string name, string type, IDictionary tags, Sku sku, Plan plan, UpgradePolicy upgradePolicy, AutomaticRepairsPolicy automaticRepairsPolicy, VirtualMachineScaleSetVMProfile virtualMachineProfile, string provisioningState, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVMs, string uniqueId, bool? singlePlacementGroup, bool? zoneBalance, int? platformFaultDomainCount, SubResource proximityPlacementGroup, SubResource hostGroup, AdditionalCapabilities additionalCapabilities, ScaleInPolicy scaleInPolicy, string orchestrationMode, SpotRestorePolicy spotRestorePolicy, PriorityMixPolicy priorityMixPolicy, System.DateTime? timeCreated, VirtualMachineScaleSetIdentity identity, IList zones = default(IList), ExtendedLocation extendedLocation = default(ExtendedLocation)) : base(location, id, name, type, tags) @@ -22,7 +22,7 @@ public partial class VirtualMachineScaleSet : Resource VirtualMachineProfile = virtualMachineProfile; ProvisioningState = provisioningState; Overprovision = overprovision; - DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; + DoNotRunExtensionsOnOverprovisionedVms = doNotRunExtensionsOnOverprovisionedVMs; UniqueId = uniqueId; SinglePlacementGroup = singlePlacementGroup; ZoneBalance = zoneBalance; @@ -116,7 +116,7 @@ public partial class VirtualMachineScaleSet : Resource VirtualMachineProfile = virtualMachineProfile; ProvisioningState = provisioningState; Overprovision = overprovision; - DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; + DoNotRunExtensionsOnOverprovisionedVms = doNotRunExtensionsOnOverprovisionedVMs; UniqueId = uniqueId; SinglePlacementGroup = singlePlacementGroup; ZoneBalance = zoneBalance; @@ -143,7 +143,7 @@ public VirtualMachineScaleSet(string location, string id, string name, string ty VirtualMachineProfile = virtualMachineProfile; ProvisioningState = provisioningState; Overprovision = overprovision; - DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; + DoNotRunExtensionsOnOverprovisionedVms = doNotRunExtensionsOnOverprovisionedVMs; UniqueId = uniqueId; SinglePlacementGroup = singlePlacementGroup; ZoneBalance = zoneBalance; @@ -169,7 +169,7 @@ public VirtualMachineScaleSet(string location, string id, string name, string ty VirtualMachineProfile = virtualMachineProfile; ProvisioningState = provisioningState; Overprovision = overprovision; - DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; + DoNotRunExtensionsOnOverprovisionedVms = doNotRunExtensionsOnOverprovisionedVMs; UniqueId = uniqueId; SinglePlacementGroup = singlePlacementGroup; ZoneBalance = zoneBalance; @@ -194,7 +194,7 @@ public VirtualMachineScaleSet(string location, string id, string name, string ty VirtualMachineProfile = virtualMachineProfile; ProvisioningState = provisioningState; Overprovision = overprovision; - DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; + DoNotRunExtensionsOnOverprovisionedVms = doNotRunExtensionsOnOverprovisionedVMs; UniqueId = uniqueId; SinglePlacementGroup = singlePlacementGroup; ZoneBalance = zoneBalance; @@ -218,7 +218,7 @@ public VirtualMachineScaleSet(string location, string id, string name, string ty VirtualMachineProfile = virtualMachineProfile; ProvisioningState = provisioningState; Overprovision = overprovision; - DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; + DoNotRunExtensionsOnOverprovisionedVms = doNotRunExtensionsOnOverprovisionedVMs; UniqueId = uniqueId; SinglePlacementGroup = singlePlacementGroup; ZoneBalance = zoneBalance; @@ -241,7 +241,7 @@ public VirtualMachineScaleSet(string location, string id, string name, string ty VirtualMachineProfile = virtualMachineProfile; ProvisioningState = provisioningState; Overprovision = overprovision; - DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; + DoNotRunExtensionsOnOverprovisionedVms = doNotRunExtensionsOnOverprovisionedVMs; UniqueId = uniqueId; SinglePlacementGroup = singlePlacementGroup; ZoneBalance = zoneBalance; @@ -328,7 +328,7 @@ public VirtualMachineScaleSet(string location, string id, string name, string ty VirtualMachineProfile = virtualMachineProfile; ProvisioningState = provisioningState; Overprovision = overprovision; - DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; + DoNotRunExtensionsOnOverprovisionedVms = doNotRunExtensionsOnOverprovisionedVMs; UniqueId = uniqueId; SinglePlacementGroup = singlePlacementGroup; ZoneBalance = zoneBalance; @@ -411,7 +411,7 @@ public VirtualMachineScaleSet(string location, string id, string name, string ty VirtualMachineProfile = virtualMachineProfile; ProvisioningState = provisioningState; Overprovision = overprovision; - DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; + DoNotRunExtensionsOnOverprovisionedVms = doNotRunExtensionsOnOverprovisionedVMs; UniqueId = uniqueId; SinglePlacementGroup = singlePlacementGroup; ZoneBalance = zoneBalance; @@ -434,7 +434,7 @@ public VirtualMachineScaleSet(string location, string id, string name, string ty VirtualMachineProfile = virtualMachineProfile; ProvisioningState = provisioningState; Overprovision = overprovision; - DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; + DoNotRunExtensionsOnOverprovisionedVms = doNotRunExtensionsOnOverprovisionedVMs; UniqueId = uniqueId; SinglePlacementGroup = singlePlacementGroup; ZoneBalance = zoneBalance; diff --git a/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSetUpdate.cs b/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSetUpdate.cs index b25c561aa282..8b22c5704fe1 100644 --- a/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSetUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSetUpdate.cs @@ -17,7 +17,7 @@ public VirtualMachineScaleSetUpdate(IDictionary tags, Sku sku, P AutomaticRepairsPolicy = automaticRepairsPolicy; VirtualMachineProfile = virtualMachineProfile; Overprovision = overprovision; - DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; + DoNotRunExtensionsOnOverprovisionedVms = doNotRunExtensionsOnOverprovisionedVMs; SinglePlacementGroup = singlePlacementGroup; AdditionalCapabilities = additionalCapabilities; ScaleInPolicy = scaleInPolicy; diff --git a/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSetVM.cs b/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSetVM.cs index 862e00cfb162..2e42a27e83e1 100644 --- a/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSetVM.cs +++ b/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSetVM.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Describes a virtual machine scale set virtual machine . /// - public partial class VirtualMachineScaleSetVM : Resource + public partial class VirtualMachineScaleSetVM : TrackedResource { /// /// Initializes a new instance of the VirtualMachineScaleSetVM class. diff --git a/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSetVMExtension.cs b/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSetVMExtension.cs index f879759fb799..740bbfb0c403 100644 --- a/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSetVMExtension.cs +++ b/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSetVMExtension.cs @@ -14,7 +14,7 @@ public partial class VirtualMachineScaleSetVMExtension : SubResourceReadOnly Type = type; ForceUpdateTag = forceUpdateTag; Publisher = publisher; - VirtualMachineExtensionPropertiesType = virtualMachineExtensionPropertiesType; + VirtualMachineExtensionType = virtualMachineExtensionPropertiesType; TypeHandlerVersion = typeHandlerVersion; AutoUpgradeMinorVersion = autoUpgradeMinorVersion; EnableAutomaticUpgrade = enableAutomaticUpgrade; @@ -35,7 +35,7 @@ public partial class VirtualMachineScaleSetVMExtension : SubResourceReadOnly Location = location; ForceUpdateTag = forceUpdateTag; Publisher = publisher; - VirtualMachineExtensionPropertiesType = virtualMachineExtensionPropertiesType; + VirtualMachineExtensionType = virtualMachineExtensionPropertiesType; TypeHandlerVersion = typeHandlerVersion; AutoUpgradeMinorVersion = autoUpgradeMinorVersion; EnableAutomaticUpgrade = enableAutomaticUpgrade; @@ -55,7 +55,7 @@ public partial class VirtualMachineScaleSetVMExtension : SubResourceReadOnly Type = type; ForceUpdateTag = forceUpdateTag; Publisher = publisher; - VirtualMachineExtensionPropertiesType = virtualMachineExtensionPropertiesType; + VirtualMachineExtensionType = virtualMachineExtensionPropertiesType; TypeHandlerVersion = typeHandlerVersion; AutoUpgradeMinorVersion = autoUpgradeMinorVersion; EnableAutomaticUpgrade = enableAutomaticUpgrade; diff --git a/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSetVMsOperations.cs b/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSetVMsOperations.cs index 158501320902..62a89a4a36c7 100644 --- a/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSetVMsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Customizations/VirtualMachineScaleSetVMsOperations.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.Compute /// /// VirtualMachineScaleSetVMsOperations operations. /// - internal partial class VirtualMachineScaleSetVMsOperations : IServiceOperations, IVirtualMachineScaleSetVMsOperations + internal partial class VirtualMachineScaleSetVMSOperations : IServiceOperations, IVirtualMachineScaleSetVMsOperations { public async Task ReimageWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? tempDisk, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { diff --git a/src/Compute/Compute.Management.Sdk/Generated/AvailabilitySetsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/AvailabilitySetsOperations.cs index ec7cb86acfb0..4a77cfc4a7c4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/AvailabilitySetsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/AvailabilitySetsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// AvailabilitySetsOperations operations. /// - internal partial class AvailabilitySetsOperations : IServiceOperations, IAvailabilitySetsOperations + internal partial class AvailabilitySetsOperations : Microsoft.Rest.IServiceOperations, IAvailabilitySetsOperations { /// /// Initializes a new instance of the AvailabilitySetsOperations class. @@ -36,13 +24,13 @@ internal partial class AvailabilitySetsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal AvailabilitySetsOperations(ComputeManagementClient client) + internal AvailabilitySetsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -55,7 +43,7 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// /// The expand expression to apply to the operation. Allowed values are - /// 'instanceView'. + /// 'instanceView'. /// /// /// Headers that will be added to request. @@ -63,13 +51,13 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -78,30 +66,40 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -115,25 +113,24 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -145,55 +142,56 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -203,9 +201,10 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -216,25 +215,29 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all availability sets in a resource group. /// @@ -247,13 +250,13 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -262,46 +265,55 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -311,25 +323,24 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -341,55 +352,56 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -399,9 +411,10 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -412,25 +425,29 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves information about an availability set. /// @@ -446,13 +463,13 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -461,52 +478,62 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (availabilitySetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "availabilitySetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "availabilitySetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("availabilitySetName", availabilitySetName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{availabilitySetName}", System.Uri.EscapeDataString(availabilitySetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -516,25 +543,24 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -546,55 +572,56 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -604,9 +631,10 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -617,25 +645,29 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update an availability set. /// @@ -654,13 +686,13 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -669,61 +701,71 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, AvailabilitySet parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, AvailabilitySet parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (availabilitySetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "availabilitySetName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "availabilitySetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("availabilitySetName", availabilitySetName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{availabilitySetName}", System.Uri.EscapeDataString(availabilitySetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -733,25 +775,24 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -763,61 +804,62 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -827,9 +869,10 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -840,25 +883,29 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update an availability set. /// @@ -877,13 +924,13 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -892,57 +939,67 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, AvailabilitySetUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, AvailabilitySetUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (availabilitySetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "availabilitySetName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "availabilitySetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("availabilitySetName", availabilitySetName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{availabilitySetName}", System.Uri.EscapeDataString(availabilitySetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -952,25 +1009,24 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -982,61 +1038,62 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1046,9 +1103,10 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1059,25 +1117,29 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete an availability set. /// @@ -1093,10 +1155,10 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1105,52 +1167,62 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (availabilitySetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "availabilitySetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "availabilitySetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("availabilitySetName", availabilitySetName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{availabilitySetName}", System.Uri.EscapeDataString(availabilitySetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1160,25 +1232,24 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1190,55 +1261,56 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1248,20 +1320,25 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Cancel the migration operation on an Availability Set. /// @@ -1277,10 +1354,10 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1289,52 +1366,62 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task CancelMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task CancelMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (availabilitySetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "availabilitySetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "availabilitySetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("availabilitySetName", availabilitySetName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CancelMigrationToVirtualMachineScaleSet", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CancelMigrationToVirtualMachineScaleSet", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/cancelMigrationToVirtualMachineScaleSet").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{availabilitySetName}", System.Uri.EscapeDataString(availabilitySetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1344,25 +1431,24 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1374,55 +1460,56 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1432,20 +1519,25 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual /// Machines in the Availability Set. This does not trigger a downtime on the @@ -1462,16 +1554,16 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// Availability Set should be converted to. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ConvertToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ConvertToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginConvertToVirtualMachineScaleSetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginConvertToVirtualMachineScaleSetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1496,10 +1588,10 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1508,62 +1600,68 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StartMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task StartMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (availabilitySetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "availabilitySetName"); - } - if (virtualMachineScaleSetFlexible == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetFlexible"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "availabilitySetName"); } + string apiVersion = "2025-04-01"; MigrateToVirtualMachineScaleSetInput parameters = new MigrateToVirtualMachineScaleSetInput(); - if (virtualMachineScaleSetFlexible != null) + if(virtualMachineScaleSetFlexible != null) { parameters.VirtualMachineScaleSetFlexible = virtualMachineScaleSetFlexible; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("availabilitySetName", availabilitySetName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StartMigrationToVirtualMachineScaleSet", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "StartMigrationToVirtualMachineScaleSet", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/startMigrationToVirtualMachineScaleSet").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{availabilitySetName}", System.Uri.EscapeDataString(availabilitySetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1573,25 +1671,24 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1603,61 +1700,62 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1667,20 +1765,25 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Validates that the Virtual Machines in the Availability Set can be migrated /// to the provided Virtual Machine Scale Set. @@ -1701,10 +1804,10 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1713,62 +1816,68 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ValidateMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ValidateMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (availabilitySetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "availabilitySetName"); - } - if (virtualMachineScaleSetFlexible == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetFlexible"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "availabilitySetName"); } + string apiVersion = "2025-04-01"; MigrateToVirtualMachineScaleSetInput parameters = new MigrateToVirtualMachineScaleSetInput(); - if (virtualMachineScaleSetFlexible != null) + if(virtualMachineScaleSetFlexible != null) { parameters.VirtualMachineScaleSetFlexible = virtualMachineScaleSetFlexible; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("availabilitySetName", availabilitySetName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ValidateMigrationToVirtualMachineScaleSet", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ValidateMigrationToVirtualMachineScaleSet", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/validateMigrationToVirtualMachineScaleSet").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{availabilitySetName}", System.Uri.EscapeDataString(availabilitySetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1778,25 +1887,24 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1808,61 +1916,62 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1872,20 +1981,25 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all available virtual machine sizes that can be used to create a new /// virtual machine in an existing availability set. @@ -1902,13 +2016,13 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1917,52 +2031,62 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAvailableSizesWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAvailableSizesWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (availabilitySetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "availabilitySetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "availabilitySetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("availabilitySetName", availabilitySetName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAvailableSizes", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAvailableSizes", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{availabilitySetName}", System.Uri.EscapeDataString(availabilitySetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1972,25 +2096,24 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2002,55 +2125,56 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2060,9 +2184,10 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2073,25 +2198,29 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual /// Machines in the Availability Set. This does not trigger a downtime on the @@ -2113,10 +2242,10 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2125,59 +2254,68 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginConvertToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginConvertToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (availabilitySetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "availabilitySetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "availabilitySetName"); } + string apiVersion = "2025-04-01"; - ConvertToVirtualMachineScaleSetInput parameters = default(ConvertToVirtualMachineScaleSetInput); - if (virtualMachineScaleSetName != null) + ConvertToVirtualMachineScaleSetInput parameters = new ConvertToVirtualMachineScaleSetInput(); + if(virtualMachineScaleSetName != null) { - parameters = new ConvertToVirtualMachineScaleSetInput(); parameters.VirtualMachineScaleSetName = virtualMachineScaleSetName; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("availabilitySetName", availabilitySetName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginConvertToVirtualMachineScaleSet", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginConvertToVirtualMachineScaleSet", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/convertToVirtualMachineScaleSet").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{availabilitySetName}", System.Uri.EscapeDataString(availabilitySetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2187,25 +2325,24 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2217,61 +2354,62 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2281,20 +2419,25 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all availability sets in a subscription. /// @@ -2307,13 +2450,13 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2322,51 +2465,54 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2378,55 +2524,56 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2436,9 +2583,10 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2449,25 +2597,29 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all availability sets in a resource group. /// @@ -2480,13 +2632,13 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2495,51 +2647,54 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2551,55 +2706,56 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2609,9 +2765,10 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2622,24 +2779,28 @@ internal AvailabilitySetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/AvailabilitySetsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/AvailabilitySetsOperationsExtensions.cs index 48c34b17d9a4..4c6f84f5dfd1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/AvailabilitySetsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/AvailabilitySetsOperationsExtensions.cs @@ -1,609 +1,540 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for AvailabilitySetsOperations. + /// Extension methods for AvailabilitySetsOperations /// public static partial class AvailabilitySetsOperationsExtensions { - /// - /// Lists all availability sets in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The expand expression to apply to the operation. Allowed values are - /// 'instanceView'. - /// - public static IPage ListBySubscription(this IAvailabilitySetsOperations operations, string expand = default(string)) - { - return operations.ListBySubscriptionAsync(expand).GetAwaiter().GetResult(); - } - - /// - /// Lists all availability sets in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The expand expression to apply to the operation. Allowed values are - /// 'instanceView'. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IAvailabilitySetsOperations operations, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all availability sets in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage List(this IAvailabilitySetsOperations operations, string resourceGroupName) - { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists all availability sets in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves information about an availability set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - public static AvailabilitySet Get(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName) - { - return operations.GetAsync(resourceGroupName, availabilitySetName).GetAwaiter().GetResult(); - } + /// + /// Lists all availability sets in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The expand expression to apply to the operation. Allowed values are + /// 'instanceView'. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscription(this IAvailabilitySetsOperations operations, string expand = default(string)) + { + return ((IAvailabilitySetsOperations)operations).ListBySubscriptionAsync(expand).GetAwaiter().GetResult(); + } - /// - /// Retrieves information about an availability set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all availability sets in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The expand expression to apply to the operation. Allowed values are + /// 'instanceView'. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this IAvailabilitySetsOperations operations, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(expand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all availability sets in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage List(this IAvailabilitySetsOperations operations, string resourceGroupName) + { + return ((IAvailabilitySetsOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Create or update an availability set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - /// - /// Parameters supplied to the Create Availability Set operation. - /// - public static AvailabilitySet CreateOrUpdate(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, AvailabilitySet parameters) + /// + /// Lists all availability sets in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, availabilitySetName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves information about an availability set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + public static AvailabilitySet Get(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName) + { + return ((IAvailabilitySetsOperations)operations).GetAsync(resourceGroupName, availabilitySetName).GetAwaiter().GetResult(); + } - /// - /// Create or update an availability set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - /// - /// Parameters supplied to the Create Availability Set operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, AvailabilitySet parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves information about an availability set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, availabilitySetName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Create or update an availability set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + public static AvailabilitySet CreateOrUpdate(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, AvailabilitySet parameters) + { + return ((IAvailabilitySetsOperations)operations).CreateOrUpdateAsync(resourceGroupName, availabilitySetName, parameters).GetAwaiter().GetResult(); + } - /// - /// Update an availability set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - /// - /// Parameters supplied to the Update Availability Set operation. - /// - public static AvailabilitySet Update(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, AvailabilitySetUpdate parameters) + /// + /// Create or update an availability set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, AvailabilitySet parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, availabilitySetName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(resourceGroupName, availabilitySetName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update an availability set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + public static AvailabilitySet Update(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, AvailabilitySetUpdate parameters) + { + return ((IAvailabilitySetsOperations)operations).UpdateAsync(resourceGroupName, availabilitySetName, parameters).GetAwaiter().GetResult(); + } - /// - /// Update an availability set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - /// - /// Parameters supplied to the Update Availability Set operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, AvailabilitySetUpdate parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update an availability set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, AvailabilitySetUpdate parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, availabilitySetName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, availabilitySetName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete an availability set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + public static void Delete(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName) + { + ((IAvailabilitySetsOperations)operations).DeleteAsync(resourceGroupName, availabilitySetName).GetAwaiter().GetResult(); + } - /// - /// Delete an availability set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - public static void Delete(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName) - { - operations.DeleteAsync(resourceGroupName, availabilitySetName).GetAwaiter().GetResult(); - } + /// + /// Delete an availability set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, availabilitySetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Cancel the migration operation on an Availability Set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + public static void CancelMigrationToVirtualMachineScaleSet(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName) + { + ((IAvailabilitySetsOperations)operations).CancelMigrationToVirtualMachineScaleSetAsync(resourceGroupName, availabilitySetName).GetAwaiter().GetResult(); + } - /// - /// Delete an availability set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, availabilitySetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Cancel the migration operation on an Availability Set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CancelMigrationToVirtualMachineScaleSetAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.CancelMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual + /// Machines in the Availability Set. This does not trigger a downtime on the + /// Virtual Machines. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + public static void ConvertToVirtualMachineScaleSet(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string)) + { + ((IAvailabilitySetsOperations)operations).ConvertToVirtualMachineScaleSetAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetName).GetAwaiter().GetResult(); + } - /// - /// Cancel the migration operation on an Availability Set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - public static void CancelMigrationToVirtualMachineScaleSet(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName) - { - operations.CancelMigrationToVirtualMachineScaleSetAsync(resourceGroupName, availabilitySetName).GetAwaiter().GetResult(); - } + /// + /// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual + /// Machines in the Availability Set. This does not trigger a downtime on the + /// Virtual Machines. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ConvertToVirtualMachineScaleSetAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ConvertToVirtualMachineScaleSetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Start migration operation on an Availability Set to move its Virtual + /// Machines to a Virtual Machine Scale Set. This should be followed by a + /// migrate operation on each Virtual Machine that triggers a downtime on the + /// Virtual Machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + public static void StartMigrationToVirtualMachineScaleSet(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible) + { + ((IAvailabilitySetsOperations)operations).StartMigrationToVirtualMachineScaleSetAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetFlexible).GetAwaiter().GetResult(); + } - /// - /// Cancel the migration operation on an Availability Set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - /// - /// The cancellation token. - /// - public static async Task CancelMigrationToVirtualMachineScaleSetAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CancelMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Start migration operation on an Availability Set to move its Virtual + /// Machines to a Virtual Machine Scale Set. This should be followed by a + /// migrate operation on each Virtual Machine that triggers a downtime on the + /// Virtual Machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StartMigrationToVirtualMachineScaleSetAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.StartMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetFlexible, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Validates that the Virtual Machines in the Availability Set can be migrated + /// to the provided Virtual Machine Scale Set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + public static void ValidateMigrationToVirtualMachineScaleSet(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible) + { + ((IAvailabilitySetsOperations)operations).ValidateMigrationToVirtualMachineScaleSetAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetFlexible).GetAwaiter().GetResult(); + } - /// - /// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual - /// Machines in the Availability Set. This does not trigger a downtime on the - /// Virtual Machines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - /// - /// Specifies information about the Virtual Machine Scale Set that the - /// Availability Set should be converted to. - /// - public static void ConvertToVirtualMachineScaleSet(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string)) - { - operations.ConvertToVirtualMachineScaleSetAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetName).GetAwaiter().GetResult(); - } + /// + /// Validates that the Virtual Machines in the Availability Set can be migrated + /// to the provided Virtual Machine Scale Set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ValidateMigrationToVirtualMachineScaleSetAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ValidateMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetFlexible, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all available virtual machine sizes that can be used to create a new + /// virtual machine in an existing availability set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + public static System.Collections.Generic.IEnumerable ListAvailableSizes(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName) + { + return ((IAvailabilitySetsOperations)operations).ListAvailableSizesAsync(resourceGroupName, availabilitySetName).GetAwaiter().GetResult(); + } - /// - /// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual - /// Machines in the Availability Set. This does not trigger a downtime on the - /// Virtual Machines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - /// - /// Specifies information about the Virtual Machine Scale Set that the - /// Availability Set should be converted to. - /// - /// - /// The cancellation token. - /// - public static async Task ConvertToVirtualMachineScaleSetAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all available virtual machine sizes that can be used to create a new + /// virtual machine in an existing availability set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAvailableSizesAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAvailableSizesWithHttpMessagesAsync(resourceGroupName, availabilitySetName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.ConvertToVirtualMachineScaleSetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual + /// Machines in the Availability Set. This does not trigger a downtime on the + /// Virtual Machines. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + public static void BeginConvertToVirtualMachineScaleSet(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string)) + { + ((IAvailabilitySetsOperations)operations).BeginConvertToVirtualMachineScaleSetAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetName).GetAwaiter().GetResult(); + } - /// - /// Start migration operation on an Availability Set to move its Virtual - /// Machines to a Virtual Machine Scale Set. This should be followed by a - /// migrate operation on each Virtual Machine that triggers a downtime on the - /// Virtual Machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - /// - /// Specifies information about the Virtual Machine Scale Set that the - /// Availability Set should be migrated to. Minimum api‐version: 2024‐11‐01. - /// - public static void StartMigrationToVirtualMachineScaleSet(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible) - { - operations.StartMigrationToVirtualMachineScaleSetAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetFlexible).GetAwaiter().GetResult(); - } + /// + /// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual + /// Machines in the Availability Set. This does not trigger a downtime on the + /// Virtual Machines. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the availability set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginConvertToVirtualMachineScaleSetAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginConvertToVirtualMachineScaleSetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all availability sets in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionNext(this IAvailabilitySetsOperations operations, string nextPageLink) + { + return ((IAvailabilitySetsOperations)operations).ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Start migration operation on an Availability Set to move its Virtual - /// Machines to a Virtual Machine Scale Set. This should be followed by a - /// migrate operation on each Virtual Machine that triggers a downtime on the - /// Virtual Machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - /// - /// Specifies information about the Virtual Machine Scale Set that the - /// Availability Set should be migrated to. Minimum api‐version: 2024‐11‐01. - /// - /// - /// The cancellation token. - /// - public static async Task StartMigrationToVirtualMachineScaleSetAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all availability sets in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionNextAsync(this IAvailabilitySetsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.StartMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetFlexible, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Lists all availability sets in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IAvailabilitySetsOperations operations, string nextPageLink) + { + return ((IAvailabilitySetsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Validates that the Virtual Machines in the Availability Set can be migrated - /// to the provided Virtual Machine Scale Set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - /// - /// Specifies information about the Virtual Machine Scale Set that the - /// Availability Set should be migrated to. Minimum api‐version: 2024‐11‐01. - /// - public static void ValidateMigrationToVirtualMachineScaleSet(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible) + /// + /// Lists all availability sets in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IAvailabilitySetsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.ValidateMigrationToVirtualMachineScaleSetAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetFlexible).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Validates that the Virtual Machines in the Availability Set can be migrated - /// to the provided Virtual Machine Scale Set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - /// - /// Specifies information about the Virtual Machine Scale Set that the - /// Availability Set should be migrated to. Minimum api‐version: 2024‐11‐01. - /// - /// - /// The cancellation token. - /// - public static async Task ValidateMigrationToVirtualMachineScaleSetAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ValidateMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetFlexible, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all available virtual machine sizes that can be used to create a new - /// virtual machine in an existing availability set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - public static IEnumerable ListAvailableSizes(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName) - { - return operations.ListAvailableSizesAsync(resourceGroupName, availabilitySetName).GetAwaiter().GetResult(); - } - - /// - /// Lists all available virtual machine sizes that can be used to create a new - /// virtual machine in an existing availability set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAvailableSizesAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAvailableSizesWithHttpMessagesAsync(resourceGroupName, availabilitySetName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual - /// Machines in the Availability Set. This does not trigger a downtime on the - /// Virtual Machines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - /// - /// Specifies information about the Virtual Machine Scale Set that the - /// Availability Set should be converted to. - /// - public static void BeginConvertToVirtualMachineScaleSet(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string)) - { - operations.BeginConvertToVirtualMachineScaleSetAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetName).GetAwaiter().GetResult(); - } - - /// - /// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual - /// Machines in the Availability Set. This does not trigger a downtime on the - /// Virtual Machines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the availability set. - /// - /// - /// Specifies information about the Virtual Machine Scale Set that the - /// Availability Set should be converted to. - /// - /// - /// The cancellation token. - /// - public static async Task BeginConvertToVirtualMachineScaleSetAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginConvertToVirtualMachineScaleSetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all availability sets in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this IAvailabilitySetsOperations operations, string nextPageLink) - { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all availability sets in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this IAvailabilitySetsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all availability sets in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IAvailabilitySetsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all availability sets in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IAvailabilitySetsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/CapacityReservationGroupsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/CapacityReservationGroupsOperations.cs index b07b1aa159b1..b31075d2b74d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/CapacityReservationGroupsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/CapacityReservationGroupsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// CapacityReservationGroupsOperations operations. /// - internal partial class CapacityReservationGroupsOperations : IServiceOperations, ICapacityReservationGroupsOperations + internal partial class CapacityReservationGroupsOperations : Microsoft.Rest.IServiceOperations, ICapacityReservationGroupsOperations { /// /// Initializes a new instance of the CapacityReservationGroupsOperations class. @@ -36,13 +24,13 @@ internal partial class CapacityReservationGroupsOperations : IServiceOperations< /// /// Thrown when a required parameter is null /// - internal CapacityReservationGroupsOperations(ComputeManagementClient client) + internal CapacityReservationGroupsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,19 +47,16 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// The expand expression to apply on the operation. Based on the expand /// param(s) specified we return Virtual Machine or ScaleSet VM Instance or /// both resource Ids which are associated to capacity reservation group in the - /// response. Possible values include: 'virtualMachineScaleSetVMs/$ref', - /// 'virtualMachines/$ref' + /// response. /// /// - /// The query option to fetch Capacity Reservation Group Resource Ids. - /// <br> 'CreatedInSubscription' enables fetching Resource Ids for all - /// capacity reservation group resources created in the subscription. - /// <br> 'SharedWithSubscription' enables fetching Resource Ids for all - /// capacity reservation group resources shared with the subscription. - /// <br> 'All' enables fetching Resource Ids for all capacity reservation - /// group resources shared with the subscription and created in the - /// subscription. Possible values include: 'CreatedInSubscription', - /// 'SharedWithSubscription', 'All' + /// The query option to fetch Capacity Reservation Group Resource Ids. <br> + /// 'CreatedInSubscription' enables fetching Resource Ids for all capacity + /// reservation group resources created in the subscription. <br> + /// 'SharedWithSubscription' enables fetching Resource Ids for all capacity + /// reservation group resources shared with the subscription. <br> 'All' + /// enables fetching Resource Ids for all capacity reservation group resources + /// shared with the subscription and created in the subscription. /// /// /// Headers that will be added to request. @@ -79,13 +64,13 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -94,31 +79,42 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(string expand = default(string), string resourceIdsOnly = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(string expand = default(string), string resourceIdsOnly = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); tracingParameters.Add("resourceIdsOnly", resourceIdsOnly); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/capacityReservationGroups").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -136,25 +132,24 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -166,55 +161,56 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -224,9 +220,10 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -237,25 +234,29 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the capacity reservation groups in the specified resource /// group. Use the nextLink property in the response to get the next page of @@ -268,8 +269,7 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// The expand expression to apply on the operation. Based on the expand /// param(s) specified we return Virtual Machine or ScaleSet VM Instance or /// both resource Ids which are associated to capacity reservation group in the - /// response. Possible values include: 'virtualMachineScaleSetVMs/$ref', - /// 'virtualMachines/$ref' + /// response. /// /// /// Headers that will be added to request. @@ -277,13 +277,13 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -292,47 +292,57 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -346,25 +356,24 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -376,55 +385,56 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -434,9 +444,10 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -447,25 +458,29 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation that retrieves information about a capacity reservation /// group. @@ -477,12 +492,11 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// The name of the capacity reservation group. /// /// - /// The expand expression to apply on the operation. 'InstanceView' will + /// The expand expression to apply on the operation. 'InstanceView' will /// retrieve the list of instance views of the capacity reservations under the /// capacity reservation group which is a snapshot of the runtime properties of /// a capacity reservation that is managed by the platform and can change - /// outside of control plane operations. Possible values include: - /// 'instanceView' + /// outside of control plane operations. /// /// /// Headers that will be added to request. @@ -490,13 +504,13 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -505,53 +519,64 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (capacityReservationGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "capacityReservationGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "capacityReservationGroupName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("capacityReservationGroupName", capacityReservationGroupName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{capacityReservationGroupName}", System.Uri.EscapeDataString(capacityReservationGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -565,25 +590,24 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -595,55 +619,56 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -653,9 +678,10 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -666,25 +692,29 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to create or update a capacity reservation group. When /// updating a capacity reservation group, only tags and sharing profile may be @@ -706,13 +736,13 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -721,61 +751,71 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, CapacityReservationGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, CapacityReservationGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + parameters.Validate(); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (capacityReservationGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "capacityReservationGroupName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "capacityReservationGroupName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("capacityReservationGroupName", capacityReservationGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{capacityReservationGroupName}", System.Uri.EscapeDataString(capacityReservationGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -785,25 +825,24 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -815,61 +854,62 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -879,9 +919,10 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -892,16 +933,16 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -910,25 +951,29 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to update a capacity reservation group. When updating a /// capacity reservation group, only tags and sharing profile may be modified. @@ -948,13 +993,13 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -963,57 +1008,67 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, CapacityReservationGroupUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, CapacityReservationGroupUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (capacityReservationGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "capacityReservationGroupName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "capacityReservationGroupName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("capacityReservationGroupName", capacityReservationGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{capacityReservationGroupName}", System.Uri.EscapeDataString(capacityReservationGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1023,25 +1078,24 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1053,61 +1107,62 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1117,9 +1172,10 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1130,25 +1186,29 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to delete a capacity reservation group. This operation is /// allowed only if all the associated resources are disassociated from the @@ -1168,10 +1228,10 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1180,52 +1240,62 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (capacityReservationGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "capacityReservationGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "capacityReservationGroupName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("capacityReservationGroupName", capacityReservationGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{capacityReservationGroupName}", System.Uri.EscapeDataString(capacityReservationGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1235,25 +1305,24 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1265,55 +1334,56 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1323,20 +1393,25 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the capacity reservation groups in the subscription. Use the /// nextLink property in the response to get the next page of capacity @@ -1351,13 +1426,13 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1366,51 +1441,54 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1422,55 +1500,56 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1480,9 +1559,10 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1493,25 +1573,29 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the capacity reservation groups in the specified resource /// group. Use the nextLink property in the response to get the next page of @@ -1526,13 +1610,13 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1541,51 +1625,54 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1597,55 +1684,56 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1655,9 +1743,10 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1668,24 +1757,28 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/CapacityReservationGroupsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/CapacityReservationGroupsOperationsExtensions.cs index 080f2203ff6f..0344908308b7 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/CapacityReservationGroupsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/CapacityReservationGroupsOperationsExtensions.cs @@ -1,424 +1,385 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for CapacityReservationGroupsOperations. + /// Extension methods for CapacityReservationGroupsOperations /// public static partial class CapacityReservationGroupsOperationsExtensions { - /// - /// Lists all of the capacity reservation groups in the subscription. Use the - /// nextLink property in the response to get the next page of capacity - /// reservation groups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The expand expression to apply on the operation. Based on the expand - /// param(s) specified we return Virtual Machine or ScaleSet VM Instance or - /// both resource Ids which are associated to capacity reservation group in the - /// response. Possible values include: 'virtualMachineScaleSetVMs/$ref', - /// 'virtualMachines/$ref' - /// - /// - /// The query option to fetch Capacity Reservation Group Resource Ids. - /// <br> 'CreatedInSubscription' enables fetching Resource Ids for all - /// capacity reservation group resources created in the subscription. - /// <br> 'SharedWithSubscription' enables fetching Resource Ids for all - /// capacity reservation group resources shared with the subscription. - /// <br> 'All' enables fetching Resource Ids for all capacity reservation - /// group resources shared with the subscription and created in the - /// subscription. Possible values include: 'CreatedInSubscription', - /// 'SharedWithSubscription', 'All' - /// - public static IPage ListBySubscription(this ICapacityReservationGroupsOperations operations, string expand = default(string), string resourceIdsOnly = default(string)) - { - return operations.ListBySubscriptionAsync(expand, resourceIdsOnly).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the capacity reservation groups in the subscription. Use the - /// nextLink property in the response to get the next page of capacity - /// reservation groups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The expand expression to apply on the operation. Based on the expand - /// param(s) specified we return Virtual Machine or ScaleSet VM Instance or - /// both resource Ids which are associated to capacity reservation group in the - /// response. Possible values include: 'virtualMachineScaleSetVMs/$ref', - /// 'virtualMachines/$ref' - /// - /// - /// The query option to fetch Capacity Reservation Group Resource Ids. - /// <br> 'CreatedInSubscription' enables fetching Resource Ids for all - /// capacity reservation group resources created in the subscription. - /// <br> 'SharedWithSubscription' enables fetching Resource Ids for all - /// capacity reservation group resources shared with the subscription. - /// <br> 'All' enables fetching Resource Ids for all capacity reservation - /// group resources shared with the subscription and created in the - /// subscription. Possible values include: 'CreatedInSubscription', - /// 'SharedWithSubscription', 'All' - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this ICapacityReservationGroupsOperations operations, string expand = default(string), string resourceIdsOnly = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(expand, resourceIdsOnly, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all of the capacity reservation groups in the specified resource - /// group. Use the nextLink property in the response to get the next page of - /// capacity reservation groups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The expand expression to apply on the operation. Based on the expand - /// param(s) specified we return Virtual Machine or ScaleSet VM Instance or - /// both resource Ids which are associated to capacity reservation group in the - /// response. Possible values include: 'virtualMachineScaleSetVMs/$ref', - /// 'virtualMachines/$ref' - /// - public static IPage ListByResourceGroup(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string expand = default(string)) - { - return operations.ListByResourceGroupAsync(resourceGroupName, expand).GetAwaiter().GetResult(); - } + /// + /// Lists all of the capacity reservation groups in the subscription. Use the + /// nextLink property in the response to get the next page of capacity + /// reservation groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The expand expression to apply on the operation. Based on the expand + /// param(s) specified we return Virtual Machine or ScaleSet VM Instance or + /// both resource Ids which are associated to capacity reservation group in the + /// response. + /// + /// + /// The query option to fetch Capacity Reservation Group Resource Ids. <br> + /// 'CreatedInSubscription' enables fetching Resource Ids for all capacity + /// reservation group resources created in the subscription. <br> + /// 'SharedWithSubscription' enables fetching Resource Ids for all capacity + /// reservation group resources shared with the subscription. <br> 'All' + /// enables fetching Resource Ids for all capacity reservation group resources + /// shared with the subscription and created in the subscription. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscription(this ICapacityReservationGroupsOperations operations, string expand = default(string), string resourceIdsOnly = default(string)) + { + return ((ICapacityReservationGroupsOperations)operations).ListBySubscriptionAsync(expand, resourceIdsOnly).GetAwaiter().GetResult(); + } - /// - /// Lists all of the capacity reservation groups in the specified resource - /// group. Use the nextLink property in the response to get the next page of - /// capacity reservation groups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The expand expression to apply on the operation. Based on the expand - /// param(s) specified we return Virtual Machine or ScaleSet VM Instance or - /// both resource Ids which are associated to capacity reservation group in the - /// response. Possible values include: 'virtualMachineScaleSetVMs/$ref', - /// 'virtualMachines/$ref' - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all of the capacity reservation groups in the subscription. Use the + /// nextLink property in the response to get the next page of capacity + /// reservation groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The expand expression to apply on the operation. Based on the expand + /// param(s) specified we return Virtual Machine or ScaleSet VM Instance or + /// both resource Ids which are associated to capacity reservation group in the + /// response. + /// + /// + /// The query option to fetch Capacity Reservation Group Resource Ids. <br> + /// 'CreatedInSubscription' enables fetching Resource Ids for all capacity + /// reservation group resources created in the subscription. <br> + /// 'SharedWithSubscription' enables fetching Resource Ids for all capacity + /// reservation group resources shared with the subscription. <br> 'All' + /// enables fetching Resource Ids for all capacity reservation group resources + /// shared with the subscription and created in the subscription. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this ICapacityReservationGroupsOperations operations, string expand = default(string), string resourceIdsOnly = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(expand, resourceIdsOnly, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all of the capacity reservation groups in the specified resource + /// group. Use the nextLink property in the response to get the next page of + /// capacity reservation groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The expand expression to apply on the operation. Based on the expand + /// param(s) specified we return Virtual Machine or ScaleSet VM Instance or + /// both resource Ids which are associated to capacity reservation group in the + /// response. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string expand = default(string)) + { + return ((ICapacityReservationGroupsOperations)operations).ListByResourceGroupAsync(resourceGroupName, expand).GetAwaiter().GetResult(); + } - /// - /// The operation that retrieves information about a capacity reservation - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The expand expression to apply on the operation. 'InstanceView' will - /// retrieve the list of instance views of the capacity reservations under the - /// capacity reservation group which is a snapshot of the runtime properties of - /// a capacity reservation that is managed by the platform and can change - /// outside of control plane operations. Possible values include: - /// 'instanceView' - /// - public static CapacityReservationGroup Get(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string capacityReservationGroupName, string expand = default(string)) + /// + /// Lists all of the capacity reservation groups in the specified resource + /// group. Use the nextLink property in the response to get the next page of + /// capacity reservation groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The expand expression to apply on the operation. Based on the expand + /// param(s) specified we return Virtual Machine or ScaleSet VM Instance or + /// both resource Ids which are associated to capacity reservation group in the + /// response. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, capacityReservationGroupName, expand).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation that retrieves information about a capacity reservation + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The expand expression to apply on the operation. 'InstanceView' will + /// retrieve the list of instance views of the capacity reservations under the + /// capacity reservation group which is a snapshot of the runtime properties of + /// a capacity reservation that is managed by the platform and can change + /// outside of control plane operations. + /// + public static CapacityReservationGroup Get(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string capacityReservationGroupName, string expand = default(string)) + { + return ((ICapacityReservationGroupsOperations)operations).GetAsync(resourceGroupName, capacityReservationGroupName, expand).GetAwaiter().GetResult(); + } - /// - /// The operation that retrieves information about a capacity reservation - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The expand expression to apply on the operation. 'InstanceView' will - /// retrieve the list of instance views of the capacity reservations under the - /// capacity reservation group which is a snapshot of the runtime properties of - /// a capacity reservation that is managed by the platform and can change - /// outside of control plane operations. Possible values include: - /// 'instanceView' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string capacityReservationGroupName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation that retrieves information about a capacity reservation + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The expand expression to apply on the operation. 'InstanceView' will + /// retrieve the list of instance views of the capacity reservations under the + /// capacity reservation group which is a snapshot of the runtime properties of + /// a capacity reservation that is managed by the platform and can change + /// outside of control plane operations. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string capacityReservationGroupName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, expand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// The operation to create or update a capacity reservation group. When + /// updating a capacity reservation group, only tags and sharing profile may be + /// modified. Please refer to https://aka.ms/CapacityReservation for more + /// details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + public static CapacityReservationGroup CreateOrUpdate(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string capacityReservationGroupName, CapacityReservationGroup parameters) + { + return ((ICapacityReservationGroupsOperations)operations).CreateOrUpdateAsync(resourceGroupName, capacityReservationGroupName, parameters).GetAwaiter().GetResult(); + } - /// - /// The operation to create or update a capacity reservation group. When - /// updating a capacity reservation group, only tags and sharing profile may be - /// modified. Please refer to https://aka.ms/CapacityReservation for more - /// details. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// Parameters supplied to the Create capacity reservation Group. - /// - public static CapacityReservationGroup CreateOrUpdate(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string capacityReservationGroupName, CapacityReservationGroup parameters) + /// + /// The operation to create or update a capacity reservation group. When + /// updating a capacity reservation group, only tags and sharing profile may be + /// modified. Please refer to https://aka.ms/CapacityReservation for more + /// details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string capacityReservationGroupName, CapacityReservationGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, capacityReservationGroupName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to update a capacity reservation group. When updating a + /// capacity reservation group, only tags and sharing profile may be modified. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + public static CapacityReservationGroup Update(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string capacityReservationGroupName, CapacityReservationGroupUpdate parameters) + { + return ((ICapacityReservationGroupsOperations)operations).UpdateAsync(resourceGroupName, capacityReservationGroupName, parameters).GetAwaiter().GetResult(); + } - /// - /// The operation to create or update a capacity reservation group. When - /// updating a capacity reservation group, only tags and sharing profile may be - /// modified. Please refer to https://aka.ms/CapacityReservation for more - /// details. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// Parameters supplied to the Create capacity reservation Group. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string capacityReservationGroupName, CapacityReservationGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to update a capacity reservation group. When updating a + /// capacity reservation group, only tags and sharing profile may be modified. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string capacityReservationGroupName, CapacityReservationGroupUpdate parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// The operation to delete a capacity reservation group. This operation is + /// allowed only if all the associated resources are disassociated from the + /// reservation group and all capacity reservations under the reservation group + /// have also been deleted. Please refer to https://aka.ms/CapacityReservation + /// for more details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + public static void Delete(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string capacityReservationGroupName) + { + ((ICapacityReservationGroupsOperations)operations).DeleteAsync(resourceGroupName, capacityReservationGroupName).GetAwaiter().GetResult(); + } - /// - /// The operation to update a capacity reservation group. When updating a - /// capacity reservation group, only tags and sharing profile may be modified. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// Parameters supplied to the Update capacity reservation Group operation. - /// - public static CapacityReservationGroup Update(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string capacityReservationGroupName, CapacityReservationGroupUpdate parameters) - { - return operations.UpdateAsync(resourceGroupName, capacityReservationGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// The operation to update a capacity reservation group. When updating a - /// capacity reservation group, only tags and sharing profile may be modified. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// Parameters supplied to the Update capacity reservation Group operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string capacityReservationGroupName, CapacityReservationGroupUpdate parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// The operation to delete a capacity reservation group. This operation is + /// allowed only if all the associated resources are disassociated from the + /// reservation group and all capacity reservations under the reservation group + /// have also been deleted. Please refer to https://aka.ms/CapacityReservation + /// for more details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string capacityReservationGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all of the capacity reservation groups in the subscription. Use the + /// nextLink property in the response to get the next page of capacity + /// reservation groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionNext(this ICapacityReservationGroupsOperations operations, string nextPageLink) + { + return ((ICapacityReservationGroupsOperations)operations).ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// The operation to delete a capacity reservation group. This operation is - /// allowed only if all the associated resources are disassociated from the - /// reservation group and all capacity reservations under the reservation group - /// have also been deleted. Please refer to https://aka.ms/CapacityReservation - /// for more details. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - public static void Delete(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string capacityReservationGroupName) + /// + /// Lists all of the capacity reservation groups in the subscription. Use the + /// nextLink property in the response to get the next page of capacity + /// reservation groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionNextAsync(this ICapacityReservationGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, capacityReservationGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists all of the capacity reservation groups in the specified resource + /// group. Use the nextLink property in the response to get the next page of + /// capacity reservation groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this ICapacityReservationGroupsOperations operations, string nextPageLink) + { + return ((ICapacityReservationGroupsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// The operation to delete a capacity reservation group. This operation is - /// allowed only if all the associated resources are disassociated from the - /// reservation group and all capacity reservations under the reservation group - /// have also been deleted. Please refer to https://aka.ms/CapacityReservation - /// for more details. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ICapacityReservationGroupsOperations operations, string resourceGroupName, string capacityReservationGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all of the capacity reservation groups in the specified resource + /// group. Use the nextLink property in the response to get the next page of + /// capacity reservation groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this ICapacityReservationGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Lists all of the capacity reservation groups in the subscription. Use the - /// nextLink property in the response to get the next page of capacity - /// reservation groups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this ICapacityReservationGroupsOperations operations, string nextPageLink) - { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the capacity reservation groups in the subscription. Use the - /// nextLink property in the response to get the next page of capacity - /// reservation groups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this ICapacityReservationGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all of the capacity reservation groups in the specified resource - /// group. Use the nextLink property in the response to get the next page of - /// capacity reservation groups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this ICapacityReservationGroupsOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the capacity reservation groups in the specified resource - /// group. Use the nextLink property in the response to get the next page of - /// capacity reservation groups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this ICapacityReservationGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/CapacityReservationsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/CapacityReservationsOperations.cs index 5971249e0a65..464abeb8f573 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/CapacityReservationsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/CapacityReservationsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// CapacityReservationsOperations operations. /// - internal partial class CapacityReservationsOperations : IServiceOperations, ICapacityReservationsOperations + internal partial class CapacityReservationsOperations : Microsoft.Rest.IServiceOperations, ICapacityReservationsOperations { /// /// Initializes a new instance of the CapacityReservationsOperations class. @@ -36,13 +24,13 @@ internal partial class CapacityReservationsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal CapacityReservationsOperations(ComputeManagementClient client) + internal CapacityReservationsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -67,13 +55,13 @@ internal CapacityReservationsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -82,52 +70,62 @@ internal CapacityReservationsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByCapacityReservationGroupWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByCapacityReservationGroupWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (capacityReservationGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "capacityReservationGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "capacityReservationGroupName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("capacityReservationGroupName", capacityReservationGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByCapacityReservationGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByCapacityReservationGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{capacityReservationGroupName}", System.Uri.EscapeDataString(capacityReservationGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -137,25 +135,24 @@ internal CapacityReservationsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -167,55 +164,56 @@ internal CapacityReservationsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -225,9 +223,10 @@ internal CapacityReservationsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -238,25 +237,29 @@ internal CapacityReservationsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation that retrieves information about the capacity reservation. /// @@ -270,10 +273,9 @@ internal CapacityReservationsOperations(ComputeManagementClient client) /// The name of the capacity reservation. /// /// - /// The expand expression to apply on the operation. 'InstanceView' retrieves a + /// The expand expression to apply on the operation. 'InstanceView' retrieves a /// snapshot of the runtime properties of the capacity reservation that is /// managed by the platform and can change outside of control plane operations. - /// Possible values include: 'instanceView' /// /// /// Headers that will be added to request. @@ -281,13 +283,13 @@ internal CapacityReservationsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -296,59 +298,71 @@ internal CapacityReservationsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (capacityReservationGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "capacityReservationGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "capacityReservationGroupName"); } + if (capacityReservationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "capacityReservationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "capacityReservationName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("capacityReservationGroupName", capacityReservationGroupName); tracingParameters.Add("capacityReservationName", capacityReservationName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{capacityReservationGroupName}", System.Uri.EscapeDataString(capacityReservationGroupName)); _url = _url.Replace("{capacityReservationName}", System.Uri.EscapeDataString(capacityReservationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -362,25 +376,24 @@ internal CapacityReservationsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -392,55 +405,56 @@ internal CapacityReservationsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -450,9 +464,10 @@ internal CapacityReservationsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -463,25 +478,29 @@ internal CapacityReservationsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to create or update a capacity reservation. Please note some /// properties can be set only during capacity reservation creation. Please @@ -500,16 +519,16 @@ internal CapacityReservationsOperations(ComputeManagementClient client) /// Parameters supplied to the Create capacity reservation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservation parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -528,16 +547,16 @@ internal CapacityReservationsOperations(ComputeManagementClient client) /// Parameters supplied to the Update capacity reservation operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservationUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservationUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -557,16 +576,16 @@ internal CapacityReservationsOperations(ComputeManagementClient client) /// The name of the capacity reservation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -592,13 +611,13 @@ internal CapacityReservationsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -607,67 +626,78 @@ internal CapacityReservationsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservation parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (capacityReservationGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "capacityReservationGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "capacityReservationGroupName"); } + if (capacityReservationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "capacityReservationName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "capacityReservationName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("capacityReservationGroupName", capacityReservationGroupName); tracingParameters.Add("capacityReservationName", capacityReservationName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{capacityReservationGroupName}", System.Uri.EscapeDataString(capacityReservationGroupName)); _url = _url.Replace("{capacityReservationName}", System.Uri.EscapeDataString(capacityReservationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -677,25 +707,24 @@ internal CapacityReservationsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -707,61 +736,62 @@ internal CapacityReservationsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -771,9 +801,10 @@ internal CapacityReservationsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -784,16 +815,16 @@ internal CapacityReservationsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -802,38 +833,42 @@ internal CapacityReservationsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to update a capacity reservation. /// @@ -855,13 +890,13 @@ internal CapacityReservationsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -870,63 +905,74 @@ internal CapacityReservationsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservationUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservationUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (capacityReservationGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "capacityReservationGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "capacityReservationGroupName"); } + if (capacityReservationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "capacityReservationName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "capacityReservationName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("capacityReservationGroupName", capacityReservationGroupName); tracingParameters.Add("capacityReservationName", capacityReservationName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{capacityReservationGroupName}", System.Uri.EscapeDataString(capacityReservationGroupName)); _url = _url.Replace("{capacityReservationName}", System.Uri.EscapeDataString(capacityReservationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -936,25 +982,24 @@ internal CapacityReservationsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -966,61 +1011,62 @@ internal CapacityReservationsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1030,9 +1076,10 @@ internal CapacityReservationsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1043,25 +1090,29 @@ internal CapacityReservationsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to delete a capacity reservation. This operation is allowed /// only when all the associated resources are disassociated from the capacity @@ -1084,10 +1135,10 @@ internal CapacityReservationsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1096,58 +1147,69 @@ internal CapacityReservationsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (capacityReservationGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "capacityReservationGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "capacityReservationGroupName"); } + if (capacityReservationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "capacityReservationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "capacityReservationName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("capacityReservationGroupName", capacityReservationGroupName); tracingParameters.Add("capacityReservationName", capacityReservationName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{capacityReservationGroupName}", System.Uri.EscapeDataString(capacityReservationGroupName)); _url = _url.Replace("{capacityReservationName}", System.Uri.EscapeDataString(capacityReservationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1157,25 +1219,24 @@ internal CapacityReservationsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1187,55 +1248,56 @@ internal CapacityReservationsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1245,20 +1307,25 @@ internal CapacityReservationsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the capacity reservations in the specified capacity /// reservation group. Use the nextLink property in the response to get the @@ -1273,13 +1340,13 @@ internal CapacityReservationsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1288,51 +1355,54 @@ internal CapacityReservationsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByCapacityReservationGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByCapacityReservationGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByCapacityReservationGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByCapacityReservationGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1344,55 +1414,56 @@ internal CapacityReservationsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1402,9 +1473,10 @@ internal CapacityReservationsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1415,24 +1487,28 @@ internal CapacityReservationsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/CapacityReservationsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/CapacityReservationsOperationsExtensions.cs index 58a3d6540333..b84f6a7b9029 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/CapacityReservationsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/CapacityReservationsOperationsExtensions.cs @@ -1,483 +1,439 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for CapacityReservationsOperations. + /// Extension methods for CapacityReservationsOperations /// public static partial class CapacityReservationsOperationsExtensions { - /// - /// Lists all of the capacity reservations in the specified capacity - /// reservation group. Use the nextLink property in the response to get the - /// next page of capacity reservations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - public static IPage ListByCapacityReservationGroup(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName) - { - return operations.ListByCapacityReservationGroupAsync(resourceGroupName, capacityReservationGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the capacity reservations in the specified capacity - /// reservation group. Use the nextLink property in the response to get the - /// next page of capacity reservations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByCapacityReservationGroupAsync(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByCapacityReservationGroupWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation that retrieves information about the capacity reservation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The name of the capacity reservation. - /// - /// - /// The expand expression to apply on the operation. 'InstanceView' retrieves a - /// snapshot of the runtime properties of the capacity reservation that is - /// managed by the platform and can change outside of control plane operations. - /// Possible values include: 'instanceView' - /// - public static CapacityReservation Get(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, expand).GetAwaiter().GetResult(); - } - - /// - /// The operation that retrieves information about the capacity reservation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The name of the capacity reservation. - /// - /// - /// The expand expression to apply on the operation. 'InstanceView' retrieves a - /// snapshot of the runtime properties of the capacity reservation that is - /// managed by the platform and can change outside of control plane operations. - /// Possible values include: 'instanceView' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to create or update a capacity reservation. Please note some - /// properties can be set only during capacity reservation creation. Please - /// refer to https://aka.ms/CapacityReservation for more details. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The name of the capacity reservation. - /// - /// - /// Parameters supplied to the Create capacity reservation. - /// - public static CapacityReservation CreateOrUpdate(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservation parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters).GetAwaiter().GetResult(); - } - - /// - /// The operation to create or update a capacity reservation. Please note some - /// properties can be set only during capacity reservation creation. Please - /// refer to https://aka.ms/CapacityReservation for more details. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The name of the capacity reservation. - /// - /// - /// Parameters supplied to the Create capacity reservation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservation parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to update a capacity reservation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The name of the capacity reservation. - /// - /// - /// Parameters supplied to the Update capacity reservation operation. - /// - public static CapacityReservation Update(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservationUpdate parameters) - { - return operations.UpdateAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters).GetAwaiter().GetResult(); - } - - /// - /// The operation to update a capacity reservation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The name of the capacity reservation. - /// - /// - /// Parameters supplied to the Update capacity reservation operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservationUpdate parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Lists all of the capacity reservations in the specified capacity + /// reservation group. Use the nextLink property in the response to get the + /// next page of capacity reservations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + public static Microsoft.Rest.Azure.IPage ListByCapacityReservationGroup(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName) + { + return ((ICapacityReservationsOperations)operations).ListByCapacityReservationGroupAsync(resourceGroupName, capacityReservationGroupName).GetAwaiter().GetResult(); + } - /// - /// The operation to delete a capacity reservation. This operation is allowed - /// only when all the associated resources are disassociated from the capacity - /// reservation. Please refer to https://aka.ms/CapacityReservation for more - /// details. Note: Block capacity reservations cannot be deleted after it has - /// been successfully allocated until the schedule end time. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The name of the capacity reservation. - /// - public static void Delete(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName) + /// + /// Lists all of the capacity reservations in the specified capacity + /// reservation group. Use the nextLink property in the response to get the + /// next page of capacity reservations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByCapacityReservationGroupAsync(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByCapacityReservationGroupWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation that retrieves information about the capacity reservation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The name of the capacity reservation. + /// + /// + /// The expand expression to apply on the operation. 'InstanceView' retrieves a + /// snapshot of the runtime properties of the capacity reservation that is + /// managed by the platform and can change outside of control plane operations. + /// + public static CapacityReservation Get(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, string expand = default(string)) + { + return ((ICapacityReservationsOperations)operations).GetAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, expand).GetAwaiter().GetResult(); + } - /// - /// The operation to delete a capacity reservation. This operation is allowed - /// only when all the associated resources are disassociated from the capacity - /// reservation. Please refer to https://aka.ms/CapacityReservation for more - /// details. Note: Block capacity reservations cannot be deleted after it has - /// been successfully allocated until the schedule end time. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The name of the capacity reservation. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation that retrieves information about the capacity reservation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The name of the capacity reservation. + /// + /// + /// The expand expression to apply on the operation. 'InstanceView' retrieves a + /// snapshot of the runtime properties of the capacity reservation that is + /// managed by the platform and can change outside of control plane operations. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, expand, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// The operation to create or update a capacity reservation. Please note some + /// properties can be set only during capacity reservation creation. Please + /// refer to https://aka.ms/CapacityReservation for more details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The name of the capacity reservation. + /// + public static CapacityReservation CreateOrUpdate(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservation parameters) + { + return ((ICapacityReservationsOperations)operations).CreateOrUpdateAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters).GetAwaiter().GetResult(); + } - /// - /// The operation to create or update a capacity reservation. Please note some - /// properties can be set only during capacity reservation creation. Please - /// refer to https://aka.ms/CapacityReservation for more details. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The name of the capacity reservation. - /// - /// - /// Parameters supplied to the Create capacity reservation. - /// - public static CapacityReservation BeginCreateOrUpdate(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservation parameters) + /// + /// The operation to create or update a capacity reservation. Please note some + /// properties can be set only during capacity reservation creation. Please + /// refer to https://aka.ms/CapacityReservation for more details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The name of the capacity reservation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservation parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to update a capacity reservation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The name of the capacity reservation. + /// + public static CapacityReservation Update(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservationUpdate parameters) + { + return ((ICapacityReservationsOperations)operations).UpdateAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters).GetAwaiter().GetResult(); + } - /// - /// The operation to create or update a capacity reservation. Please note some - /// properties can be set only during capacity reservation creation. Please - /// refer to https://aka.ms/CapacityReservation for more details. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The name of the capacity reservation. - /// - /// - /// Parameters supplied to the Create capacity reservation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservation parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to update a capacity reservation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The name of the capacity reservation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservationUpdate parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// The operation to delete a capacity reservation. This operation is allowed + /// only when all the associated resources are disassociated from the capacity + /// reservation. Please refer to https://aka.ms/CapacityReservation for more + /// details. Note: Block capacity reservations cannot be deleted after it has + /// been successfully allocated until the schedule end time. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The name of the capacity reservation. + /// + public static void Delete(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName) + { + ((ICapacityReservationsOperations)operations).DeleteAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName).GetAwaiter().GetResult(); + } - /// - /// The operation to update a capacity reservation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The name of the capacity reservation. - /// - /// - /// Parameters supplied to the Update capacity reservation operation. - /// - public static CapacityReservation BeginUpdate(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservationUpdate parameters) - { - return operations.BeginUpdateAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters).GetAwaiter().GetResult(); - } - - /// - /// The operation to update a capacity reservation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The name of the capacity reservation. - /// - /// - /// Parameters supplied to the Update capacity reservation operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservationUpdate parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// The operation to delete a capacity reservation. This operation is allowed + /// only when all the associated resources are disassociated from the capacity + /// reservation. Please refer to https://aka.ms/CapacityReservation for more + /// details. Note: Block capacity reservations cannot be deleted after it has + /// been successfully allocated until the schedule end time. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The name of the capacity reservation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to create or update a capacity reservation. Please note some + /// properties can be set only during capacity reservation creation. Please + /// refer to https://aka.ms/CapacityReservation for more details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The name of the capacity reservation. + /// + public static CapacityReservation BeginCreateOrUpdate(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservation parameters) + { + return ((ICapacityReservationsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters).GetAwaiter().GetResult(); + } - /// - /// The operation to delete a capacity reservation. This operation is allowed - /// only when all the associated resources are disassociated from the capacity - /// reservation. Please refer to https://aka.ms/CapacityReservation for more - /// details. Note: Block capacity reservations cannot be deleted after it has - /// been successfully allocated until the schedule end time. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The name of the capacity reservation. - /// - public static void BeginDelete(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName) + /// + /// The operation to create or update a capacity reservation. Please note some + /// properties can be set only during capacity reservation creation. Please + /// refer to https://aka.ms/CapacityReservation for more details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The name of the capacity reservation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservation parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to update a capacity reservation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The name of the capacity reservation. + /// + public static CapacityReservation BeginUpdate(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservationUpdate parameters) + { + return ((ICapacityReservationsOperations)operations).BeginUpdateAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters).GetAwaiter().GetResult(); + } - /// - /// The operation to delete a capacity reservation. This operation is allowed - /// only when all the associated resources are disassociated from the capacity - /// reservation. Please refer to https://aka.ms/CapacityReservation for more - /// details. Note: Block capacity reservations cannot be deleted after it has - /// been successfully allocated until the schedule end time. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the capacity reservation group. - /// - /// - /// The name of the capacity reservation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to update a capacity reservation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The name of the capacity reservation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservationUpdate parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// The operation to delete a capacity reservation. This operation is allowed + /// only when all the associated resources are disassociated from the capacity + /// reservation. Please refer to https://aka.ms/CapacityReservation for more + /// details. Note: Block capacity reservations cannot be deleted after it has + /// been successfully allocated until the schedule end time. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The name of the capacity reservation. + /// + public static void BeginDelete(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName) + { + ((ICapacityReservationsOperations)operations).BeginDeleteAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName).GetAwaiter().GetResult(); + } - /// - /// Lists all of the capacity reservations in the specified capacity - /// reservation group. Use the nextLink property in the response to get the - /// next page of capacity reservations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByCapacityReservationGroupNext(this ICapacityReservationsOperations operations, string nextPageLink) - { - return operations.ListByCapacityReservationGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } + /// + /// The operation to delete a capacity reservation. This operation is allowed + /// only when all the associated resources are disassociated from the capacity + /// reservation. Please refer to https://aka.ms/CapacityReservation for more + /// details. Note: Block capacity reservations cannot be deleted after it has + /// been successfully allocated until the schedule end time. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the capacity reservation group. + /// + /// + /// The name of the capacity reservation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ICapacityReservationsOperations operations, string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all of the capacity reservations in the specified capacity + /// reservation group. Use the nextLink property in the response to get the + /// next page of capacity reservations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByCapacityReservationGroupNext(this ICapacityReservationsOperations operations, string nextPageLink) + { + return ((ICapacityReservationsOperations)operations).ListByCapacityReservationGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists all of the capacity reservations in the specified capacity - /// reservation group. Use the nextLink property in the response to get the - /// next page of capacity reservations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByCapacityReservationGroupNextAsync(this ICapacityReservationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all of the capacity reservations in the specified capacity + /// reservation group. Use the nextLink property in the response to get the + /// next page of capacity reservations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByCapacityReservationGroupNextAsync(this ICapacityReservationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByCapacityReservationGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByCapacityReservationGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleriesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleriesOperations.cs index 71a960b11025..9067cf60ef61 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleriesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleriesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// CommunityGalleriesOperations operations. /// - internal partial class CommunityGalleriesOperations : IServiceOperations, ICommunityGalleriesOperations + internal partial class CommunityGalleriesOperations : Microsoft.Rest.IServiceOperations, ICommunityGalleriesOperations { /// /// Initializes a new instance of the CommunityGalleriesOperations class. @@ -36,13 +24,13 @@ internal partial class CommunityGalleriesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal CommunityGalleriesOperations(ComputeManagementClient client) + internal CommunityGalleriesOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal CommunityGalleriesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,48 +68,58 @@ internal CommunityGalleriesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string location, string publicGalleryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string publicGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (publicGalleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicGalleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicGalleryName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("publicGalleryName", publicGalleryName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{publicGalleryName}", System.Uri.EscapeDataString(publicGalleryName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -131,25 +129,24 @@ internal CommunityGalleriesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -161,55 +158,56 @@ internal CommunityGalleriesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -219,9 +217,10 @@ internal CommunityGalleriesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -232,24 +231,28 @@ internal CommunityGalleriesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleriesOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleriesOperationsExtensions.cs index 57a5c67f247f..f4e06864af2c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleriesOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleriesOperationsExtensions.cs @@ -1,65 +1,55 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for CommunityGalleriesOperations. + /// Extension methods for CommunityGalleriesOperations /// public static partial class CommunityGalleriesOperationsExtensions { - /// - /// Get a community gallery by gallery public name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The public name of the community gallery. - /// - public static CommunityGallery Get(this ICommunityGalleriesOperations operations, string location, string publicGalleryName) - { - return operations.GetAsync(location, publicGalleryName).GetAwaiter().GetResult(); - } + /// + /// Get a community gallery by gallery public name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The public name of the community gallery. + /// + public static CommunityGallery Get(this ICommunityGalleriesOperations operations, string location, string publicGalleryName) + { + return ((ICommunityGalleriesOperations)operations).GetAsync(location, publicGalleryName).GetAwaiter().GetResult(); + } - /// - /// Get a community gallery by gallery public name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The public name of the community gallery. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ICommunityGalleriesOperations operations, string location, string publicGalleryName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get a community gallery by gallery public name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The public name of the community gallery. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ICommunityGalleriesOperations operations, string location, string publicGalleryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, publicGalleryName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(location, publicGalleryName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImageVersionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImageVersionsOperations.cs index e0a62b225e5e..e282bd65955c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImageVersionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImageVersionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// CommunityGalleryImageVersionsOperations operations. /// - internal partial class CommunityGalleryImageVersionsOperations : IServiceOperations, ICommunityGalleryImageVersionsOperations + internal partial class CommunityGalleryImageVersionsOperations : Microsoft.Rest.IServiceOperations, ICommunityGalleryImageVersionsOperations { /// /// Initializes a new instance of the CommunityGalleryImageVersionsOperations class. @@ -36,13 +24,13 @@ internal partial class CommunityGalleryImageVersionsOperations : IServiceOperati /// /// Thrown when a required parameter is null /// - internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) + internal CommunityGalleryImageVersionsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,54 +71,65 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, string publicGalleryName, string galleryImageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string publicGalleryName, string galleryImageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (publicGalleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicGalleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicGalleryName"); } + if (galleryImageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("publicGalleryName", publicGalleryName); tracingParameters.Add("galleryImageName", galleryImageName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{publicGalleryName}", System.Uri.EscapeDataString(publicGalleryName)); _url = _url.Replace("{galleryImageName}", System.Uri.EscapeDataString(galleryImageName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -140,25 +139,24 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -170,55 +168,56 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -228,9 +227,10 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -241,25 +241,29 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get a community gallery image version. /// @@ -284,13 +288,13 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -299,60 +303,72 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string location, string publicGalleryName, string galleryImageName, string galleryImageVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string publicGalleryName, string galleryImageName, string galleryImageVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (publicGalleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicGalleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicGalleryName"); } + if (galleryImageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } + if (galleryImageVersionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageVersionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageVersionName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("publicGalleryName", publicGalleryName); tracingParameters.Add("galleryImageName", galleryImageName); tracingParameters.Add("galleryImageVersionName", galleryImageVersionName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{publicGalleryName}", System.Uri.EscapeDataString(publicGalleryName)); _url = _url.Replace("{galleryImageName}", System.Uri.EscapeDataString(galleryImageName)); _url = _url.Replace("{galleryImageVersionName}", System.Uri.EscapeDataString(galleryImageVersionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -362,25 +378,24 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -392,55 +407,56 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -450,9 +466,10 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -463,25 +480,29 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List community gallery image versions inside an image. /// @@ -494,13 +515,13 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -509,51 +530,54 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -565,55 +589,56 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -623,9 +648,10 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -636,24 +662,28 @@ internal CommunityGalleryImageVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImageVersionsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImageVersionsOperationsExtensions.cs index f19f850397f5..e7da4bacf7d8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImageVersionsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImageVersionsOperationsExtensions.cs @@ -1,163 +1,151 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for CommunityGalleryImageVersionsOperations. + /// Extension methods for CommunityGalleryImageVersionsOperations /// public static partial class CommunityGalleryImageVersionsOperationsExtensions { - /// - /// List community gallery image versions inside an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The public name of the community gallery. - /// - /// - /// The name of the community gallery image definition. - /// - public static IPage List(this ICommunityGalleryImageVersionsOperations operations, string location, string publicGalleryName, string galleryImageName) - { - return operations.ListAsync(location, publicGalleryName, galleryImageName).GetAwaiter().GetResult(); - } - - /// - /// List community gallery image versions inside an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The public name of the community gallery. - /// - /// - /// The name of the community gallery image definition. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ICommunityGalleryImageVersionsOperations operations, string location, string publicGalleryName, string galleryImageName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(location, publicGalleryName, galleryImageName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List community gallery image versions inside an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The public name of the community gallery. + /// + /// + /// The name of the community gallery image definition. + /// + public static Microsoft.Rest.Azure.IPage List(this ICommunityGalleryImageVersionsOperations operations, string location, string publicGalleryName, string galleryImageName) + { + return ((ICommunityGalleryImageVersionsOperations)operations).ListAsync(location, publicGalleryName, galleryImageName).GetAwaiter().GetResult(); + } - /// - /// Get a community gallery image version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The public name of the community gallery. - /// - /// - /// The name of the community gallery image definition. - /// - /// - /// The name of the community gallery image version. Needs to follow semantic - /// version name pattern: The allowed characters are digit and period. Digits - /// must be within the range of a 32-bit integer. Format: - /// <MajorVersion>.<MinorVersion>.<Patch> - /// - public static CommunityGalleryImageVersion Get(this ICommunityGalleryImageVersionsOperations operations, string location, string publicGalleryName, string galleryImageName, string galleryImageVersionName) + /// + /// List community gallery image versions inside an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The public name of the community gallery. + /// + /// + /// The name of the community gallery image definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ICommunityGalleryImageVersionsOperations operations, string location, string publicGalleryName, string galleryImageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, publicGalleryName, galleryImageName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(location, publicGalleryName, galleryImageName, galleryImageVersionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get a community gallery image version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The public name of the community gallery. + /// + /// + /// The name of the community gallery image definition. + /// + /// + /// The name of the community gallery image version. Needs to follow semantic + /// version name pattern: The allowed characters are digit and period. Digits + /// must be within the range of a 32-bit integer. Format: + /// <MajorVersion>.<MinorVersion>.<Patch> + /// + public static CommunityGalleryImageVersion Get(this ICommunityGalleryImageVersionsOperations operations, string location, string publicGalleryName, string galleryImageName, string galleryImageVersionName) + { + return ((ICommunityGalleryImageVersionsOperations)operations).GetAsync(location, publicGalleryName, galleryImageName, galleryImageVersionName).GetAwaiter().GetResult(); + } - /// - /// Get a community gallery image version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The public name of the community gallery. - /// - /// - /// The name of the community gallery image definition. - /// - /// - /// The name of the community gallery image version. Needs to follow semantic - /// version name pattern: The allowed characters are digit and period. Digits - /// must be within the range of a 32-bit integer. Format: - /// <MajorVersion>.<MinorVersion>.<Patch> - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ICommunityGalleryImageVersionsOperations operations, string location, string publicGalleryName, string galleryImageName, string galleryImageVersionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get a community gallery image version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The public name of the community gallery. + /// + /// + /// The name of the community gallery image definition. + /// + /// + /// The name of the community gallery image version. Needs to follow semantic + /// version name pattern: The allowed characters are digit and period. Digits + /// must be within the range of a 32-bit integer. Format: + /// <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ICommunityGalleryImageVersionsOperations operations, string location, string publicGalleryName, string galleryImageName, string galleryImageVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, publicGalleryName, galleryImageName, galleryImageVersionName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(location, publicGalleryName, galleryImageName, galleryImageVersionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List community gallery image versions inside an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ICommunityGalleryImageVersionsOperations operations, string nextPageLink) + { + return ((ICommunityGalleryImageVersionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List community gallery image versions inside an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ICommunityGalleryImageVersionsOperations operations, string nextPageLink) + /// + /// List community gallery image versions inside an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ICommunityGalleryImageVersionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// List community gallery image versions inside an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ICommunityGalleryImageVersionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImagesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImagesOperations.cs index 6fac391dd4a1..4d88f9dcc10b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImagesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImagesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// CommunityGalleryImagesOperations operations. /// - internal partial class CommunityGalleryImagesOperations : IServiceOperations, ICommunityGalleryImagesOperations + internal partial class CommunityGalleryImagesOperations : Microsoft.Rest.IServiceOperations, ICommunityGalleryImagesOperations { /// /// Initializes a new instance of the CommunityGalleryImagesOperations class. @@ -36,13 +24,13 @@ internal partial class CommunityGalleryImagesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal CommunityGalleryImagesOperations(ComputeManagementClient client) + internal CommunityGalleryImagesOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,48 +68,58 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, string publicGalleryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string publicGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (publicGalleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicGalleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicGalleryName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("publicGalleryName", publicGalleryName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{publicGalleryName}", System.Uri.EscapeDataString(publicGalleryName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -131,25 +129,24 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -161,55 +158,56 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -219,9 +217,10 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -232,25 +231,29 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get a community gallery image. /// @@ -269,13 +272,13 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -284,54 +287,65 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string location, string publicGalleryName, string galleryImageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string publicGalleryName, string galleryImageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (publicGalleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicGalleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publicGalleryName"); } + if (galleryImageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("publicGalleryName", publicGalleryName); tracingParameters.Add("galleryImageName", galleryImageName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{publicGalleryName}", System.Uri.EscapeDataString(publicGalleryName)); _url = _url.Replace("{galleryImageName}", System.Uri.EscapeDataString(galleryImageName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -341,25 +355,24 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -371,55 +384,56 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -429,9 +443,10 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -442,25 +457,29 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List community gallery images inside a gallery. /// @@ -473,13 +492,13 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -488,51 +507,54 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -544,55 +566,56 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -602,9 +625,10 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -615,24 +639,28 @@ internal CommunityGalleryImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImagesOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImagesOperationsExtensions.cs index 84551246fab7..41cbcacaebcb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImagesOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/CommunityGalleryImagesOperationsExtensions.cs @@ -1,145 +1,133 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for CommunityGalleryImagesOperations. + /// Extension methods for CommunityGalleryImagesOperations /// public static partial class CommunityGalleryImagesOperationsExtensions { - /// - /// List community gallery images inside a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The public name of the community gallery. - /// - public static IPage List(this ICommunityGalleryImagesOperations operations, string location, string publicGalleryName) - { - return operations.ListAsync(location, publicGalleryName).GetAwaiter().GetResult(); - } - - /// - /// List community gallery images inside a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The public name of the community gallery. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ICommunityGalleryImagesOperations operations, string location, string publicGalleryName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(location, publicGalleryName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List community gallery images inside a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The public name of the community gallery. + /// + public static Microsoft.Rest.Azure.IPage List(this ICommunityGalleryImagesOperations operations, string location, string publicGalleryName) + { + return ((ICommunityGalleryImagesOperations)operations).ListAsync(location, publicGalleryName).GetAwaiter().GetResult(); + } - /// - /// Get a community gallery image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The public name of the community gallery. - /// - /// - /// The name of the community gallery image definition. - /// - public static CommunityGalleryImage Get(this ICommunityGalleryImagesOperations operations, string location, string publicGalleryName, string galleryImageName) + /// + /// List community gallery images inside a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The public name of the community gallery. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ICommunityGalleryImagesOperations operations, string location, string publicGalleryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, publicGalleryName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(location, publicGalleryName, galleryImageName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get a community gallery image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The public name of the community gallery. + /// + /// + /// The name of the community gallery image definition. + /// + public static CommunityGalleryImage Get(this ICommunityGalleryImagesOperations operations, string location, string publicGalleryName, string galleryImageName) + { + return ((ICommunityGalleryImagesOperations)operations).GetAsync(location, publicGalleryName, galleryImageName).GetAwaiter().GetResult(); + } - /// - /// Get a community gallery image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The public name of the community gallery. - /// - /// - /// The name of the community gallery image definition. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ICommunityGalleryImagesOperations operations, string location, string publicGalleryName, string galleryImageName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get a community gallery image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The public name of the community gallery. + /// + /// + /// The name of the community gallery image definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ICommunityGalleryImagesOperations operations, string location, string publicGalleryName, string galleryImageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, publicGalleryName, galleryImageName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(location, publicGalleryName, galleryImageName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List community gallery images inside a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ICommunityGalleryImagesOperations operations, string nextPageLink) + { + return ((ICommunityGalleryImagesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List community gallery images inside a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ICommunityGalleryImagesOperations operations, string nextPageLink) + /// + /// List community gallery images inside a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ICommunityGalleryImagesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// List community gallery images inside a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ICommunityGalleryImagesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/ComputeManagementClient.cs b/src/Compute/Compute.Management.Sdk/Generated/ComputeManagementClient.cs index dd0ce5bd3d5f..a014ef472989 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ComputeManagementClient.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ComputeManagementClient.cs @@ -1,308 +1,250 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - public partial class ComputeManagementClient : ServiceClient, IComputeManagementClient, IAzureClient + /// + /// The Compute Management Client. + /// + public partial class ComputeManagementClient : Microsoft.Rest.ServiceClient, IComputeManagementClient, IAzureClient { /// /// The base URI of the service. /// public System.Uri BaseUri { get; set; } - /// /// Gets or sets json serialization settings. /// - public JsonSerializerSettings SerializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public JsonSerializerSettings DeserializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public ServiceClientCredentials Credentials { get; private set; } + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } /// /// Subscription credentials which uniquely identify Microsoft Azure /// subscription. The subscription ID forms part of the URI for every service /// call. /// - public string SubscriptionId { get; set; } + public string SubscriptionId { get; set;} /// /// The preferred language for the response. /// - public string AcceptLanguage { get; set; } + public string AcceptLanguage { get; set;} /// - /// The retry timeout in seconds for Long Running Operations. Default value is - /// 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// /// value is 30. /// - public int? LongRunningOperationRetryTimeout { get; set; } + public int? LongRunningOperationRetryTimeout { get; set;} /// - /// Whether a unique x-ms-client-request-id should be generated. When set to - /// true a unique x-ms-client-request-id value is generated and included in - /// each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - public bool? GenerateClientRequestId { get; set; } + public bool? GenerateClientRequestId { get; set;} /// - /// Gets the IOperations. + /// Gets the IOperations /// public virtual IOperations Operations { get; private set; } - /// - /// Gets the IAvailabilitySetsOperations. + /// Gets the IAvailabilitySetsOperations /// public virtual IAvailabilitySetsOperations AvailabilitySets { get; private set; } - /// - /// Gets the ICapacityReservationGroupsOperations. + /// Gets the ICapacityReservationGroupsOperations /// public virtual ICapacityReservationGroupsOperations CapacityReservationGroups { get; private set; } - /// - /// Gets the IDedicatedHostGroupsOperations. + /// Gets the IDedicatedHostGroupsOperations /// public virtual IDedicatedHostGroupsOperations DedicatedHostGroups { get; private set; } - /// - /// Gets the IImagesOperations. + /// Gets the IImagesOperations /// public virtual IImagesOperations Images { get; private set; } - /// - /// Gets the IVirtualMachineImagesEdgeZoneOperations. + /// Gets the IVirtualMachineImagesEdgeZoneOperations /// public virtual IVirtualMachineImagesEdgeZoneOperations VirtualMachineImagesEdgeZone { get; private set; } - /// - /// Gets the IVirtualMachineImagesOperations. + /// Gets the IVirtualMachineImagesOperations /// public virtual IVirtualMachineImagesOperations VirtualMachineImages { get; private set; } - /// - /// Gets the ILogAnalyticsOperations. + /// Gets the ILogAnalyticsOperations /// public virtual ILogAnalyticsOperations LogAnalytics { get; private set; } - /// - /// Gets the IVirtualMachineExtensionImagesOperations. + /// Gets the IVirtualMachineExtensionImagesOperations /// public virtual IVirtualMachineExtensionImagesOperations VirtualMachineExtensionImages { get; private set; } - /// - /// Gets the IVirtualMachineRunCommandsOperations. + /// Gets the IVirtualMachineRunCommandsOperations /// public virtual IVirtualMachineRunCommandsOperations VirtualMachineRunCommands { get; private set; } - /// - /// Gets the IUsageOperations. + /// Gets the IUsageOperations /// public virtual IUsageOperations Usage { get; private set; } - /// - /// Gets the IVirtualMachineScaleSetsOperations. + /// Gets the IVirtualMachineScaleSetsOperations /// public virtual IVirtualMachineScaleSetsOperations VirtualMachineScaleSets { get; private set; } - /// - /// Gets the IVirtualMachinesOperations. + /// Gets the IVirtualMachinesOperations /// public virtual IVirtualMachinesOperations VirtualMachines { get; private set; } - /// - /// Gets the IVirtualMachineSizesOperations. + /// Gets the IVirtualMachineSizesOperations /// public virtual IVirtualMachineSizesOperations VirtualMachineSizes { get; private set; } - /// - /// Gets the IProximityPlacementGroupsOperations. + /// Gets the IProximityPlacementGroupsOperations /// public virtual IProximityPlacementGroupsOperations ProximityPlacementGroups { get; private set; } - /// - /// Gets the IRestorePointCollectionsOperations. + /// Gets the IRestorePointCollectionsOperations /// public virtual IRestorePointCollectionsOperations RestorePointCollections { get; private set; } - /// - /// Gets the ISshPublicKeysOperations. + /// Gets the ISshPublicKeysOperations /// public virtual ISshPublicKeysOperations SshPublicKeys { get; private set; } - /// - /// Gets the ICapacityReservationsOperations. + /// Gets the ICapacityReservationsOperations /// public virtual ICapacityReservationsOperations CapacityReservations { get; private set; } - /// - /// Gets the IDedicatedHostsOperations. + /// Gets the IDedicatedHostsOperations /// public virtual IDedicatedHostsOperations DedicatedHosts { get; private set; } - /// - /// Gets the IRestorePointsOperations. + /// Gets the IRestorePointsOperations /// public virtual IRestorePointsOperations RestorePoints { get; private set; } - /// - /// Gets the IVirtualMachineScaleSetRollingUpgradesOperations. + /// Gets the IVirtualMachineScaleSetRollingUpgradesOperations /// public virtual IVirtualMachineScaleSetRollingUpgradesOperations VirtualMachineScaleSetRollingUpgrades { get; private set; } - /// - /// Gets the IVirtualMachineScaleSetExtensionsOperations. + /// Gets the IVirtualMachineScaleSetExtensionsOperations /// public virtual IVirtualMachineScaleSetExtensionsOperations VirtualMachineScaleSetExtensions { get; private set; } - /// - /// Gets the IVirtualMachineScaleSetVMsOperations. + /// Gets the IVirtualMachineScaleSetVMSOperations /// - public virtual IVirtualMachineScaleSetVMsOperations VirtualMachineScaleSetVMs { get; private set; } - + public virtual IVirtualMachineScaleSetVMSOperations VirtualMachineScaleSetVMS { get; private set; } /// - /// Gets the IVirtualMachineScaleSetVMExtensionsOperations. + /// Gets the IVirtualMachineScaleSetVMExtensionsOperations /// public virtual IVirtualMachineScaleSetVMExtensionsOperations VirtualMachineScaleSetVMExtensions { get; private set; } - /// - /// Gets the IVirtualMachineScaleSetVMRunCommandsOperations. + /// Gets the IVirtualMachineScaleSetVMRunCommandsOperations /// public virtual IVirtualMachineScaleSetVMRunCommandsOperations VirtualMachineScaleSetVMRunCommands { get; private set; } - /// - /// Gets the IVirtualMachineExtensionsOperations. + /// Gets the IVirtualMachineExtensionsOperations /// public virtual IVirtualMachineExtensionsOperations VirtualMachineExtensions { get; private set; } - /// - /// Gets the IDiskAccessesOperations. + /// Gets the IDiskAccessesOperations /// public virtual IDiskAccessesOperations DiskAccesses { get; private set; } - /// - /// Gets the IDiskEncryptionSetsOperations. + /// Gets the IDiskEncryptionSetsOperations /// public virtual IDiskEncryptionSetsOperations DiskEncryptionSets { get; private set; } - /// - /// Gets the IDisksOperations. + /// Gets the IDisksOperations /// public virtual IDisksOperations Disks { get; private set; } - /// - /// Gets the ISnapshotsOperations. + /// Gets the ISnapshotsOperations /// public virtual ISnapshotsOperations Snapshots { get; private set; } - /// - /// Gets the IDiskRestorePointOperations. + /// Gets the IDiskRestorePointOperations /// public virtual IDiskRestorePointOperations DiskRestorePoint { get; private set; } - /// - /// Gets the IGalleriesOperations. + /// Gets the IGalleriesOperations /// public virtual IGalleriesOperations Galleries { get; private set; } - /// - /// Gets the ICommunityGalleriesOperations. + /// Gets the ICommunityGalleriesOperations /// public virtual ICommunityGalleriesOperations CommunityGalleries { get; private set; } - /// - /// Gets the ICommunityGalleryImagesOperations. + /// Gets the ICommunityGalleryImagesOperations /// public virtual ICommunityGalleryImagesOperations CommunityGalleryImages { get; private set; } - /// - /// Gets the ICommunityGalleryImageVersionsOperations. + /// Gets the ICommunityGalleryImageVersionsOperations /// public virtual ICommunityGalleryImageVersionsOperations CommunityGalleryImageVersions { get; private set; } - /// - /// Gets the ISharedGalleriesOperations. + /// Gets the ISharedGalleriesOperations /// public virtual ISharedGalleriesOperations SharedGalleries { get; private set; } - /// - /// Gets the ISharedGalleryImagesOperations. + /// Gets the ISharedGalleryImagesOperations /// public virtual ISharedGalleryImagesOperations SharedGalleryImages { get; private set; } - /// - /// Gets the ISharedGalleryImageVersionsOperations. + /// Gets the ISharedGalleryImageVersionsOperations /// public virtual ISharedGalleryImageVersionsOperations SharedGalleryImageVersions { get; private set; } - /// - /// Gets the IGalleryApplicationsOperations. + /// Gets the IGalleryApplicationsOperations /// public virtual IGalleryApplicationsOperations GalleryApplications { get; private set; } - /// - /// Gets the IGalleryApplicationVersionsOperations. + /// Gets the IGalleryApplicationVersionsOperations /// public virtual IGalleryApplicationVersionsOperations GalleryApplicationVersions { get; private set; } - /// - /// Gets the IGalleryImagesOperations. + /// Gets the IGalleryImagesOperations /// public virtual IGalleryImagesOperations GalleryImages { get; private set; } - /// - /// Gets the IGalleryImageVersionsOperations. + /// Gets the IGalleryImageVersionsOperations /// public virtual IGalleryImageVersionsOperations GalleryImageVersions { get; private set; } - /// - /// Gets the IGalleryInVMAccessControlProfilesOperations. + /// Gets the IGalleryInVMAccessControlProfilesOperations /// public virtual IGalleryInVMAccessControlProfilesOperations GalleryInVMAccessControlProfiles { get; private set; } - /// - /// Gets the IGalleryInVMAccessControlProfileVersionsOperations. + /// Gets the IGalleryInVMAccessControlProfileVersionsOperations /// public virtual IGalleryInVMAccessControlProfileVersionsOperations GalleryInVMAccessControlProfileVersions { get; private set; } - /// - /// Gets the IGallerySharingProfileOperations. + /// Gets the IGallerySharingProfileOperations /// public virtual IGallerySharingProfileOperations GallerySharingProfile { get; private set; } - /// - /// Gets the ISoftDeletedResourceOperations. + /// Gets the ISoftDeletedResourceOperations /// public virtual ISoftDeletedResourceOperations SoftDeletedResource { get; private set; } - /// - /// Gets the IResourceSkusOperations. + /// Gets the IResourceSkusOperations /// public virtual IResourceSkusOperations ResourceSkus { get; private set; } - /// /// Initializes a new instance of the ComputeManagementClient class. /// @@ -311,24 +253,22 @@ public partial class ComputeManagementClient : ServiceClient /// /// True: will dispose the provided httpClient on calling ComputeManagementClient.Dispose(). False: will not dispose provided httpClient - protected ComputeManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + protected ComputeManagementClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the ComputeManagementClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected ComputeManagementClient(params DelegatingHandler[] handlers) : base(handlers) + protected ComputeManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - Initialize(); + this.Initialize(); } - /// - /// Initializes a new instance of the ComputeManagementClient class. + /// Initializes a new instance of the ComputeManagementClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -336,11 +276,10 @@ protected ComputeManagementClient(params DelegatingHandler[] handlers) : base(ha /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected ComputeManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected ComputeManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the ComputeManagementClient class. /// @@ -353,15 +292,14 @@ protected ComputeManagementClient(HttpClientHandler rootHandler, params Delegati /// /// Thrown when a required parameter is null /// - protected ComputeManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected ComputeManagementClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the ComputeManagementClient class. /// @@ -377,15 +315,15 @@ protected ComputeManagementClient(System.Uri baseUri, params DelegatingHandler[] /// /// Thrown when a required parameter is null /// - protected ComputeManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected ComputeManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the ComputeManagementClient class. /// @@ -398,23 +336,23 @@ protected ComputeManagementClient(System.Uri baseUri, HttpClientHandler rootHand /// /// Thrown when a required parameter is null /// - public ComputeManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public ComputeManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the ComputeManagementClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -425,23 +363,23 @@ public ComputeManagementClient(ServiceClientCredentials credentials, params Dele /// /// Thrown when a required parameter is null /// - public ComputeManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public ComputeManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the ComputeManagementClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -453,26 +391,26 @@ public ComputeManagementClient(ServiceClientCredentials credentials, HttpClient /// /// Thrown when a required parameter is null /// - public ComputeManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public ComputeManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the ComputeManagementClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -481,7 +419,7 @@ public ComputeManagementClient(ServiceClientCredentials credentials, HttpClientH /// /// Thrown when a required parameter is null /// - public ComputeManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public ComputeManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -491,21 +429,21 @@ public ComputeManagementClient(System.Uri baseUri, ServiceClientCredentials cred { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the ComputeManagementClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -517,7 +455,7 @@ public ComputeManagementClient(System.Uri baseUri, ServiceClientCredentials cred /// /// Thrown when a required parameter is null /// - public ComputeManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public ComputeManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -527,103 +465,104 @@ public ComputeManagementClient(System.Uri baseUri, ServiceClientCredentials cred { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// An optional partial-method to perform custom initialization. /// partial void CustomInitialize(); + /// /// Initializes client properties. /// private void Initialize() { - Operations = new Operations(this); - AvailabilitySets = new AvailabilitySetsOperations(this); - CapacityReservationGroups = new CapacityReservationGroupsOperations(this); - DedicatedHostGroups = new DedicatedHostGroupsOperations(this); - Images = new ImagesOperations(this); - VirtualMachineImagesEdgeZone = new VirtualMachineImagesEdgeZoneOperations(this); - VirtualMachineImages = new VirtualMachineImagesOperations(this); - LogAnalytics = new LogAnalyticsOperations(this); - VirtualMachineExtensionImages = new VirtualMachineExtensionImagesOperations(this); - VirtualMachineRunCommands = new VirtualMachineRunCommandsOperations(this); - Usage = new UsageOperations(this); - VirtualMachineScaleSets = new VirtualMachineScaleSetsOperations(this); - VirtualMachines = new VirtualMachinesOperations(this); - VirtualMachineSizes = new VirtualMachineSizesOperations(this); - ProximityPlacementGroups = new ProximityPlacementGroupsOperations(this); - RestorePointCollections = new RestorePointCollectionsOperations(this); - SshPublicKeys = new SshPublicKeysOperations(this); - CapacityReservations = new CapacityReservationsOperations(this); - DedicatedHosts = new DedicatedHostsOperations(this); - RestorePoints = new RestorePointsOperations(this); - VirtualMachineScaleSetRollingUpgrades = new VirtualMachineScaleSetRollingUpgradesOperations(this); - VirtualMachineScaleSetExtensions = new VirtualMachineScaleSetExtensionsOperations(this); - VirtualMachineScaleSetVMs = new VirtualMachineScaleSetVMsOperations(this); - VirtualMachineScaleSetVMExtensions = new VirtualMachineScaleSetVMExtensionsOperations(this); - VirtualMachineScaleSetVMRunCommands = new VirtualMachineScaleSetVMRunCommandsOperations(this); - VirtualMachineExtensions = new VirtualMachineExtensionsOperations(this); - DiskAccesses = new DiskAccessesOperations(this); - DiskEncryptionSets = new DiskEncryptionSetsOperations(this); - Disks = new DisksOperations(this); - Snapshots = new SnapshotsOperations(this); - DiskRestorePoint = new DiskRestorePointOperations(this); - Galleries = new GalleriesOperations(this); - CommunityGalleries = new CommunityGalleriesOperations(this); - CommunityGalleryImages = new CommunityGalleryImagesOperations(this); - CommunityGalleryImageVersions = new CommunityGalleryImageVersionsOperations(this); - SharedGalleries = new SharedGalleriesOperations(this); - SharedGalleryImages = new SharedGalleryImagesOperations(this); - SharedGalleryImageVersions = new SharedGalleryImageVersionsOperations(this); - GalleryApplications = new GalleryApplicationsOperations(this); - GalleryApplicationVersions = new GalleryApplicationVersionsOperations(this); - GalleryImages = new GalleryImagesOperations(this); - GalleryImageVersions = new GalleryImageVersionsOperations(this); - GalleryInVMAccessControlProfiles = new GalleryInVMAccessControlProfilesOperations(this); - GalleryInVMAccessControlProfileVersions = new GalleryInVMAccessControlProfileVersionsOperations(this); - GallerySharingProfile = new GallerySharingProfileOperations(this); - SoftDeletedResource = new SoftDeletedResourceOperations(this); - ResourceSkus = new ResourceSkusOperations(this); - BaseUri = new System.Uri("https://management.azure.com"); - AcceptLanguage = "en-US"; - LongRunningOperationRetryTimeout = 30; - GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings + this.Operations = new Operations(this); + this.AvailabilitySets = new AvailabilitySetsOperations(this); + this.CapacityReservationGroups = new CapacityReservationGroupsOperations(this); + this.DedicatedHostGroups = new DedicatedHostGroupsOperations(this); + this.Images = new ImagesOperations(this); + this.VirtualMachineImagesEdgeZone = new VirtualMachineImagesEdgeZoneOperations(this); + this.VirtualMachineImages = new VirtualMachineImagesOperations(this); + this.LogAnalytics = new LogAnalyticsOperations(this); + this.VirtualMachineExtensionImages = new VirtualMachineExtensionImagesOperations(this); + this.VirtualMachineRunCommands = new VirtualMachineRunCommandsOperations(this); + this.Usage = new UsageOperations(this); + this.VirtualMachineScaleSets = new VirtualMachineScaleSetsOperations(this); + this.VirtualMachines = new VirtualMachinesOperations(this); + this.VirtualMachineSizes = new VirtualMachineSizesOperations(this); + this.ProximityPlacementGroups = new ProximityPlacementGroupsOperations(this); + this.RestorePointCollections = new RestorePointCollectionsOperations(this); + this.SshPublicKeys = new SshPublicKeysOperations(this); + this.CapacityReservations = new CapacityReservationsOperations(this); + this.DedicatedHosts = new DedicatedHostsOperations(this); + this.RestorePoints = new RestorePointsOperations(this); + this.VirtualMachineScaleSetRollingUpgrades = new VirtualMachineScaleSetRollingUpgradesOperations(this); + this.VirtualMachineScaleSetExtensions = new VirtualMachineScaleSetExtensionsOperations(this); + this.VirtualMachineScaleSetVMS = new VirtualMachineScaleSetVMSOperations(this); + this.VirtualMachineScaleSetVMExtensions = new VirtualMachineScaleSetVMExtensionsOperations(this); + this.VirtualMachineScaleSetVMRunCommands = new VirtualMachineScaleSetVMRunCommandsOperations(this); + this.VirtualMachineExtensions = new VirtualMachineExtensionsOperations(this); + this.DiskAccesses = new DiskAccessesOperations(this); + this.DiskEncryptionSets = new DiskEncryptionSetsOperations(this); + this.Disks = new DisksOperations(this); + this.Snapshots = new SnapshotsOperations(this); + this.DiskRestorePoint = new DiskRestorePointOperations(this); + this.Galleries = new GalleriesOperations(this); + this.CommunityGalleries = new CommunityGalleriesOperations(this); + this.CommunityGalleryImages = new CommunityGalleryImagesOperations(this); + this.CommunityGalleryImageVersions = new CommunityGalleryImageVersionsOperations(this); + this.SharedGalleries = new SharedGalleriesOperations(this); + this.SharedGalleryImages = new SharedGalleryImagesOperations(this); + this.SharedGalleryImageVersions = new SharedGalleryImageVersionsOperations(this); + this.GalleryApplications = new GalleryApplicationsOperations(this); + this.GalleryApplicationVersions = new GalleryApplicationVersionsOperations(this); + this.GalleryImages = new GalleryImagesOperations(this); + this.GalleryImageVersions = new GalleryImageVersionsOperations(this); + this.GalleryInVMAccessControlProfiles = new GalleryInVMAccessControlProfilesOperations(this); + this.GalleryInVMAccessControlProfileVersions = new GalleryInVMAccessControlProfileVersionsOperations(this); + this.GallerySharingProfile = new GallerySharingProfileOperations(this); + this.SoftDeletedResource = new SoftDeletedResourceOperations(this); + this.ResourceSkus = new ResourceSkusOperations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings = new JsonSerializerSettings + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; CustomInitialize(); - DeserializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/DedicatedHostGroupsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/DedicatedHostGroupsOperations.cs index 78b554267944..fc292b7b0e0a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/DedicatedHostGroupsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/DedicatedHostGroupsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// DedicatedHostGroupsOperations operations. /// - internal partial class DedicatedHostGroupsOperations : IServiceOperations, IDedicatedHostGroupsOperations + internal partial class DedicatedHostGroupsOperations : Microsoft.Rest.IServiceOperations, IDedicatedHostGroupsOperations { /// /// Initializes a new instance of the DedicatedHostGroupsOperations class. @@ -36,13 +24,13 @@ internal partial class DedicatedHostGroupsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DedicatedHostGroupsOperations(ComputeManagementClient client) + internal DedicatedHostGroupsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -61,13 +49,13 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -76,29 +64,38 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -108,25 +105,24 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -138,55 +134,56 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -196,9 +193,10 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -209,25 +207,29 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the dedicated host groups in the specified resource group. Use /// the nextLink property in the response to get the next page of dedicated @@ -242,13 +244,13 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -257,46 +259,55 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -306,25 +317,24 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -336,55 +346,56 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -394,9 +405,10 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -407,25 +419,29 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves information about a dedicated host group. /// @@ -436,10 +452,9 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) /// The name of the dedicated host group. /// /// - /// The expand expression to apply on the operation. 'InstanceView' will + /// The expand expression to apply on the operation. 'InstanceView' will /// retrieve the list of instance views of the dedicated hosts under the - /// dedicated host group. 'UserData' is not supported for dedicated host group. - /// Possible values include: 'instanceView', 'userData', 'resiliencyView' + /// dedicated host group. 'UserData' is not supported for dedicated host group. /// /// /// Headers that will be added to request. @@ -447,13 +462,13 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -462,85 +477,95 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, InstanceViewTypes? expand = default(InstanceViewTypes?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, InstanceViewTypes? expand = default(InstanceViewTypes?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (hostGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostGroupName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("hostGroupName", hostGroupName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{hostGroupName}", System.Uri.EscapeDataString(hostGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (expand != null) { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(expand, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expand, this.Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -552,55 +577,56 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -610,9 +636,10 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -623,25 +650,29 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a dedicated host group. For details of Dedicated Host and /// Dedicated Host Groups please see [Dedicated Host Documentation] @@ -662,13 +693,13 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -677,61 +708,71 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, DedicatedHostGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, DedicatedHostGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (hostGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostGroupName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostGroupName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("hostGroupName", hostGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{hostGroupName}", System.Uri.EscapeDataString(hostGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -741,25 +782,24 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -771,61 +811,62 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -835,9 +876,10 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -848,16 +890,16 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -866,25 +908,29 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update an dedicated host group. /// @@ -903,13 +949,13 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -918,57 +964,67 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, DedicatedHostGroupUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, DedicatedHostGroupUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (hostGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostGroupName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostGroupName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("hostGroupName", hostGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{hostGroupName}", System.Uri.EscapeDataString(hostGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -978,25 +1034,24 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1008,61 +1063,62 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1072,9 +1128,10 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1085,25 +1142,29 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete a dedicated host group. /// @@ -1119,10 +1180,10 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1131,52 +1192,62 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (hostGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostGroupName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("hostGroupName", hostGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{hostGroupName}", System.Uri.EscapeDataString(hostGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1186,25 +1257,24 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1216,55 +1286,56 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1274,20 +1345,25 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the dedicated host groups in the subscription. Use the /// nextLink property in the response to get the next page of dedicated host @@ -1302,13 +1378,13 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1317,51 +1393,54 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1373,55 +1452,56 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1431,9 +1511,10 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1444,25 +1525,29 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the dedicated host groups in the specified resource group. Use /// the nextLink property in the response to get the next page of dedicated @@ -1477,13 +1562,13 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1492,51 +1577,54 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1548,55 +1636,56 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1606,9 +1695,10 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1619,24 +1709,28 @@ internal DedicatedHostGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/DedicatedHostGroupsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/DedicatedHostGroupsOperationsExtensions.cs index f218e1c1b8bd..78c84e06a2f4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/DedicatedHostGroupsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/DedicatedHostGroupsOperationsExtensions.cs @@ -1,356 +1,325 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for DedicatedHostGroupsOperations. + /// Extension methods for DedicatedHostGroupsOperations /// public static partial class DedicatedHostGroupsOperationsExtensions { - /// - /// Lists all of the dedicated host groups in the subscription. Use the - /// nextLink property in the response to get the next page of dedicated host - /// groups. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListBySubscription(this IDedicatedHostGroupsOperations operations) - { - return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all of the dedicated host groups in the subscription. Use the - /// nextLink property in the response to get the next page of dedicated host - /// groups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IDedicatedHostGroupsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all of the dedicated host groups in the specified resource group. Use - /// the nextLink property in the response to get the next page of dedicated - /// host groups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage ListByResourceGroup(this IDedicatedHostGroupsOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } + /// + /// Lists all of the dedicated host groups in the subscription. Use the + /// nextLink property in the response to get the next page of dedicated host + /// groups. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscription(this IDedicatedHostGroupsOperations operations) + { + return ((IDedicatedHostGroupsOperations)operations).ListBySubscriptionAsync().GetAwaiter().GetResult(); + } - /// - /// Lists all of the dedicated host groups in the specified resource group. Use - /// the nextLink property in the response to get the next page of dedicated - /// host groups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IDedicatedHostGroupsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all of the dedicated host groups in the subscription. Use the + /// nextLink property in the response to get the next page of dedicated host + /// groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this IDedicatedHostGroupsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all of the dedicated host groups in the specified resource group. Use + /// the nextLink property in the response to get the next page of dedicated + /// host groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IDedicatedHostGroupsOperations operations, string resourceGroupName) + { + return ((IDedicatedHostGroupsOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Retrieves information about a dedicated host group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The expand expression to apply on the operation. 'InstanceView' will - /// retrieve the list of instance views of the dedicated hosts under the - /// dedicated host group. 'UserData' is not supported for dedicated host group. - /// Possible values include: 'instanceView', 'userData', 'resiliencyView' - /// - public static DedicatedHostGroup Get(this IDedicatedHostGroupsOperations operations, string resourceGroupName, string hostGroupName, InstanceViewTypes? expand = default(InstanceViewTypes?)) + /// + /// Lists all of the dedicated host groups in the specified resource group. Use + /// the nextLink property in the response to get the next page of dedicated + /// host groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IDedicatedHostGroupsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, hostGroupName, expand).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves information about a dedicated host group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The expand expression to apply on the operation. 'InstanceView' will + /// retrieve the list of instance views of the dedicated hosts under the + /// dedicated host group. 'UserData' is not supported for dedicated host group. + /// + public static DedicatedHostGroup Get(this IDedicatedHostGroupsOperations operations, string resourceGroupName, string hostGroupName, InstanceViewTypes? expand = default(InstanceViewTypes?)) + { + return ((IDedicatedHostGroupsOperations)operations).GetAsync(resourceGroupName, hostGroupName, expand).GetAwaiter().GetResult(); + } - /// - /// Retrieves information about a dedicated host group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The expand expression to apply on the operation. 'InstanceView' will - /// retrieve the list of instance views of the dedicated hosts under the - /// dedicated host group. 'UserData' is not supported for dedicated host group. - /// Possible values include: 'instanceView', 'userData', 'resiliencyView' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDedicatedHostGroupsOperations operations, string resourceGroupName, string hostGroupName, InstanceViewTypes? expand = default(InstanceViewTypes?), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves information about a dedicated host group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The expand expression to apply on the operation. 'InstanceView' will + /// retrieve the list of instance views of the dedicated hosts under the + /// dedicated host group. 'UserData' is not supported for dedicated host group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDedicatedHostGroupsOperations operations, string resourceGroupName, string hostGroupName, InstanceViewTypes? expand = default(InstanceViewTypes?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, hostGroupName, expand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, hostGroupName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Create or update a dedicated host group. For details of Dedicated Host and + /// Dedicated Host Groups please see [Dedicated Host Documentation] + /// (https://go.microsoft.com/fwlink/?linkid=2082596) + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + public static DedicatedHostGroup CreateOrUpdate(this IDedicatedHostGroupsOperations operations, string resourceGroupName, string hostGroupName, DedicatedHostGroup parameters) + { + return ((IDedicatedHostGroupsOperations)operations).CreateOrUpdateAsync(resourceGroupName, hostGroupName, parameters).GetAwaiter().GetResult(); + } - /// - /// Create or update a dedicated host group. For details of Dedicated Host and - /// Dedicated Host Groups please see [Dedicated Host Documentation] - /// (https://go.microsoft.com/fwlink/?linkid=2082596) - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// Parameters supplied to the Create Dedicated Host Group. - /// - public static DedicatedHostGroup CreateOrUpdate(this IDedicatedHostGroupsOperations operations, string resourceGroupName, string hostGroupName, DedicatedHostGroup parameters) + /// + /// Create or update a dedicated host group. For details of Dedicated Host and + /// Dedicated Host Groups please see [Dedicated Host Documentation] + /// (https://go.microsoft.com/fwlink/?linkid=2082596) + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IDedicatedHostGroupsOperations operations, string resourceGroupName, string hostGroupName, DedicatedHostGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, hostGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, hostGroupName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update an dedicated host group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + public static DedicatedHostGroup Update(this IDedicatedHostGroupsOperations operations, string resourceGroupName, string hostGroupName, DedicatedHostGroupUpdate parameters) + { + return ((IDedicatedHostGroupsOperations)operations).UpdateAsync(resourceGroupName, hostGroupName, parameters).GetAwaiter().GetResult(); + } - /// - /// Create or update a dedicated host group. For details of Dedicated Host and - /// Dedicated Host Groups please see [Dedicated Host Documentation] - /// (https://go.microsoft.com/fwlink/?linkid=2082596) - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// Parameters supplied to the Create Dedicated Host Group. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IDedicatedHostGroupsOperations operations, string resourceGroupName, string hostGroupName, DedicatedHostGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update an dedicated host group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IDedicatedHostGroupsOperations operations, string resourceGroupName, string hostGroupName, DedicatedHostGroupUpdate parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, hostGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, hostGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete a dedicated host group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + public static void Delete(this IDedicatedHostGroupsOperations operations, string resourceGroupName, string hostGroupName) + { + ((IDedicatedHostGroupsOperations)operations).DeleteAsync(resourceGroupName, hostGroupName).GetAwaiter().GetResult(); + } - /// - /// Update an dedicated host group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// Parameters supplied to the Update Dedicated Host Group operation. - /// - public static DedicatedHostGroup Update(this IDedicatedHostGroupsOperations operations, string resourceGroupName, string hostGroupName, DedicatedHostGroupUpdate parameters) - { - return operations.UpdateAsync(resourceGroupName, hostGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Update an dedicated host group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// Parameters supplied to the Update Dedicated Host Group operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IDedicatedHostGroupsOperations operations, string resourceGroupName, string hostGroupName, DedicatedHostGroupUpdate parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, hostGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Delete a dedicated host group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IDedicatedHostGroupsOperations operations, string resourceGroupName, string hostGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hostGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all of the dedicated host groups in the subscription. Use the + /// nextLink property in the response to get the next page of dedicated host + /// groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionNext(this IDedicatedHostGroupsOperations operations, string nextPageLink) + { + return ((IDedicatedHostGroupsOperations)operations).ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Delete a dedicated host group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - public static void Delete(this IDedicatedHostGroupsOperations operations, string resourceGroupName, string hostGroupName) + /// + /// Lists all of the dedicated host groups in the subscription. Use the + /// nextLink property in the response to get the next page of dedicated host + /// groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionNextAsync(this IDedicatedHostGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, hostGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists all of the dedicated host groups in the specified resource group. Use + /// the nextLink property in the response to get the next page of dedicated + /// host groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IDedicatedHostGroupsOperations operations, string nextPageLink) + { + return ((IDedicatedHostGroupsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Delete a dedicated host group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IDedicatedHostGroupsOperations operations, string resourceGroupName, string hostGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all of the dedicated host groups in the specified resource group. Use + /// the nextLink property in the response to get the next page of dedicated + /// host groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IDedicatedHostGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hostGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Lists all of the dedicated host groups in the subscription. Use the - /// nextLink property in the response to get the next page of dedicated host - /// groups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this IDedicatedHostGroupsOperations operations, string nextPageLink) - { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the dedicated host groups in the subscription. Use the - /// nextLink property in the response to get the next page of dedicated host - /// groups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this IDedicatedHostGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all of the dedicated host groups in the specified resource group. Use - /// the nextLink property in the response to get the next page of dedicated - /// host groups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IDedicatedHostGroupsOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the dedicated host groups in the specified resource group. Use - /// the nextLink property in the response to get the next page of dedicated - /// host groups. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IDedicatedHostGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/DedicatedHostsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/DedicatedHostsOperations.cs index dfd4e09af377..5010b8249751 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/DedicatedHostsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/DedicatedHostsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// DedicatedHostsOperations operations. /// - internal partial class DedicatedHostsOperations : IServiceOperations, IDedicatedHostsOperations + internal partial class DedicatedHostsOperations : Microsoft.Rest.IServiceOperations, IDedicatedHostsOperations { /// /// Initializes a new instance of the DedicatedHostsOperations class. @@ -36,13 +24,13 @@ internal partial class DedicatedHostsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DedicatedHostsOperations(ComputeManagementClient client) + internal DedicatedHostsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -67,13 +55,13 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -82,52 +70,62 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByHostGroupWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByHostGroupWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (hostGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostGroupName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("hostGroupName", hostGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByHostGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByHostGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{hostGroupName}", System.Uri.EscapeDataString(hostGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -137,25 +135,24 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -167,55 +164,56 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -225,9 +223,10 @@ internal DedicatedHostsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -238,25 +237,29 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves information about a dedicated host. /// @@ -270,10 +273,9 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// The name of the dedicated host. /// /// - /// The expand expression to apply on the operation. 'InstanceView' will - /// retrieve the list of instance views of the dedicated host. 'UserData' is - /// not supported for dedicated host. Possible values include: 'instanceView', - /// 'userData', 'resiliencyView' + /// The expand expression to apply on the operation. 'InstanceView' will + /// retrieve the list of instance views of the dedicated host. 'UserData' is + /// not supported for dedicated host. /// /// /// Headers that will be added to request. @@ -281,13 +283,13 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -296,91 +298,102 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, InstanceViewTypes? expand = default(InstanceViewTypes?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, InstanceViewTypes? expand = default(InstanceViewTypes?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (hostGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostGroupName"); } + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("hostGroupName", hostGroupName); tracingParameters.Add("hostName", hostName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{hostGroupName}", System.Uri.EscapeDataString(hostGroupName)); _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (expand != null) { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(expand, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expand, this.Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -392,55 +405,56 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -450,9 +464,10 @@ internal DedicatedHostsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -463,25 +478,29 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a dedicated host . /// @@ -498,16 +517,16 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// Parameters supplied to the Create Dedicated Host. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, DedicatedHost parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, DedicatedHost parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -526,16 +545,16 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// Parameters supplied to the Update Dedicated Host operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, DedicatedHostUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, DedicatedHostUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -551,16 +570,16 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// The name of the dedicated host. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -583,13 +602,13 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -598,58 +617,69 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAvailableSizesWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAvailableSizesWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (hostGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostGroupName"); } + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("hostGroupName", hostGroupName); tracingParameters.Add("hostName", hostName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAvailableSizes", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAvailableSizes", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/hostSizes").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{hostGroupName}", System.Uri.EscapeDataString(hostGroupName)); _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -659,25 +689,24 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -689,55 +718,56 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -747,9 +777,10 @@ internal DedicatedHostsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -760,25 +791,29 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Redeploy the dedicated host. The operation will complete successfully once /// the dedicated host has migrated to a new node and is running. To determine @@ -797,16 +832,16 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// The name of the dedicated host. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> RedeployWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> RedeployWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginRedeployWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginRedeployWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -827,16 +862,16 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// The name of the dedicated host. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> RestartWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> RestartWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginRestartWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginRestartWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -860,13 +895,13 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -875,67 +910,78 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, DedicatedHost parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, DedicatedHost parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (hostGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostGroupName"); } + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("hostGroupName", hostGroupName); tracingParameters.Add("hostName", hostName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{hostGroupName}", System.Uri.EscapeDataString(hostGroupName)); _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -945,25 +991,24 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -975,61 +1020,62 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1039,9 +1085,10 @@ internal DedicatedHostsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1052,16 +1099,16 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1070,38 +1117,42 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update a dedicated host . /// @@ -1123,13 +1174,13 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1138,63 +1189,74 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, DedicatedHostUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, DedicatedHostUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (hostGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostGroupName"); } + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("hostGroupName", hostGroupName); tracingParameters.Add("hostName", hostName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{hostGroupName}", System.Uri.EscapeDataString(hostGroupName)); _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1204,25 +1266,24 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1234,61 +1295,62 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1298,9 +1360,10 @@ internal DedicatedHostsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1311,38 +1374,42 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete a dedicated host. /// @@ -1361,10 +1428,10 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1373,58 +1440,69 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (hostGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostGroupName"); } + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("hostGroupName", hostGroupName); tracingParameters.Add("hostName", hostName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{hostGroupName}", System.Uri.EscapeDataString(hostGroupName)); _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1434,25 +1512,24 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1464,55 +1541,56 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1522,20 +1600,25 @@ internal DedicatedHostsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Redeploy the dedicated host. The operation will complete successfully once /// the dedicated host has migrated to a new node and is running. To determine @@ -1559,10 +1642,10 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1571,58 +1654,69 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginRedeployWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginRedeployWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (hostGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostGroupName"); } + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("hostGroupName", hostGroupName); tracingParameters.Add("hostName", hostName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRedeploy", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRedeploy", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/redeploy").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{hostGroupName}", System.Uri.EscapeDataString(hostGroupName)); _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1632,25 +1726,24 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1662,55 +1755,56 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1720,33 +1814,38 @@ internal DedicatedHostsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Restart the dedicated host. The operation will complete successfully once /// the dedicated host has restarted and is running. To determine the health of @@ -1770,10 +1869,10 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1782,58 +1881,69 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginRestartWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginRestartWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (hostGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostGroupName"); } + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "hostName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("hostGroupName", hostGroupName); tracingParameters.Add("hostName", hostName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestart", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRestart", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/restart").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{hostGroupName}", System.Uri.EscapeDataString(hostGroupName)); _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1843,25 +1953,24 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1873,55 +1982,56 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1931,33 +2041,38 @@ internal DedicatedHostsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the dedicated hosts in the specified dedicated host group. Use /// the nextLink property in the response to get the next page of dedicated @@ -1972,13 +2087,13 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1987,51 +2102,54 @@ internal DedicatedHostsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByHostGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByHostGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByHostGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByHostGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2043,55 +2161,56 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2101,9 +2220,10 @@ internal DedicatedHostsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2114,24 +2234,28 @@ internal DedicatedHostsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/DedicatedHostsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/DedicatedHostsOperationsExtensions.cs index 132ede4ed834..f86a32090e9c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/DedicatedHostsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/DedicatedHostsOperationsExtensions.cs @@ -1,735 +1,684 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for DedicatedHostsOperations. + /// Extension methods for DedicatedHostsOperations /// public static partial class DedicatedHostsOperationsExtensions { - /// - /// Lists all of the dedicated hosts in the specified dedicated host group. Use - /// the nextLink property in the response to get the next page of dedicated - /// hosts. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - public static IPage ListByHostGroup(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName) - { - return operations.ListByHostGroupAsync(resourceGroupName, hostGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the dedicated hosts in the specified dedicated host group. Use - /// the nextLink property in the response to get the next page of dedicated - /// hosts. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByHostGroupAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByHostGroupWithHttpMessagesAsync(resourceGroupName, hostGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves information about a dedicated host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - /// - /// The expand expression to apply on the operation. 'InstanceView' will - /// retrieve the list of instance views of the dedicated host. 'UserData' is - /// not supported for dedicated host. Possible values include: 'instanceView', - /// 'userData', 'resiliencyView' - /// - public static DedicatedHost Get(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, InstanceViewTypes? expand = default(InstanceViewTypes?)) - { - return operations.GetAsync(resourceGroupName, hostGroupName, hostName, expand).GetAwaiter().GetResult(); - } - - /// - /// Retrieves information about a dedicated host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - /// - /// The expand expression to apply on the operation. 'InstanceView' will - /// retrieve the list of instance views of the dedicated host. 'UserData' is - /// not supported for dedicated host. Possible values include: 'instanceView', - /// 'userData', 'resiliencyView' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, InstanceViewTypes? expand = default(InstanceViewTypes?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Lists all of the dedicated hosts in the specified dedicated host group. Use + /// the nextLink property in the response to get the next page of dedicated + /// hosts. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + public static Microsoft.Rest.Azure.IPage ListByHostGroup(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName) + { + return ((IDedicatedHostsOperations)operations).ListByHostGroupAsync(resourceGroupName, hostGroupName).GetAwaiter().GetResult(); + } - /// - /// Create or update a dedicated host . - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - /// - /// Parameters supplied to the Create Dedicated Host. - /// - public static DedicatedHost CreateOrUpdate(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, DedicatedHost parameters) + /// + /// Lists all of the dedicated hosts in the specified dedicated host group. Use + /// the nextLink property in the response to get the next page of dedicated + /// hosts. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByHostGroupAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByHostGroupWithHttpMessagesAsync(resourceGroupName, hostGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, hostGroupName, hostName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves information about a dedicated host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + /// + /// The expand expression to apply on the operation. 'InstanceView' will + /// retrieve the list of instance views of the dedicated host. 'UserData' is + /// not supported for dedicated host. + /// + public static DedicatedHost Get(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, InstanceViewTypes? expand = default(InstanceViewTypes?)) + { + return ((IDedicatedHostsOperations)operations).GetAsync(resourceGroupName, hostGroupName, hostName, expand).GetAwaiter().GetResult(); + } - /// - /// Create or update a dedicated host . - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - /// - /// Parameters supplied to the Create Dedicated Host. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, DedicatedHost parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves information about a dedicated host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + /// + /// The expand expression to apply on the operation. 'InstanceView' will + /// retrieve the list of instance views of the dedicated host. 'UserData' is + /// not supported for dedicated host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, InstanceViewTypes? expand = default(InstanceViewTypes?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, expand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Create or update a dedicated host . + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + public static DedicatedHost CreateOrUpdate(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, DedicatedHost parameters) + { + return ((IDedicatedHostsOperations)operations).CreateOrUpdateAsync(resourceGroupName, hostGroupName, hostName, parameters).GetAwaiter().GetResult(); + } - /// - /// Update a dedicated host . - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - /// - /// Parameters supplied to the Update Dedicated Host operation. - /// - public static DedicatedHost Update(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, DedicatedHostUpdate parameters) + /// + /// Create or update a dedicated host . + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, DedicatedHost parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(resourceGroupName, hostGroupName, hostName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update a dedicated host . + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + public static DedicatedHost Update(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, DedicatedHostUpdate parameters) + { + return ((IDedicatedHostsOperations)operations).UpdateAsync(resourceGroupName, hostGroupName, hostName, parameters).GetAwaiter().GetResult(); + } - /// - /// Update a dedicated host . - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - /// - /// Parameters supplied to the Update Dedicated Host operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, DedicatedHostUpdate parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update a dedicated host . + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, DedicatedHostUpdate parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete a dedicated host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + public static void Delete(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName) + { + ((IDedicatedHostsOperations)operations).DeleteAsync(resourceGroupName, hostGroupName, hostName).GetAwaiter().GetResult(); + } - /// - /// Delete a dedicated host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - public static void Delete(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName) - { - operations.DeleteAsync(resourceGroupName, hostGroupName, hostName).GetAwaiter().GetResult(); - } - - /// - /// Delete a dedicated host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all available dedicated host sizes to which the specified dedicated - /// host can be resized. NOTE: The dedicated host sizes provided can be used to - /// only scale up the existing dedicated host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - public static IEnumerable ListAvailableSizes(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName) - { - return operations.ListAvailableSizesAsync(resourceGroupName, hostGroupName, hostName).GetAwaiter().GetResult(); - } + /// + /// Delete a dedicated host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all available dedicated host sizes to which the specified dedicated + /// host can be resized. NOTE: The dedicated host sizes provided can be used to + /// only scale up the existing dedicated host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + public static System.Collections.Generic.IEnumerable ListAvailableSizes(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName) + { + return ((IDedicatedHostsOperations)operations).ListAvailableSizesAsync(resourceGroupName, hostGroupName, hostName).GetAwaiter().GetResult(); + } - /// - /// Lists all available dedicated host sizes to which the specified dedicated - /// host can be resized. NOTE: The dedicated host sizes provided can be used to - /// only scale up the existing dedicated host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAvailableSizesAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all available dedicated host sizes to which the specified dedicated + /// host can be resized. NOTE: The dedicated host sizes provided can be used to + /// only scale up the existing dedicated host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAvailableSizesAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAvailableSizesWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListAvailableSizesWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Redeploy the dedicated host. The operation will complete successfully once + /// the dedicated host has migrated to a new node and is running. To determine + /// the health of VMs deployed on the dedicated host after the redeploy check + /// the Resource Health Center in the Azure Portal. Please refer to + /// https://docs.microsoft.com/azure/service-health/resource-health-overview + /// for more details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + public static DedicatedHostsRedeployHeaders Redeploy(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName) + { + return ((IDedicatedHostsOperations)operations).RedeployAsync(resourceGroupName, hostGroupName, hostName).GetAwaiter().GetResult(); + } - /// - /// Redeploy the dedicated host. The operation will complete successfully once - /// the dedicated host has migrated to a new node and is running. To determine - /// the health of VMs deployed on the dedicated host after the redeploy check - /// the Resource Health Center in the Azure Portal. Please refer to - /// https://docs.microsoft.com/azure/service-health/resource-health-overview - /// for more details. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - public static DedicatedHostsRedeployHeaders Redeploy(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName) + /// + /// Redeploy the dedicated host. The operation will complete successfully once + /// the dedicated host has migrated to a new node and is running. To determine + /// the health of VMs deployed on the dedicated host after the redeploy check + /// the Resource Health Center in the Azure Portal. Please refer to + /// https://docs.microsoft.com/azure/service-health/resource-health-overview + /// for more details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RedeployAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.RedeployWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, null, cancellationToken).ConfigureAwait(false)) { - return operations.RedeployAsync(resourceGroupName, hostGroupName, hostName).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// Restart the dedicated host. The operation will complete successfully once + /// the dedicated host has restarted and is running. To determine the health of + /// VMs deployed on the dedicated host after the restart check the Resource + /// Health Center in the Azure Portal. Please refer to + /// https://docs.microsoft.com/azure/service-health/resource-health-overview + /// for more details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + public static DedicatedHostsRestartHeaders Restart(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName) + { + return ((IDedicatedHostsOperations)operations).RestartAsync(resourceGroupName, hostGroupName, hostName).GetAwaiter().GetResult(); + } - /// - /// Redeploy the dedicated host. The operation will complete successfully once - /// the dedicated host has migrated to a new node and is running. To determine - /// the health of VMs deployed on the dedicated host after the redeploy check - /// the Resource Health Center in the Azure Portal. Please refer to - /// https://docs.microsoft.com/azure/service-health/resource-health-overview - /// for more details. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - /// - /// The cancellation token. - /// - public static async Task RedeployAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Restart the dedicated host. The operation will complete successfully once + /// the dedicated host has restarted and is running. To determine the health of + /// VMs deployed on the dedicated host after the restart check the Resource + /// Health Center in the Azure Portal. Please refer to + /// https://docs.microsoft.com/azure/service-health/resource-health-overview + /// for more details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RestartAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.RestartWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.RedeployWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } + return _result.Headers; } + } + /// + /// Create or update a dedicated host . + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + public static DedicatedHost BeginCreateOrUpdate(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, DedicatedHost parameters) + { + return ((IDedicatedHostsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, hostGroupName, hostName, parameters).GetAwaiter().GetResult(); + } - /// - /// Restart the dedicated host. The operation will complete successfully once - /// the dedicated host has restarted and is running. To determine the health of - /// VMs deployed on the dedicated host after the restart check the Resource - /// Health Center in the Azure Portal. Please refer to - /// https://docs.microsoft.com/azure/service-health/resource-health-overview - /// for more details. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - public static DedicatedHostsRestartHeaders Restart(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName) + /// + /// Create or update a dedicated host . + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, DedicatedHost parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.RestartAsync(resourceGroupName, hostGroupName, hostName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update a dedicated host . + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + public static DedicatedHost BeginUpdate(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, DedicatedHostUpdate parameters) + { + return ((IDedicatedHostsOperations)operations).BeginUpdateAsync(resourceGroupName, hostGroupName, hostName, parameters).GetAwaiter().GetResult(); + } - /// - /// Restart the dedicated host. The operation will complete successfully once - /// the dedicated host has restarted and is running. To determine the health of - /// VMs deployed on the dedicated host after the restart check the Resource - /// Health Center in the Azure Portal. Please refer to - /// https://docs.microsoft.com/azure/service-health/resource-health-overview - /// for more details. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - /// - /// The cancellation token. - /// - public static async Task RestartAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update a dedicated host . + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, DedicatedHostUpdate parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.RestartWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } + return _result.Body; } + } + /// + /// Delete a dedicated host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + public static void BeginDelete(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName) + { + ((IDedicatedHostsOperations)operations).BeginDeleteAsync(resourceGroupName, hostGroupName, hostName).GetAwaiter().GetResult(); + } - /// - /// Create or update a dedicated host . - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - /// - /// Parameters supplied to the Create Dedicated Host. - /// - public static DedicatedHost BeginCreateOrUpdate(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, DedicatedHost parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, hostGroupName, hostName, parameters).GetAwaiter().GetResult(); - } + /// + /// Delete a dedicated host. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Redeploy the dedicated host. The operation will complete successfully once + /// the dedicated host has migrated to a new node and is running. To determine + /// the health of VMs deployed on the dedicated host after the redeploy check + /// the Resource Health Center in the Azure Portal. Please refer to + /// https://docs.microsoft.com/azure/service-health/resource-health-overview + /// for more details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + public static DedicatedHostsRedeployHeaders BeginRedeploy(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName) + { + return ((IDedicatedHostsOperations)operations).BeginRedeployAsync(resourceGroupName, hostGroupName, hostName).GetAwaiter().GetResult(); + } - /// - /// Create or update a dedicated host . - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - /// - /// Parameters supplied to the Create Dedicated Host. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, DedicatedHost parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Redeploy the dedicated host. The operation will complete successfully once + /// the dedicated host has migrated to a new node and is running. To determine + /// the health of VMs deployed on the dedicated host after the redeploy check + /// the Resource Health Center in the Azure Portal. Please refer to + /// https://docs.microsoft.com/azure/service-health/resource-health-overview + /// for more details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRedeployAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginRedeployWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Headers; } + } + /// + /// Restart the dedicated host. The operation will complete successfully once + /// the dedicated host has restarted and is running. To determine the health of + /// VMs deployed on the dedicated host after the restart check the Resource + /// Health Center in the Azure Portal. Please refer to + /// https://docs.microsoft.com/azure/service-health/resource-health-overview + /// for more details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + public static DedicatedHostsRestartHeaders BeginRestart(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName) + { + return ((IDedicatedHostsOperations)operations).BeginRestartAsync(resourceGroupName, hostGroupName, hostName).GetAwaiter().GetResult(); + } - /// - /// Update a dedicated host . - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - /// - /// Parameters supplied to the Update Dedicated Host operation. - /// - public static DedicatedHost BeginUpdate(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, DedicatedHostUpdate parameters) + /// + /// Restart the dedicated host. The operation will complete successfully once + /// the dedicated host has restarted and is running. To determine the health of + /// VMs deployed on the dedicated host after the restart check the Resource + /// Health Center in the Azure Portal. Please refer to + /// https://docs.microsoft.com/azure/service-health/resource-health-overview + /// for more details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the dedicated host group. + /// + /// + /// The name of the dedicated host. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRestartAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginRestartWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginUpdateAsync(resourceGroupName, hostGroupName, hostName, parameters).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// Lists all of the dedicated hosts in the specified dedicated host group. Use + /// the nextLink property in the response to get the next page of dedicated + /// hosts. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByHostGroupNext(this IDedicatedHostsOperations operations, string nextPageLink) + { + return ((IDedicatedHostsOperations)operations).ListByHostGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Update a dedicated host . - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - /// - /// Parameters supplied to the Update Dedicated Host operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, DedicatedHostUpdate parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all of the dedicated hosts in the specified dedicated host group. Use + /// the nextLink property in the response to get the next page of dedicated + /// hosts. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByHostGroupNextAsync(this IDedicatedHostsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByHostGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Delete a dedicated host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - public static void BeginDelete(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName) - { - operations.BeginDeleteAsync(resourceGroupName, hostGroupName, hostName).GetAwaiter().GetResult(); - } - - /// - /// Delete a dedicated host. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Redeploy the dedicated host. The operation will complete successfully once - /// the dedicated host has migrated to a new node and is running. To determine - /// the health of VMs deployed on the dedicated host after the redeploy check - /// the Resource Health Center in the Azure Portal. Please refer to - /// https://docs.microsoft.com/azure/service-health/resource-health-overview - /// for more details. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - public static DedicatedHostsRedeployHeaders BeginRedeploy(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName) - { - return operations.BeginRedeployAsync(resourceGroupName, hostGroupName, hostName).GetAwaiter().GetResult(); - } - - /// - /// Redeploy the dedicated host. The operation will complete successfully once - /// the dedicated host has migrated to a new node and is running. To determine - /// the health of VMs deployed on the dedicated host after the redeploy check - /// the Resource Health Center in the Azure Portal. Please refer to - /// https://docs.microsoft.com/azure/service-health/resource-health-overview - /// for more details. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRedeployAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginRedeployWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Restart the dedicated host. The operation will complete successfully once - /// the dedicated host has restarted and is running. To determine the health of - /// VMs deployed on the dedicated host after the restart check the Resource - /// Health Center in the Azure Portal. Please refer to - /// https://docs.microsoft.com/azure/service-health/resource-health-overview - /// for more details. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - public static DedicatedHostsRestartHeaders BeginRestart(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName) - { - return operations.BeginRestartAsync(resourceGroupName, hostGroupName, hostName).GetAwaiter().GetResult(); - } - - /// - /// Restart the dedicated host. The operation will complete successfully once - /// the dedicated host has restarted and is running. To determine the health of - /// VMs deployed on the dedicated host after the restart check the Resource - /// Health Center in the Azure Portal. Please refer to - /// https://docs.microsoft.com/azure/service-health/resource-health-overview - /// for more details. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the dedicated host group. - /// - /// - /// The name of the dedicated host. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRestartAsync(this IDedicatedHostsOperations operations, string resourceGroupName, string hostGroupName, string hostName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginRestartWithHttpMessagesAsync(resourceGroupName, hostGroupName, hostName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Lists all of the dedicated hosts in the specified dedicated host group. Use - /// the nextLink property in the response to get the next page of dedicated - /// hosts. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByHostGroupNext(this IDedicatedHostsOperations operations, string nextPageLink) - { - return operations.ListByHostGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the dedicated hosts in the specified dedicated host group. Use - /// the nextLink property in the response to get the next page of dedicated - /// hosts. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByHostGroupNextAsync(this IDedicatedHostsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByHostGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/DiskAccessesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/DiskAccessesOperations.cs index 59bed8ba735c..6ee7683072ea 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/DiskAccessesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/DiskAccessesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// DiskAccessesOperations operations. /// - internal partial class DiskAccessesOperations : IServiceOperations, IDiskAccessesOperations + internal partial class DiskAccessesOperations : Microsoft.Rest.IServiceOperations, IDiskAccessesOperations { /// /// Initializes a new instance of the DiskAccessesOperations class. @@ -36,13 +24,13 @@ internal partial class DiskAccessesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DiskAccessesOperations(ComputeManagementClient client) + internal DiskAccessesOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -74,29 +62,38 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskAccesses").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -106,25 +103,24 @@ internal DiskAccessesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -136,55 +132,56 @@ internal DiskAccessesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -194,9 +191,10 @@ internal DiskAccessesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -207,25 +205,29 @@ internal DiskAccessesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the disk access resources under a resource group. /// @@ -238,13 +240,13 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -253,46 +255,55 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -302,25 +313,24 @@ internal DiskAccessesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -332,55 +342,56 @@ internal DiskAccessesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -390,9 +401,10 @@ internal DiskAccessesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -403,25 +415,29 @@ internal DiskAccessesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets information about a disk access resource. /// @@ -429,7 +445,7 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The name can't + /// The name of the disk access resource that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -440,13 +456,13 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -455,52 +471,62 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskAccessName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskAccessName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskAccessName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskAccessName", diskAccessName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskAccessName}", System.Uri.EscapeDataString(diskAccessName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -510,25 +536,24 @@ internal DiskAccessesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -540,55 +565,56 @@ internal DiskAccessesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -598,9 +624,10 @@ internal DiskAccessesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -611,25 +638,29 @@ internal DiskAccessesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a disk access resource /// @@ -637,7 +668,7 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The name can't + /// The name of the disk access resource that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -646,16 +677,16 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// disk access object supplied in the body of the Put disk access operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, DiskAccess diskAccess, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, DiskAccess diskAccess, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskAccessName, diskAccess, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskAccessName, diskAccess, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -665,7 +696,7 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The name can't + /// The name of the disk access resource that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -674,16 +705,16 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// Resource tags /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, diskAccessName, tags, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, diskAccessName, tags, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -693,22 +724,22 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The name can't + /// The name of the disk access resource that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, diskAccessName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, diskAccessName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -719,7 +750,7 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The name can't + /// The name of the disk access resource that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -730,13 +761,13 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -745,52 +776,62 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPrivateEndpointConnectionsWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListPrivateEndpointConnectionsWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskAccessName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskAccessName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskAccessName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskAccessName", diskAccessName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPrivateEndpointConnections", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListPrivateEndpointConnections", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskAccessName}", System.Uri.EscapeDataString(diskAccessName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -800,25 +841,24 @@ internal DiskAccessesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -830,55 +870,56 @@ internal DiskAccessesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -888,9 +929,10 @@ internal DiskAccessesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -901,25 +943,29 @@ internal DiskAccessesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets information about a private endpoint connection under a disk access /// resource. @@ -928,7 +974,7 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The name can't + /// The name of the disk access resource that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -942,13 +988,13 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -957,58 +1003,69 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskAccessName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskAccessName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskAccessName"); } + if (privateEndpointConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskAccessName", diskAccessName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAPrivateEndpointConnection", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetAPrivateEndpointConnection", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskAccessName}", System.Uri.EscapeDataString(diskAccessName)); _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1018,25 +1075,24 @@ internal DiskAccessesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1048,55 +1104,56 @@ internal DiskAccessesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1106,9 +1163,10 @@ internal DiskAccessesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1119,34 +1177,38 @@ internal DiskAccessesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Approve or reject a private endpoint connection under disk access resource, - /// this can't be used to create a new private endpoint connection. + /// this can't be used to create a new private endpoint connection. /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The name can't + /// The name of the disk access resource that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -1159,16 +1221,16 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// DiskAccess and Virtual Network. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, PrivateLinkServiceConnectionState privateLinkServiceConnectionState, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateAPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, privateLinkServiceConnectionState, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateAPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, privateLinkServiceConnectionState, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1178,7 +1240,7 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The name can't + /// The name of the disk access resource that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -1187,16 +1249,16 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// The name of the private endpoint connection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteAPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteAPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1206,7 +1268,7 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The name can't + /// The name of the disk access resource that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -1217,13 +1279,13 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1232,52 +1294,62 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskAccessName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskAccessName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskAccessName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskAccessName", diskAccessName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResources", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResources", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privatelinkresources").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskAccessName}", System.Uri.EscapeDataString(diskAccessName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1287,25 +1359,24 @@ internal DiskAccessesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1317,55 +1388,56 @@ internal DiskAccessesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1375,9 +1447,10 @@ internal DiskAccessesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1388,25 +1461,29 @@ internal DiskAccessesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a disk access resource /// @@ -1414,7 +1491,7 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The name can't + /// The name of the disk access resource that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -1428,13 +1505,13 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1443,61 +1520,71 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, DiskAccess diskAccess, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, DiskAccess diskAccess, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (diskAccess == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskAccess"); } + if (diskAccess != null) + { + diskAccess.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskAccessName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskAccessName"); - } - if (diskAccess == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "diskAccess"); - } - if (diskAccess != null) - { - diskAccess.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskAccessName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskAccessName", diskAccessName); + tracingParameters.Add("diskAccess", diskAccess); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskAccessName}", System.Uri.EscapeDataString(diskAccessName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1507,25 +1594,24 @@ internal DiskAccessesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1537,61 +1623,62 @@ internal DiskAccessesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(diskAccess != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(diskAccess, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(diskAccess, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1601,9 +1688,10 @@ internal DiskAccessesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1614,25 +1702,29 @@ internal DiskAccessesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates (patches) a disk access resource. /// @@ -1640,7 +1732,7 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The name can't + /// The name of the disk access resource that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -1654,13 +1746,13 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1669,58 +1761,68 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskAccessName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskAccessName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskAccessName"); } + string apiVersion = "2025-01-02"; DiskAccessUpdate diskAccess = new DiskAccessUpdate(); - if (tags != null) + if(tags != null) { diskAccess.Tags = tags; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskAccessName", diskAccessName); + tracingParameters.Add("diskAccess", diskAccess); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskAccessName}", System.Uri.EscapeDataString(diskAccessName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1730,25 +1832,24 @@ internal DiskAccessesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1760,61 +1861,62 @@ internal DiskAccessesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(diskAccess != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(diskAccess, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(diskAccess, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1824,9 +1926,10 @@ internal DiskAccessesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1837,25 +1940,29 @@ internal DiskAccessesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a disk access resource. /// @@ -1863,7 +1970,7 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The name can't + /// The name of the disk access resource that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -1874,10 +1981,10 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1886,52 +1993,62 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskAccessName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskAccessName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskAccessName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskAccessName", diskAccessName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskAccessName}", System.Uri.EscapeDataString(diskAccessName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1941,25 +2058,24 @@ internal DiskAccessesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1971,55 +2087,56 @@ internal DiskAccessesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2029,29 +2146,34 @@ internal DiskAccessesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Approve or reject a private endpoint connection under disk access resource, - /// this can't be used to create a new private endpoint connection. + /// this can't be used to create a new private endpoint connection. /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The name can't + /// The name of the disk access resource that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -2069,13 +2191,13 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2084,68 +2206,75 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, PrivateLinkServiceConnectionState privateLinkServiceConnectionState, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskAccessName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskAccessName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskAccessName"); } + if (privateEndpointConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); - } - if (privateLinkServiceConnectionState == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateLinkServiceConnectionState"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } + string apiVersion = "2025-01-02"; PrivateEndpointConnection privateEndpointConnection = new PrivateEndpointConnection(); - if (privateLinkServiceConnectionState != null) + if(privateLinkServiceConnectionState != null) { privateEndpointConnection.PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskAccessName", diskAccessName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("privateEndpointConnection", privateEndpointConnection); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateAPrivateEndpointConnection", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateAPrivateEndpointConnection", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskAccessName}", System.Uri.EscapeDataString(diskAccessName)); _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2155,25 +2284,24 @@ internal DiskAccessesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2185,61 +2313,62 @@ internal DiskAccessesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(privateEndpointConnection != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointConnection, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointConnection, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2249,9 +2378,10 @@ internal DiskAccessesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2262,25 +2392,29 @@ internal DiskAccessesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a private endpoint connection under a disk access resource. /// @@ -2288,7 +2422,7 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The name can't + /// The name of the disk access resource that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -2302,10 +2436,10 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2314,58 +2448,69 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskAccessName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskAccessName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskAccessName"); } + if (privateEndpointConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskAccessName", diskAccessName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteAPrivateEndpointConnection", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteAPrivateEndpointConnection", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskAccessName}", System.Uri.EscapeDataString(diskAccessName)); _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2375,25 +2520,24 @@ internal DiskAccessesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2405,55 +2549,56 @@ internal DiskAccessesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2463,20 +2608,25 @@ internal DiskAccessesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the disk access resources under a subscription. /// @@ -2489,13 +2639,13 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2504,51 +2654,54 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2560,55 +2713,56 @@ internal DiskAccessesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2618,9 +2772,10 @@ internal DiskAccessesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2631,25 +2786,29 @@ internal DiskAccessesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the disk access resources under a resource group. /// @@ -2662,13 +2821,13 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2677,51 +2836,54 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2733,55 +2895,56 @@ internal DiskAccessesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2791,9 +2954,10 @@ internal DiskAccessesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2804,25 +2968,29 @@ internal DiskAccessesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List information about private endpoint connections under a disk access /// resource @@ -2836,13 +3004,13 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2851,51 +3019,54 @@ internal DiskAccessesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPrivateEndpointConnectionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListPrivateEndpointConnectionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPrivateEndpointConnectionsNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListPrivateEndpointConnectionsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2907,55 +3078,56 @@ internal DiskAccessesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2965,9 +3137,10 @@ internal DiskAccessesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2978,24 +3151,28 @@ internal DiskAccessesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/DiskAccessesOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/DiskAccessesOperationsExtensions.cs index 5b1f582c4a9c..a2686a9ef4ab 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/DiskAccessesOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/DiskAccessesOperationsExtensions.cs @@ -1,903 +1,833 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for DiskAccessesOperations. + /// Extension methods for DiskAccessesOperations /// public static partial class DiskAccessesOperationsExtensions { - /// - /// Lists all the disk access resources under a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IDiskAccessesOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all the disk access resources under a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IDiskAccessesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the disk access resources under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage ListByResourceGroup(this IDiskAccessesOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists all the disk access resources under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IDiskAccessesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets information about a disk access resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - public static DiskAccess Get(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName) - { - return operations.GetAsync(resourceGroupName, diskAccessName).GetAwaiter().GetResult(); - } - - /// - /// Gets information about a disk access resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, diskAccessName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a disk access resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// disk access object supplied in the body of the Put disk access operation. - /// - public static DiskAccess CreateOrUpdate(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, DiskAccess diskAccess) - { - return operations.CreateOrUpdateAsync(resourceGroupName, diskAccessName, diskAccess).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a disk access resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// disk access object supplied in the body of the Put disk access operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, DiskAccess diskAccess, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskAccessName, diskAccess, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates (patches) a disk access resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// Resource tags - /// - public static DiskAccess Update(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, IDictionary tags = default(IDictionary)) - { - return operations.UpdateAsync(resourceGroupName, diskAccessName, tags).GetAwaiter().GetResult(); - } - - /// - /// Updates (patches) a disk access resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// Resource tags - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, diskAccessName, tags, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a disk access resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - public static void Delete(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName) - { - operations.DeleteAsync(resourceGroupName, diskAccessName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a disk access resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, diskAccessName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// List information about private endpoint connections under a disk access - /// resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - public static IPage ListPrivateEndpointConnections(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName) - { - return operations.ListPrivateEndpointConnectionsAsync(resourceGroupName, diskAccessName).GetAwaiter().GetResult(); - } - - /// - /// List information about private endpoint connections under a disk access - /// resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The cancellation token. - /// - public static async Task> ListPrivateEndpointConnectionsAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListPrivateEndpointConnectionsWithHttpMessagesAsync(resourceGroupName, diskAccessName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets information about a private endpoint connection under a disk access - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The name of the private endpoint connection. - /// - public static PrivateEndpointConnection GetAPrivateEndpointConnection(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName) - { - return operations.GetAPrivateEndpointConnectionAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Gets information about a private endpoint connection under a disk access - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The name of the private endpoint connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetAPrivateEndpointConnectionAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Approve or reject a private endpoint connection under disk access resource, - /// this can't be used to create a new private endpoint connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The name of the private endpoint connection. - /// - /// - /// A collection of information about the state of the connection between - /// DiskAccess and Virtual Network. - /// - public static PrivateEndpointConnection UpdateAPrivateEndpointConnection(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, PrivateLinkServiceConnectionState privateLinkServiceConnectionState) - { - return operations.UpdateAPrivateEndpointConnectionAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, privateLinkServiceConnectionState).GetAwaiter().GetResult(); - } - - /// - /// Approve or reject a private endpoint connection under disk access resource, - /// this can't be used to create a new private endpoint connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The name of the private endpoint connection. - /// - /// - /// A collection of information about the state of the connection between - /// DiskAccess and Virtual Network. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAPrivateEndpointConnectionAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, PrivateLinkServiceConnectionState privateLinkServiceConnectionState, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateAPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, privateLinkServiceConnectionState, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a private endpoint connection under a disk access resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The name of the private endpoint connection. - /// - public static void DeleteAPrivateEndpointConnection(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName) - { - operations.DeleteAPrivateEndpointConnectionAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a private endpoint connection under a disk access resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The name of the private endpoint connection. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAPrivateEndpointConnectionAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteAPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the private link resources possible under disk access resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - public static PrivateLinkResourceListResult GetPrivateLinkResources(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName) - { - return operations.GetPrivateLinkResourcesAsync(resourceGroupName, diskAccessName).GetAwaiter().GetResult(); - } - - /// - /// Gets the private link resources possible under disk access resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The cancellation token. - /// - public static async Task GetPrivateLinkResourcesAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, diskAccessName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a disk access resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// disk access object supplied in the body of the Put disk access operation. - /// - public static DiskAccess BeginCreateOrUpdate(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, DiskAccess diskAccess) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, diskAccessName, diskAccess).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a disk access resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// disk access object supplied in the body of the Put disk access operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, DiskAccess diskAccess, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskAccessName, diskAccess, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates (patches) a disk access resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// Resource tags - /// - public static DiskAccess BeginUpdate(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, IDictionary tags = default(IDictionary)) - { - return operations.BeginUpdateAsync(resourceGroupName, diskAccessName, tags).GetAwaiter().GetResult(); - } - - /// - /// Updates (patches) a disk access resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// Resource tags - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, diskAccessName, tags, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a disk access resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - public static void BeginDelete(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName) - { - operations.BeginDeleteAsync(resourceGroupName, diskAccessName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a disk access resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, diskAccessName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Approve or reject a private endpoint connection under disk access resource, - /// this can't be used to create a new private endpoint connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The name of the private endpoint connection. - /// - /// - /// A collection of information about the state of the connection between - /// DiskAccess and Virtual Network. - /// - public static PrivateEndpointConnection BeginUpdateAPrivateEndpointConnection(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, PrivateLinkServiceConnectionState privateLinkServiceConnectionState) - { - return operations.BeginUpdateAPrivateEndpointConnectionAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, privateLinkServiceConnectionState).GetAwaiter().GetResult(); - } - - /// - /// Approve or reject a private endpoint connection under disk access resource, - /// this can't be used to create a new private endpoint connection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The name of the private endpoint connection. - /// - /// - /// A collection of information about the state of the connection between - /// DiskAccess and Virtual Network. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAPrivateEndpointConnectionAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, PrivateLinkServiceConnectionState privateLinkServiceConnectionState, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateAPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, privateLinkServiceConnectionState, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a private endpoint connection under a disk access resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The name of the private endpoint connection. - /// - public static void BeginDeleteAPrivateEndpointConnection(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName) - { - operations.BeginDeleteAPrivateEndpointConnectionAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a private endpoint connection under a disk access resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk access resource that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The name of the private endpoint connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAPrivateEndpointConnectionAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteAPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all the disk access resources under a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IDiskAccessesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the disk access resources under a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IDiskAccessesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the disk access resources under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IDiskAccessesOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the disk access resources under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IDiskAccessesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List information about private endpoint connections under a disk access - /// resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListPrivateEndpointConnectionsNext(this IDiskAccessesOperations operations, string nextPageLink) - { - return operations.ListPrivateEndpointConnectionsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List information about private endpoint connections under a disk access - /// resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListPrivateEndpointConnectionsNextAsync(this IDiskAccessesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListPrivateEndpointConnectionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// Lists all the disk access resources under a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IDiskAccessesOperations operations) + { + return ((IDiskAccessesOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all the disk access resources under a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IDiskAccessesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the disk access resources under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IDiskAccessesOperations operations, string resourceGroupName) + { + return ((IDiskAccessesOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the disk access resources under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IDiskAccessesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets information about a disk access resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + public static DiskAccess Get(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName) + { + return ((IDiskAccessesOperations)operations).GetAsync(resourceGroupName, diskAccessName).GetAwaiter().GetResult(); + } + + /// + /// Gets information about a disk access resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, diskAccessName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates or updates a disk access resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + public static DiskAccess CreateOrUpdate(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, DiskAccess diskAccess) + { + return ((IDiskAccessesOperations)operations).CreateOrUpdateAsync(resourceGroupName, diskAccessName, diskAccess).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a disk access resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, DiskAccess diskAccess, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskAccessName, diskAccess, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates (patches) a disk access resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + public static DiskAccess Update(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { + return ((IDiskAccessesOperations)operations).UpdateAsync(resourceGroupName, diskAccessName, tags).GetAwaiter().GetResult(); + } + + /// + /// Updates (patches) a disk access resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, diskAccessName, tags, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a disk access resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + public static void Delete(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName) + { + ((IDiskAccessesOperations)operations).DeleteAsync(resourceGroupName, diskAccessName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a disk access resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, diskAccessName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List information about private endpoint connections under a disk access + /// resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + public static Microsoft.Rest.Azure.IPage ListPrivateEndpointConnections(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName) + { + return ((IDiskAccessesOperations)operations).ListPrivateEndpointConnectionsAsync(resourceGroupName, diskAccessName).GetAwaiter().GetResult(); + } + + /// + /// List information about private endpoint connections under a disk access + /// resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListPrivateEndpointConnectionsAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListPrivateEndpointConnectionsWithHttpMessagesAsync(resourceGroupName, diskAccessName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets information about a private endpoint connection under a disk access + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The name of the private endpoint connection. + /// + public static PrivateEndpointConnection GetAPrivateEndpointConnection(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName) + { + return ((IDiskAccessesOperations)operations).GetAPrivateEndpointConnectionAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets information about a private endpoint connection under a disk access + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAPrivateEndpointConnectionAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Approve or reject a private endpoint connection under disk access resource, + /// this can't be used to create a new private endpoint connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The name of the private endpoint connection. + /// + public static PrivateEndpointConnection UpdateAPrivateEndpointConnection(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState)) + { + return ((IDiskAccessesOperations)operations).UpdateAPrivateEndpointConnectionAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, privateLinkServiceConnectionState).GetAwaiter().GetResult(); + } + + /// + /// Approve or reject a private endpoint connection under disk access resource, + /// this can't be used to create a new private endpoint connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAPrivateEndpointConnectionAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateAPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, privateLinkServiceConnectionState, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a private endpoint connection under a disk access resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The name of the private endpoint connection. + /// + public static void DeleteAPrivateEndpointConnection(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName) + { + ((IDiskAccessesOperations)operations).DeleteAPrivateEndpointConnectionAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a private endpoint connection under a disk access resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAPrivateEndpointConnectionAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteAPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the private link resources possible under disk access resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + public static PrivateLinkResourceListResult GetPrivateLinkResources(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName) + { + return ((IDiskAccessesOperations)operations).GetPrivateLinkResourcesAsync(resourceGroupName, diskAccessName).GetAwaiter().GetResult(); + } + + /// + /// Gets the private link resources possible under disk access resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetPrivateLinkResourcesAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, diskAccessName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates or updates a disk access resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + public static DiskAccess BeginCreateOrUpdate(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, DiskAccess diskAccess) + { + return ((IDiskAccessesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, diskAccessName, diskAccess).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a disk access resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, DiskAccess diskAccess, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskAccessName, diskAccess, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates (patches) a disk access resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + public static DiskAccess BeginUpdate(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { + return ((IDiskAccessesOperations)operations).BeginUpdateAsync(resourceGroupName, diskAccessName, tags).GetAwaiter().GetResult(); + } + + /// + /// Updates (patches) a disk access resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, diskAccessName, tags, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a disk access resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + public static void BeginDelete(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName) + { + ((IDiskAccessesOperations)operations).BeginDeleteAsync(resourceGroupName, diskAccessName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a disk access resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, diskAccessName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Approve or reject a private endpoint connection under disk access resource, + /// this can't be used to create a new private endpoint connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The name of the private endpoint connection. + /// + public static PrivateEndpointConnection BeginUpdateAPrivateEndpointConnection(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState)) + { + return ((IDiskAccessesOperations)operations).BeginUpdateAPrivateEndpointConnectionAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, privateLinkServiceConnectionState).GetAwaiter().GetResult(); + } + + /// + /// Approve or reject a private endpoint connection under disk access resource, + /// this can't be used to create a new private endpoint connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAPrivateEndpointConnectionAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateAPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, privateLinkServiceConnectionState, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a private endpoint connection under a disk access resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The name of the private endpoint connection. + /// + public static void BeginDeleteAPrivateEndpointConnection(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName) + { + ((IDiskAccessesOperations)operations).BeginDeleteAPrivateEndpointConnectionAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a private endpoint connection under a disk access resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAPrivateEndpointConnectionAsync(this IDiskAccessesOperations operations, string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteAPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all the disk access resources under a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IDiskAccessesOperations operations, string nextPageLink) + { + return ((IDiskAccessesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the disk access resources under a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IDiskAccessesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the disk access resources under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IDiskAccessesOperations operations, string nextPageLink) + { + return ((IDiskAccessesOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the disk access resources under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IDiskAccessesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// List information about private endpoint connections under a disk access + /// resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListPrivateEndpointConnectionsNext(this IDiskAccessesOperations operations, string nextPageLink) + { + return ((IDiskAccessesOperations)operations).ListPrivateEndpointConnectionsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List information about private endpoint connections under a disk access + /// resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListPrivateEndpointConnectionsNextAsync(this IDiskAccessesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListPrivateEndpointConnectionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/DiskEncryptionSetsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/DiskEncryptionSetsOperations.cs index 17af45f521e0..fbae199db881 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/DiskEncryptionSetsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/DiskEncryptionSetsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// DiskEncryptionSetsOperations operations. /// - internal partial class DiskEncryptionSetsOperations : IServiceOperations, IDiskEncryptionSetsOperations + internal partial class DiskEncryptionSetsOperations : Microsoft.Rest.IServiceOperations, IDiskEncryptionSetsOperations { /// /// Initializes a new instance of the DiskEncryptionSetsOperations class. @@ -36,13 +24,13 @@ internal partial class DiskEncryptionSetsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DiskEncryptionSetsOperations(ComputeManagementClient client) + internal DiskEncryptionSetsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -74,29 +62,38 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -106,25 +103,24 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -136,55 +132,56 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -194,9 +191,10 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -207,25 +205,29 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the disk encryption sets under a resource group. /// @@ -238,13 +240,13 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -253,46 +255,55 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -302,25 +313,24 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -332,55 +342,56 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -390,9 +401,10 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -403,25 +415,29 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets information about a disk encryption set. /// @@ -429,7 +445,7 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk encryption set that is being created. The name can't + /// The name of the disk encryption set that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -440,13 +456,13 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -455,52 +471,62 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskEncryptionSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskEncryptionSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskEncryptionSetName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskEncryptionSetName", diskEncryptionSetName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskEncryptionSetName}", System.Uri.EscapeDataString(diskEncryptionSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -510,25 +536,24 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -540,55 +565,56 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -598,9 +624,10 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -611,25 +638,29 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a disk encryption set /// @@ -637,7 +668,7 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk encryption set that is being created. The name can't + /// The name of the disk encryption set that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -647,16 +678,16 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// set operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSet diskEncryptionSet, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSet diskEncryptionSet, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -666,7 +697,7 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk encryption set that is being created. The name can't + /// The name of the disk encryption set that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -676,16 +707,16 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// encryption set operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -695,22 +726,22 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk encryption set that is being created. The name can't + /// The name of the disk encryption set that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -720,7 +751,7 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk encryption set that is being created. The name can't + /// The name of the disk encryption set that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -731,13 +762,13 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -746,52 +777,62 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAssociatedResourcesWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAssociatedResourcesWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskEncryptionSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskEncryptionSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskEncryptionSetName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskEncryptionSetName", diskEncryptionSetName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAssociatedResources", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAssociatedResources", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}/associatedResources").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskEncryptionSetName}", System.Uri.EscapeDataString(diskEncryptionSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -801,25 +842,24 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -831,55 +871,56 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -889,9 +930,10 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -902,25 +944,29 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a disk encryption set /// @@ -928,7 +974,7 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk encryption set that is being created. The name can't + /// The name of the disk encryption set that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -943,13 +989,13 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -958,61 +1004,71 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSet diskEncryptionSet, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSet diskEncryptionSet, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (diskEncryptionSet == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskEncryptionSet"); + } + if (diskEncryptionSet != null) + { + diskEncryptionSet.Validate(); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskEncryptionSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskEncryptionSetName"); - } - if (diskEncryptionSet == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "diskEncryptionSet"); - } - if (diskEncryptionSet != null) - { - diskEncryptionSet.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskEncryptionSetName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskEncryptionSetName", diskEncryptionSetName); + tracingParameters.Add("diskEncryptionSet", diskEncryptionSet); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskEncryptionSetName}", System.Uri.EscapeDataString(diskEncryptionSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1022,25 +1078,24 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1052,61 +1107,62 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(diskEncryptionSet != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(diskEncryptionSet, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(diskEncryptionSet, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1116,9 +1172,10 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1129,25 +1186,29 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates (patches) a disk encryption set. /// @@ -1155,7 +1216,7 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk encryption set that is being created. The name can't + /// The name of the disk encryption set that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -1170,13 +1231,13 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1185,57 +1246,67 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (diskEncryptionSet == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskEncryptionSet"); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskEncryptionSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskEncryptionSetName"); - } - if (diskEncryptionSet == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "diskEncryptionSet"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskEncryptionSetName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskEncryptionSetName", diskEncryptionSetName); + tracingParameters.Add("diskEncryptionSet", diskEncryptionSet); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskEncryptionSetName}", System.Uri.EscapeDataString(diskEncryptionSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1245,25 +1316,24 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1275,61 +1345,62 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(diskEncryptionSet != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(diskEncryptionSet, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(diskEncryptionSet, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1339,9 +1410,10 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1352,25 +1424,29 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a disk encryption set. /// @@ -1378,7 +1454,7 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk encryption set that is being created. The name can't + /// The name of the disk encryption set that is being created. The name can't /// be changed after the disk encryption set is created. Supported characters /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 /// characters. @@ -1389,10 +1465,10 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1401,52 +1477,62 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskEncryptionSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskEncryptionSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskEncryptionSetName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskEncryptionSetName", diskEncryptionSetName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskEncryptionSetName}", System.Uri.EscapeDataString(diskEncryptionSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1456,25 +1542,24 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1486,55 +1571,56 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1544,20 +1630,25 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the disk encryption sets under a subscription. /// @@ -1570,13 +1661,13 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1585,51 +1676,54 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1641,55 +1735,56 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1699,9 +1794,10 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1712,25 +1808,29 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the disk encryption sets under a resource group. /// @@ -1743,13 +1843,13 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1758,51 +1858,54 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1814,55 +1917,56 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1872,9 +1976,10 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1885,25 +1990,29 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all resources that are encrypted with this disk encryption set. /// @@ -1916,13 +2025,13 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1931,51 +2040,54 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAssociatedResourcesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAssociatedResourcesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAssociatedResourcesNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAssociatedResourcesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1987,55 +2099,56 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2045,9 +2158,10 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2058,24 +2172,28 @@ internal DiskEncryptionSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/DiskEncryptionSetsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/DiskEncryptionSetsOperationsExtensions.cs index c826890bf87c..42f69278a435 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/DiskEncryptionSetsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/DiskEncryptionSetsOperationsExtensions.cs @@ -1,583 +1,529 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for DiskEncryptionSetsOperations. + /// Extension methods for DiskEncryptionSetsOperations /// public static partial class DiskEncryptionSetsOperationsExtensions { - /// - /// Lists all the disk encryption sets under a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IDiskEncryptionSetsOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all the disk encryption sets under a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IDiskEncryptionSetsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the disk encryption sets under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage ListByResourceGroup(this IDiskEncryptionSetsOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists all the disk encryption sets under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets information about a disk encryption set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk encryption set that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - public static DiskEncryptionSet Get(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName) - { - return operations.GetAsync(resourceGroupName, diskEncryptionSetName).GetAwaiter().GetResult(); - } - - /// - /// Gets information about a disk encryption set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk encryption set that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a disk encryption set - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk encryption set that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// disk encryption set object supplied in the body of the Put disk encryption - /// set operation. - /// - public static DiskEncryptionSet CreateOrUpdate(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSet diskEncryptionSet) - { - return operations.CreateOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a disk encryption set - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk encryption set that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// disk encryption set object supplied in the body of the Put disk encryption - /// set operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSet diskEncryptionSet, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates (patches) a disk encryption set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk encryption set that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// disk encryption set object supplied in the body of the Patch disk - /// encryption set operation. - /// - public static DiskEncryptionSet Update(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) - { - return operations.UpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).GetAwaiter().GetResult(); - } - - /// - /// Updates (patches) a disk encryption set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk encryption set that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// disk encryption set object supplied in the body of the Patch disk - /// encryption set operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a disk encryption set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk encryption set that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - public static void Delete(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName) - { - operations.DeleteAsync(resourceGroupName, diskEncryptionSetName).GetAwaiter().GetResult(); - } + /// + /// Lists all the disk encryption sets under a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IDiskEncryptionSetsOperations operations) + { + return ((IDiskEncryptionSetsOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Deletes a disk encryption set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk encryption set that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all the disk encryption sets under a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IDiskEncryptionSetsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Lists all the disk encryption sets under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IDiskEncryptionSetsOperations operations, string resourceGroupName) + { + return ((IDiskEncryptionSetsOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Lists all resources that are encrypted with this disk encryption set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk encryption set that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - public static IPage ListAssociatedResources(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName) + /// + /// Lists all the disk encryption sets under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAssociatedResourcesAsync(resourceGroupName, diskEncryptionSetName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets information about a disk encryption set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + public static DiskEncryptionSet Get(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName) + { + return ((IDiskEncryptionSetsOperations)operations).GetAsync(resourceGroupName, diskEncryptionSetName).GetAwaiter().GetResult(); + } - /// - /// Lists all resources that are encrypted with this disk encryption set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk encryption set that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAssociatedResourcesAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets information about a disk encryption set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListAssociatedResourcesWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates or updates a disk encryption set + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + public static DiskEncryptionSet CreateOrUpdate(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSet diskEncryptionSet) + { + return ((IDiskEncryptionSetsOperations)operations).CreateOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a disk encryption set - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk encryption set that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// disk encryption set object supplied in the body of the Put disk encryption - /// set operation. - /// - public static DiskEncryptionSet BeginCreateOrUpdate(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSet diskEncryptionSet) + /// + /// Creates or updates a disk encryption set + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSet diskEncryptionSet, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Updates (patches) a disk encryption set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + public static DiskEncryptionSet Update(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) + { + return ((IDiskEncryptionSetsOperations)operations).UpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a disk encryption set - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk encryption set that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// disk encryption set object supplied in the body of the Put disk encryption - /// set operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSet diskEncryptionSet, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Updates (patches) a disk encryption set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes a disk encryption set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + public static void Delete(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName) + { + ((IDiskEncryptionSetsOperations)operations).DeleteAsync(resourceGroupName, diskEncryptionSetName).GetAwaiter().GetResult(); + } - /// - /// Updates (patches) a disk encryption set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk encryption set that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// disk encryption set object supplied in the body of the Patch disk - /// encryption set operation. - /// - public static DiskEncryptionSet BeginUpdate(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) - { - return operations.BeginUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).GetAwaiter().GetResult(); - } + /// + /// Deletes a disk encryption set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all resources that are encrypted with this disk encryption set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + public static Microsoft.Rest.Azure.IPage ListAssociatedResources(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName) + { + return ((IDiskEncryptionSetsOperations)operations).ListAssociatedResourcesAsync(resourceGroupName, diskEncryptionSetName).GetAwaiter().GetResult(); + } - /// - /// Updates (patches) a disk encryption set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk encryption set that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// disk encryption set object supplied in the body of the Patch disk - /// encryption set operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all resources that are encrypted with this disk encryption set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAssociatedResourcesAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAssociatedResourcesWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates or updates a disk encryption set + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + public static DiskEncryptionSet BeginCreateOrUpdate(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSet diskEncryptionSet) + { + return ((IDiskEncryptionSetsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).GetAwaiter().GetResult(); + } - /// - /// Deletes a disk encryption set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk encryption set that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - public static void BeginDelete(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName) + /// + /// Creates or updates a disk encryption set + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSet diskEncryptionSet, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, diskEncryptionSetName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Updates (patches) a disk encryption set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + public static DiskEncryptionSet BeginUpdate(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) + { + return ((IDiskEncryptionSetsOperations)operations).BeginUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).GetAwaiter().GetResult(); + } - /// - /// Deletes a disk encryption set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the disk encryption set that is being created. The name can't - /// be changed after the disk encryption set is created. Supported characters - /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Updates (patches) a disk encryption set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Deletes a disk encryption set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + public static void BeginDelete(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName) + { + ((IDiskEncryptionSetsOperations)operations).BeginDeleteAsync(resourceGroupName, diskEncryptionSetName).GetAwaiter().GetResult(); + } - /// - /// Lists all the disk encryption sets under a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IDiskEncryptionSetsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } + /// + /// Deletes a disk encryption set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IDiskEncryptionSetsOperations operations, string resourceGroupName, string diskEncryptionSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, diskEncryptionSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all the disk encryption sets under a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IDiskEncryptionSetsOperations operations, string nextPageLink) + { + return ((IDiskEncryptionSetsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists all the disk encryption sets under a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IDiskEncryptionSetsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all the disk encryption sets under a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IDiskEncryptionSetsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all the disk encryption sets under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IDiskEncryptionSetsOperations operations, string nextPageLink) + { + return ((IDiskEncryptionSetsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists all the disk encryption sets under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IDiskEncryptionSetsOperations operations, string nextPageLink) + /// + /// Lists all the disk encryption sets under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IDiskEncryptionSetsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists all resources that are encrypted with this disk encryption set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAssociatedResourcesNext(this IDiskEncryptionSetsOperations operations, string nextPageLink) + { + return ((IDiskEncryptionSetsOperations)operations).ListAssociatedResourcesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists all the disk encryption sets under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IDiskEncryptionSetsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all resources that are encrypted with this disk encryption set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAssociatedResourcesNextAsync(this IDiskEncryptionSetsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAssociatedResourcesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Lists all resources that are encrypted with this disk encryption set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAssociatedResourcesNext(this IDiskEncryptionSetsOperations operations, string nextPageLink) - { - return operations.ListAssociatedResourcesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all resources that are encrypted with this disk encryption set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAssociatedResourcesNextAsync(this IDiskEncryptionSetsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAssociatedResourcesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/DiskRestorePointOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/DiskRestorePointOperations.cs index 2b852fb01d3f..aadaec00499f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/DiskRestorePointOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/DiskRestorePointOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// DiskRestorePointOperations operations. /// - internal partial class DiskRestorePointOperations : IServiceOperations, IDiskRestorePointOperations + internal partial class DiskRestorePointOperations : Microsoft.Rest.IServiceOperations, IDiskRestorePointOperations { /// /// Initializes a new instance of the DiskRestorePointOperations class. @@ -36,13 +24,13 @@ internal partial class DiskRestorePointOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DiskRestorePointOperations(ComputeManagementClient client) + internal DiskRestorePointOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -69,13 +57,13 @@ internal DiskRestorePointOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -84,58 +72,69 @@ internal DiskRestorePointOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByRestorePointWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByRestorePointWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (restorePointCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restorePointCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "restorePointCollectionName"); } + if (vmRestorePointName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmRestorePointName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmRestorePointName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("restorePointCollectionName", restorePointCollectionName); tracingParameters.Add("vmRestorePointName", vmRestorePointName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByRestorePoint", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByRestorePoint", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{restorePointCollectionName}", System.Uri.EscapeDataString(restorePointCollectionName)); _url = _url.Replace("{vmRestorePointName}", System.Uri.EscapeDataString(vmRestorePointName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -145,25 +144,24 @@ internal DiskRestorePointOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -175,55 +173,56 @@ internal DiskRestorePointOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -233,9 +232,10 @@ internal DiskRestorePointOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -246,25 +246,29 @@ internal DiskRestorePointOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get disk restorePoint resource /// @@ -287,13 +291,13 @@ internal DiskRestorePointOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -302,64 +306,76 @@ internal DiskRestorePointOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (restorePointCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restorePointCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "restorePointCollectionName"); } + if (vmRestorePointName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmRestorePointName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmRestorePointName"); } + if (diskRestorePointName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskRestorePointName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskRestorePointName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("restorePointCollectionName", restorePointCollectionName); tracingParameters.Add("vmRestorePointName", vmRestorePointName); tracingParameters.Add("diskRestorePointName", diskRestorePointName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{restorePointCollectionName}", System.Uri.EscapeDataString(restorePointCollectionName)); _url = _url.Replace("{vmRestorePointName}", System.Uri.EscapeDataString(vmRestorePointName)); _url = _url.Replace("{diskRestorePointName}", System.Uri.EscapeDataString(diskRestorePointName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -369,25 +385,24 @@ internal DiskRestorePointOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -399,55 +414,56 @@ internal DiskRestorePointOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -457,9 +473,10 @@ internal DiskRestorePointOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -470,25 +487,29 @@ internal DiskRestorePointOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Grants access to a diskRestorePoint. /// @@ -509,16 +530,16 @@ internal DiskRestorePointOperations(ComputeManagementClient client) /// Access data object supplied in the body of the get disk access operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GrantAccessWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, GrantAccessData grantAccessData, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GrantAccessWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, GrantAccessData grantAccessData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGrantAccessWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGrantAccessWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -538,16 +559,16 @@ internal DiskRestorePointOperations(ComputeManagementClient client) /// The name of the DiskRestorePoint /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task RevokeAccessWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task RevokeAccessWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRevokeAccessWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRevokeAccessWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -575,13 +596,13 @@ internal DiskRestorePointOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -590,73 +611,85 @@ internal DiskRestorePointOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGrantAccessWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, GrantAccessData grantAccessData, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGrantAccessWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, GrantAccessData grantAccessData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (grantAccessData == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "grantAccessData"); + } + if (grantAccessData != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + grantAccessData.Validate(); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (restorePointCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restorePointCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "restorePointCollectionName"); } + if (vmRestorePointName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmRestorePointName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmRestorePointName"); } + if (diskRestorePointName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskRestorePointName"); - } - if (grantAccessData == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "grantAccessData"); - } - if (grantAccessData != null) - { - grantAccessData.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskRestorePointName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("restorePointCollectionName", restorePointCollectionName); tracingParameters.Add("vmRestorePointName", vmRestorePointName); tracingParameters.Add("diskRestorePointName", diskRestorePointName); + tracingParameters.Add("grantAccessData", grantAccessData); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGrantAccess", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGrantAccess", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{restorePointCollectionName}", System.Uri.EscapeDataString(restorePointCollectionName)); _url = _url.Replace("{vmRestorePointName}", System.Uri.EscapeDataString(vmRestorePointName)); _url = _url.Replace("{diskRestorePointName}", System.Uri.EscapeDataString(diskRestorePointName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -666,25 +699,24 @@ internal DiskRestorePointOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -696,61 +728,62 @@ internal DiskRestorePointOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(grantAccessData != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(grantAccessData, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(grantAccessData, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -760,9 +793,10 @@ internal DiskRestorePointOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -773,25 +807,29 @@ internal DiskRestorePointOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Revokes access to a diskRestorePoint. /// @@ -814,10 +852,10 @@ internal DiskRestorePointOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -826,64 +864,76 @@ internal DiskRestorePointOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRevokeAccessWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginRevokeAccessWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (restorePointCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restorePointCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "restorePointCollectionName"); } + if (vmRestorePointName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmRestorePointName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmRestorePointName"); } + if (diskRestorePointName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskRestorePointName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskRestorePointName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("restorePointCollectionName", restorePointCollectionName); tracingParameters.Add("vmRestorePointName", vmRestorePointName); tracingParameters.Add("diskRestorePointName", diskRestorePointName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRevokeAccess", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRevokeAccess", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{restorePointCollectionName}", System.Uri.EscapeDataString(restorePointCollectionName)); _url = _url.Replace("{vmRestorePointName}", System.Uri.EscapeDataString(vmRestorePointName)); _url = _url.Replace("{diskRestorePointName}", System.Uri.EscapeDataString(diskRestorePointName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -893,25 +943,24 @@ internal DiskRestorePointOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -923,55 +972,56 @@ internal DiskRestorePointOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -981,20 +1031,25 @@ internal DiskRestorePointOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists diskRestorePoints under a vmRestorePoint. /// @@ -1007,13 +1062,13 @@ internal DiskRestorePointOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1022,51 +1077,54 @@ internal DiskRestorePointOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByRestorePointNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByRestorePointNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByRestorePointNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByRestorePointNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1078,55 +1136,56 @@ internal DiskRestorePointOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1136,9 +1195,10 @@ internal DiskRestorePointOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1149,24 +1209,28 @@ internal DiskRestorePointOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/DiskRestorePointOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/DiskRestorePointOperationsExtensions.cs index 30e72f894c2b..75c182b3a181 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/DiskRestorePointOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/DiskRestorePointOperationsExtensions.cs @@ -1,383 +1,355 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for DiskRestorePointOperations. + /// Extension methods for DiskRestorePointOperations /// public static partial class DiskRestorePointOperationsExtensions { - /// - /// Lists diskRestorePoints under a vmRestorePoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection that the disk restore point - /// belongs. - /// - /// - /// The name of the vm restore point that the disk disk restore point belongs. - /// - public static IPage ListByRestorePoint(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName) - { - return operations.ListByRestorePointAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName).GetAwaiter().GetResult(); - } - - /// - /// Lists diskRestorePoints under a vmRestorePoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection that the disk restore point - /// belongs. - /// - /// - /// The name of the vm restore point that the disk disk restore point belongs. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByRestorePointAsync(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByRestorePointWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get disk restorePoint resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection that the disk restore point - /// belongs. - /// - /// - /// The name of the vm restore point that the disk disk restore point belongs. - /// - /// - /// The name of the DiskRestorePoint - /// - public static DiskRestorePoint Get(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName) - { - return operations.GetAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName).GetAwaiter().GetResult(); - } - - /// - /// Get disk restorePoint resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection that the disk restore point - /// belongs. - /// - /// - /// The name of the vm restore point that the disk disk restore point belongs. - /// - /// - /// The name of the DiskRestorePoint - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Grants access to a diskRestorePoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection that the disk restore point - /// belongs. - /// - /// - /// The name of the vm restore point that the disk disk restore point belongs. - /// - /// - /// The name of the DiskRestorePoint - /// - /// - /// Access data object supplied in the body of the get disk access operation. - /// - public static AccessUri GrantAccess(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, GrantAccessData grantAccessData) - { - return operations.GrantAccessAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData).GetAwaiter().GetResult(); - } + /// + /// Lists diskRestorePoints under a vmRestorePoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection that the disk restore point + /// belongs. + /// + /// + /// The name of the vm restore point that the disk disk restore point belongs. + /// + public static Microsoft.Rest.Azure.IPage ListByRestorePoint(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName) + { + return ((IDiskRestorePointOperations)operations).ListByRestorePointAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName).GetAwaiter().GetResult(); + } - /// - /// Grants access to a diskRestorePoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection that the disk restore point - /// belongs. - /// - /// - /// The name of the vm restore point that the disk disk restore point belongs. - /// - /// - /// The name of the DiskRestorePoint - /// - /// - /// Access data object supplied in the body of the get disk access operation. - /// - /// - /// The cancellation token. - /// - public static async Task GrantAccessAsync(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, GrantAccessData grantAccessData, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists diskRestorePoints under a vmRestorePoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection that the disk restore point + /// belongs. + /// + /// + /// The name of the vm restore point that the disk disk restore point belongs. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByRestorePointAsync(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByRestorePointWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GrantAccessWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get disk restorePoint resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection that the disk restore point + /// belongs. + /// + /// + /// The name of the vm restore point that the disk disk restore point belongs. + /// + /// + /// The name of the DiskRestorePoint + /// + public static DiskRestorePoint Get(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName) + { + return ((IDiskRestorePointOperations)operations).GetAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName).GetAwaiter().GetResult(); + } - /// - /// Revokes access to a diskRestorePoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection that the disk restore point - /// belongs. - /// - /// - /// The name of the vm restore point that the disk disk restore point belongs. - /// - /// - /// The name of the DiskRestorePoint - /// - public static void RevokeAccess(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName) + /// + /// Get disk restorePoint resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection that the disk restore point + /// belongs. + /// + /// + /// The name of the vm restore point that the disk disk restore point belongs. + /// + /// + /// The name of the DiskRestorePoint + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, null, cancellationToken).ConfigureAwait(false)) { - operations.RevokeAccessAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Grants access to a diskRestorePoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection that the disk restore point + /// belongs. + /// + /// + /// The name of the vm restore point that the disk disk restore point belongs. + /// + /// + /// The name of the DiskRestorePoint + /// + public static AccessUri GrantAccess(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, GrantAccessData grantAccessData) + { + return ((IDiskRestorePointOperations)operations).GrantAccessAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData).GetAwaiter().GetResult(); + } - /// - /// Revokes access to a diskRestorePoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection that the disk restore point - /// belongs. - /// - /// - /// The name of the vm restore point that the disk disk restore point belongs. - /// - /// - /// The name of the DiskRestorePoint - /// - /// - /// The cancellation token. - /// - public static async Task RevokeAccessAsync(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Grants access to a diskRestorePoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection that the disk restore point + /// belongs. + /// + /// + /// The name of the vm restore point that the disk disk restore point belongs. + /// + /// + /// The name of the DiskRestorePoint + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GrantAccessAsync(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, GrantAccessData grantAccessData, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GrantAccessWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData, null, cancellationToken).ConfigureAwait(false)) { - (await operations.RevokeAccessWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Revokes access to a diskRestorePoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection that the disk restore point + /// belongs. + /// + /// + /// The name of the vm restore point that the disk disk restore point belongs. + /// + /// + /// The name of the DiskRestorePoint + /// + public static void RevokeAccess(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName) + { + ((IDiskRestorePointOperations)operations).RevokeAccessAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName).GetAwaiter().GetResult(); + } - /// - /// Grants access to a diskRestorePoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection that the disk restore point - /// belongs. - /// - /// - /// The name of the vm restore point that the disk disk restore point belongs. - /// - /// - /// The name of the DiskRestorePoint - /// - /// - /// Access data object supplied in the body of the get disk access operation. - /// - public static AccessUri BeginGrantAccess(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, GrantAccessData grantAccessData) - { - return operations.BeginGrantAccessAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData).GetAwaiter().GetResult(); - } + /// + /// Revokes access to a diskRestorePoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection that the disk restore point + /// belongs. + /// + /// + /// The name of the vm restore point that the disk disk restore point belongs. + /// + /// + /// The name of the DiskRestorePoint + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RevokeAccessAsync(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.RevokeAccessWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Grants access to a diskRestorePoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection that the disk restore point + /// belongs. + /// + /// + /// The name of the vm restore point that the disk disk restore point belongs. + /// + /// + /// The name of the DiskRestorePoint + /// + public static AccessUri BeginGrantAccess(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, GrantAccessData grantAccessData) + { + return ((IDiskRestorePointOperations)operations).BeginGrantAccessAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData).GetAwaiter().GetResult(); + } - /// - /// Grants access to a diskRestorePoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection that the disk restore point - /// belongs. - /// - /// - /// The name of the vm restore point that the disk disk restore point belongs. - /// - /// - /// The name of the DiskRestorePoint - /// - /// - /// Access data object supplied in the body of the get disk access operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGrantAccessAsync(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, GrantAccessData grantAccessData, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Grants access to a diskRestorePoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection that the disk restore point + /// belongs. + /// + /// + /// The name of the vm restore point that the disk disk restore point belongs. + /// + /// + /// The name of the DiskRestorePoint + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGrantAccessAsync(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, GrantAccessData grantAccessData, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGrantAccessWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginGrantAccessWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Revokes access to a diskRestorePoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection that the disk restore point + /// belongs. + /// + /// + /// The name of the vm restore point that the disk disk restore point belongs. + /// + /// + /// The name of the DiskRestorePoint + /// + public static void BeginRevokeAccess(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName) + { + ((IDiskRestorePointOperations)operations).BeginRevokeAccessAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName).GetAwaiter().GetResult(); + } - /// - /// Revokes access to a diskRestorePoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection that the disk restore point - /// belongs. - /// - /// - /// The name of the vm restore point that the disk disk restore point belongs. - /// - /// - /// The name of the DiskRestorePoint - /// - public static void BeginRevokeAccess(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName) - { - operations.BeginRevokeAccessAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName).GetAwaiter().GetResult(); - } + /// + /// Revokes access to a diskRestorePoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection that the disk restore point + /// belongs. + /// + /// + /// The name of the vm restore point that the disk disk restore point belongs. + /// + /// + /// The name of the DiskRestorePoint + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRevokeAccessAsync(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginRevokeAccessWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists diskRestorePoints under a vmRestorePoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByRestorePointNext(this IDiskRestorePointOperations operations, string nextPageLink) + { + return ((IDiskRestorePointOperations)operations).ListByRestorePointNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Revokes access to a diskRestorePoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection that the disk restore point - /// belongs. - /// - /// - /// The name of the vm restore point that the disk disk restore point belongs. - /// - /// - /// The name of the DiskRestorePoint - /// - /// - /// The cancellation token. - /// - public static async Task BeginRevokeAccessAsync(this IDiskRestorePointOperations operations, string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists diskRestorePoints under a vmRestorePoint. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByRestorePointNextAsync(this IDiskRestorePointOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByRestorePointNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginRevokeAccessWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Lists diskRestorePoints under a vmRestorePoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByRestorePointNext(this IDiskRestorePointOperations operations, string nextPageLink) - { - return operations.ListByRestorePointNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists diskRestorePoints under a vmRestorePoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByRestorePointNextAsync(this IDiskRestorePointOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByRestorePointNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/DisksOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/DisksOperations.cs index f4c370418cc2..2f8a75a41908 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/DisksOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/DisksOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// DisksOperations operations. /// - internal partial class DisksOperations : IServiceOperations, IDisksOperations + internal partial class DisksOperations : Microsoft.Rest.IServiceOperations, IDisksOperations { /// /// Initializes a new instance of the DisksOperations class. @@ -36,13 +24,13 @@ internal partial class DisksOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DisksOperations(ComputeManagementClient client) + internal DisksOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal DisksOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -74,29 +62,38 @@ internal DisksOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -106,25 +103,24 @@ internal DisksOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -136,55 +132,56 @@ internal DisksOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -194,9 +191,10 @@ internal DisksOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -207,25 +205,29 @@ internal DisksOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the disks under a resource group. /// @@ -238,13 +240,13 @@ internal DisksOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -253,46 +255,55 @@ internal DisksOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -302,25 +313,24 @@ internal DisksOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -332,55 +342,56 @@ internal DisksOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -390,9 +401,10 @@ internal DisksOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -403,25 +415,29 @@ internal DisksOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets information about a disk. /// @@ -429,7 +445,7 @@ internal DisksOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't be + /// The name of the managed disk that is being created. The name can't be /// changed after the disk is created. Supported characters for the name are /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// @@ -439,13 +455,13 @@ internal DisksOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -454,52 +470,62 @@ internal DisksOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string diskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string diskName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskName", diskName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskName}", System.Uri.EscapeDataString(diskName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -509,25 +535,24 @@ internal DisksOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -539,55 +564,56 @@ internal DisksOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -597,9 +623,10 @@ internal DisksOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -610,25 +637,29 @@ internal DisksOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a disk. /// @@ -636,7 +667,7 @@ internal DisksOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't be + /// The name of the managed disk that is being created. The name can't be /// changed after the disk is created. Supported characters for the name are /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// @@ -644,16 +675,16 @@ internal DisksOperations(ComputeManagementClient client) /// Disk object supplied in the body of the Put disk operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskName, Disk disk, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskName, Disk disk, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskName, disk, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskName, disk, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -663,7 +694,7 @@ internal DisksOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't be + /// The name of the managed disk that is being created. The name can't be /// changed after the disk is created. Supported characters for the name are /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// @@ -671,16 +702,16 @@ internal DisksOperations(ComputeManagementClient client) /// Disk object supplied in the body of the Patch disk operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string diskName, DiskUpdate disk, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string diskName, DiskUpdate disk, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, diskName, disk, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, diskName, disk, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -690,21 +721,21 @@ internal DisksOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't be + /// The name of the managed disk that is being created. The name can't be /// changed after the disk is created. Supported characters for the name are /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string diskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string diskName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, diskName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, diskName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -714,7 +745,7 @@ internal DisksOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't be + /// The name of the managed disk that is being created. The name can't be /// changed after the disk is created. Supported characters for the name are /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// @@ -722,16 +753,16 @@ internal DisksOperations(ComputeManagementClient client) /// Access data object supplied in the body of the get disk access operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GrantAccessWithHttpMessagesAsync(string resourceGroupName, string diskName, GrantAccessData grantAccessData, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GrantAccessWithHttpMessagesAsync(string resourceGroupName, string diskName, GrantAccessData grantAccessData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGrantAccessWithHttpMessagesAsync(resourceGroupName, diskName, grantAccessData, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGrantAccessWithHttpMessagesAsync(resourceGroupName, diskName, grantAccessData, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -741,21 +772,21 @@ internal DisksOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't be + /// The name of the managed disk that is being created. The name can't be /// changed after the disk is created. Supported characters for the name are /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task RevokeAccessWithHttpMessagesAsync(string resourceGroupName, string diskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task RevokeAccessWithHttpMessagesAsync(string resourceGroupName, string diskName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRevokeAccessWithHttpMessagesAsync(resourceGroupName, diskName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRevokeAccessWithHttpMessagesAsync(resourceGroupName, diskName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -765,7 +796,7 @@ internal DisksOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't be + /// The name of the managed disk that is being created. The name can't be /// changed after the disk is created. Supported characters for the name are /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// @@ -778,13 +809,13 @@ internal DisksOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -793,61 +824,71 @@ internal DisksOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskName, Disk disk, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskName, Disk disk, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (disk == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "disk"); + } + if (disk != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + disk.Validate(); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskName"); - } - if (disk == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "disk"); - } - if (disk != null) - { - disk.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskName", diskName); + tracingParameters.Add("disk", disk); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskName}", System.Uri.EscapeDataString(diskName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -857,25 +898,24 @@ internal DisksOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -887,61 +927,62 @@ internal DisksOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(disk != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(disk, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(disk, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -951,9 +992,10 @@ internal DisksOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -964,25 +1006,29 @@ internal DisksOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates (patches) a disk. /// @@ -990,7 +1036,7 @@ internal DisksOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't be + /// The name of the managed disk that is being created. The name can't be /// changed after the disk is created. Supported characters for the name are /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// @@ -1003,13 +1049,13 @@ internal DisksOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1018,57 +1064,67 @@ internal DisksOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string diskName, DiskUpdate disk, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string diskName, DiskUpdate disk, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (disk == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "disk"); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskName"); - } - if (disk == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "disk"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskName", diskName); + tracingParameters.Add("disk", disk); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskName}", System.Uri.EscapeDataString(diskName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1078,25 +1134,24 @@ internal DisksOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1108,61 +1163,62 @@ internal DisksOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(disk != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(disk, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(disk, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1172,9 +1228,10 @@ internal DisksOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1185,25 +1242,29 @@ internal DisksOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a disk. /// @@ -1211,7 +1272,7 @@ internal DisksOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't be + /// The name of the managed disk that is being created. The name can't be /// changed after the disk is created. Supported characters for the name are /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// @@ -1221,10 +1282,10 @@ internal DisksOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1233,52 +1294,62 @@ internal DisksOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string diskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string diskName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskName", diskName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskName}", System.Uri.EscapeDataString(diskName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1288,25 +1359,24 @@ internal DisksOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1318,55 +1388,56 @@ internal DisksOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1376,20 +1447,25 @@ internal DisksOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Grants access to a disk. /// @@ -1397,7 +1473,7 @@ internal DisksOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't be + /// The name of the managed disk that is being created. The name can't be /// changed after the disk is created. Supported characters for the name are /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// @@ -1410,13 +1486,13 @@ internal DisksOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1425,61 +1501,71 @@ internal DisksOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGrantAccessWithHttpMessagesAsync(string resourceGroupName, string diskName, GrantAccessData grantAccessData, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGrantAccessWithHttpMessagesAsync(string resourceGroupName, string diskName, GrantAccessData grantAccessData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (grantAccessData == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "grantAccessData"); } + if (grantAccessData != null) + { + grantAccessData.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskName"); - } - if (grantAccessData == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "grantAccessData"); - } - if (grantAccessData != null) - { - grantAccessData.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskName", diskName); + tracingParameters.Add("grantAccessData", grantAccessData); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGrantAccess", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGrantAccess", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskName}", System.Uri.EscapeDataString(diskName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1489,25 +1575,24 @@ internal DisksOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1519,61 +1604,62 @@ internal DisksOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(grantAccessData != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(grantAccessData, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(grantAccessData, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1583,9 +1669,10 @@ internal DisksOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1596,25 +1683,29 @@ internal DisksOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Revokes access to a disk. /// @@ -1622,7 +1713,7 @@ internal DisksOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't be + /// The name of the managed disk that is being created. The name can't be /// changed after the disk is created. Supported characters for the name are /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// @@ -1632,10 +1723,10 @@ internal DisksOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1644,52 +1735,62 @@ internal DisksOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRevokeAccessWithHttpMessagesAsync(string resourceGroupName, string diskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginRevokeAccessWithHttpMessagesAsync(string resourceGroupName, string diskName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (diskName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diskName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "diskName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("diskName", diskName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRevokeAccess", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRevokeAccess", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{diskName}", System.Uri.EscapeDataString(diskName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1699,25 +1800,24 @@ internal DisksOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1729,55 +1829,56 @@ internal DisksOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1787,20 +1888,25 @@ internal DisksOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the disks under a subscription. /// @@ -1813,13 +1919,13 @@ internal DisksOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1828,51 +1934,54 @@ internal DisksOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1884,55 +1993,56 @@ internal DisksOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1942,9 +2052,10 @@ internal DisksOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1955,25 +2066,29 @@ internal DisksOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the disks under a resource group. /// @@ -1986,13 +2101,13 @@ internal DisksOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2001,51 +2116,54 @@ internal DisksOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2057,55 +2175,56 @@ internal DisksOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2115,9 +2234,10 @@ internal DisksOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2128,24 +2248,28 @@ internal DisksOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/DisksOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/DisksOperationsExtensions.cs index 3b8b724cf251..ac475d0170c6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/DisksOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/DisksOperationsExtensions.cs @@ -1,663 +1,603 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for DisksOperations. + /// Extension methods for DisksOperations /// public static partial class DisksOperationsExtensions { - /// - /// Lists all the disks under a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IDisksOperations operations) + /// + /// Lists all the disks under a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IDisksOperations operations) + { + return ((IDisksOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all the disks under a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IDisksOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync().GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Lists all the disks under a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IDisksOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the disks under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage ListByResourceGroup(this IDisksOperations operations, string resourceGroupName) + } + /// + /// Lists all the disks under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IDisksOperations operations, string resourceGroupName) + { + return ((IDisksOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the disks under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IDisksOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Lists all the disks under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IDisksOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets information about a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - public static Disk Get(this IDisksOperations operations, string resourceGroupName, string diskName) + } + /// + /// Gets information about a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + public static Disk Get(this IDisksOperations operations, string resourceGroupName, string diskName) + { + return ((IDisksOperations)operations).GetAsync(resourceGroupName, diskName).GetAwaiter().GetResult(); + } + + /// + /// Gets information about a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDisksOperations operations, string resourceGroupName, string diskName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, diskName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, diskName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets information about a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDisksOperations operations, string resourceGroupName, string diskName, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Creates or updates a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + public static Disk CreateOrUpdate(this IDisksOperations operations, string resourceGroupName, string diskName, Disk disk) + { + return ((IDisksOperations)operations).CreateOrUpdateAsync(resourceGroupName, diskName, disk).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IDisksOperations operations, string resourceGroupName, string diskName, Disk disk, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskName, disk, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, diskName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Creates or updates a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - /// - /// Disk object supplied in the body of the Put disk operation. - /// - public static Disk CreateOrUpdate(this IDisksOperations operations, string resourceGroupName, string diskName, Disk disk) + } + /// + /// Updates (patches) a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + public static Disk Update(this IDisksOperations operations, string resourceGroupName, string diskName, DiskUpdate disk) + { + return ((IDisksOperations)operations).UpdateAsync(resourceGroupName, diskName, disk).GetAwaiter().GetResult(); + } + + /// + /// Updates (patches) a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IDisksOperations operations, string resourceGroupName, string diskName, DiskUpdate disk, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, diskName, disk, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, diskName, disk).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Creates or updates a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - /// - /// Disk object supplied in the body of the Put disk operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IDisksOperations operations, string resourceGroupName, string diskName, Disk disk, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Deletes a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + public static void Delete(this IDisksOperations operations, string resourceGroupName, string diskName) + { + ((IDisksOperations)operations).DeleteAsync(resourceGroupName, diskName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IDisksOperations operations, string resourceGroupName, string diskName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, diskName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Grants access to a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + public static AccessUri GrantAccess(this IDisksOperations operations, string resourceGroupName, string diskName, GrantAccessData grantAccessData) + { + return ((IDisksOperations)operations).GrantAccessAsync(resourceGroupName, diskName, grantAccessData).GetAwaiter().GetResult(); + } + + /// + /// Grants access to a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GrantAccessAsync(this IDisksOperations operations, string resourceGroupName, string diskName, GrantAccessData grantAccessData, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GrantAccessWithHttpMessagesAsync(resourceGroupName, diskName, grantAccessData, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskName, disk, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Updates (patches) a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - /// - /// Disk object supplied in the body of the Patch disk operation. - /// - public static Disk Update(this IDisksOperations operations, string resourceGroupName, string diskName, DiskUpdate disk) + } + /// + /// Revokes access to a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + public static void RevokeAccess(this IDisksOperations operations, string resourceGroupName, string diskName) + { + ((IDisksOperations)operations).RevokeAccessAsync(resourceGroupName, diskName).GetAwaiter().GetResult(); + } + + /// + /// Revokes access to a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RevokeAccessAsync(this IDisksOperations operations, string resourceGroupName, string diskName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.RevokeAccessWithHttpMessagesAsync(resourceGroupName, diskName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + public static Disk BeginCreateOrUpdate(this IDisksOperations operations, string resourceGroupName, string diskName, Disk disk) + { + return ((IDisksOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, diskName, disk).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IDisksOperations operations, string resourceGroupName, string diskName, Disk disk, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskName, disk, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(resourceGroupName, diskName, disk).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Updates (patches) a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - /// - /// Disk object supplied in the body of the Patch disk operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IDisksOperations operations, string resourceGroupName, string diskName, DiskUpdate disk, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Updates (patches) a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + public static Disk BeginUpdate(this IDisksOperations operations, string resourceGroupName, string diskName, DiskUpdate disk) + { + return ((IDisksOperations)operations).BeginUpdateAsync(resourceGroupName, diskName, disk).GetAwaiter().GetResult(); + } + + /// + /// Updates (patches) a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IDisksOperations operations, string resourceGroupName, string diskName, DiskUpdate disk, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, diskName, disk, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, diskName, disk, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Deletes a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - public static void Delete(this IDisksOperations operations, string resourceGroupName, string diskName) + } + /// + /// Deletes a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + public static void BeginDelete(this IDisksOperations operations, string resourceGroupName, string diskName) + { + ((IDisksOperations)operations).BeginDeleteAsync(resourceGroupName, diskName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IDisksOperations operations, string resourceGroupName, string diskName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, diskName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Grants access to a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + public static AccessUri BeginGrantAccess(this IDisksOperations operations, string resourceGroupName, string diskName, GrantAccessData grantAccessData) + { + return ((IDisksOperations)operations).BeginGrantAccessAsync(resourceGroupName, diskName, grantAccessData).GetAwaiter().GetResult(); + } + + /// + /// Grants access to a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGrantAccessAsync(this IDisksOperations operations, string resourceGroupName, string diskName, GrantAccessData grantAccessData, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGrantAccessWithHttpMessagesAsync(resourceGroupName, diskName, grantAccessData, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, diskName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IDisksOperations operations, string resourceGroupName, string diskName, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Revokes access to a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + public static void BeginRevokeAccess(this IDisksOperations operations, string resourceGroupName, string diskName) + { + ((IDisksOperations)operations).BeginRevokeAccessAsync(resourceGroupName, diskName).GetAwaiter().GetResult(); + } + + /// + /// Revokes access to a disk. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRevokeAccessAsync(this IDisksOperations operations, string resourceGroupName, string diskName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginRevokeAccessWithHttpMessagesAsync(resourceGroupName, diskName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all the disks under a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IDisksOperations operations, string nextPageLink) + { + return ((IDisksOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the disks under a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IDisksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, diskName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Grants access to a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - /// - /// Access data object supplied in the body of the get disk access operation. - /// - public static AccessUri GrantAccess(this IDisksOperations operations, string resourceGroupName, string diskName, GrantAccessData grantAccessData) - { - return operations.GrantAccessAsync(resourceGroupName, diskName, grantAccessData).GetAwaiter().GetResult(); - } - - /// - /// Grants access to a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - /// - /// Access data object supplied in the body of the get disk access operation. - /// - /// - /// The cancellation token. - /// - public static async Task GrantAccessAsync(this IDisksOperations operations, string resourceGroupName, string diskName, GrantAccessData grantAccessData, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GrantAccessWithHttpMessagesAsync(resourceGroupName, diskName, grantAccessData, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Revokes access to a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - public static void RevokeAccess(this IDisksOperations operations, string resourceGroupName, string diskName) - { - operations.RevokeAccessAsync(resourceGroupName, diskName).GetAwaiter().GetResult(); - } - - /// - /// Revokes access to a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - /// - /// The cancellation token. - /// - public static async Task RevokeAccessAsync(this IDisksOperations operations, string resourceGroupName, string diskName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RevokeAccessWithHttpMessagesAsync(resourceGroupName, diskName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - /// - /// Disk object supplied in the body of the Put disk operation. - /// - public static Disk BeginCreateOrUpdate(this IDisksOperations operations, string resourceGroupName, string diskName, Disk disk) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, diskName, disk).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - /// - /// Disk object supplied in the body of the Put disk operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IDisksOperations operations, string resourceGroupName, string diskName, Disk disk, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, diskName, disk, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates (patches) a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - /// - /// Disk object supplied in the body of the Patch disk operation. - /// - public static Disk BeginUpdate(this IDisksOperations operations, string resourceGroupName, string diskName, DiskUpdate disk) + } + /// + /// Lists all the disks under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IDisksOperations operations, string nextPageLink) + { + return ((IDisksOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the disks under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IDisksOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginUpdateAsync(resourceGroupName, diskName, disk).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Updates (patches) a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - /// - /// Disk object supplied in the body of the Patch disk operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IDisksOperations operations, string resourceGroupName, string diskName, DiskUpdate disk, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, diskName, disk, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - public static void BeginDelete(this IDisksOperations operations, string resourceGroupName, string diskName) - { - operations.BeginDeleteAsync(resourceGroupName, diskName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IDisksOperations operations, string resourceGroupName, string diskName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, diskName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Grants access to a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - /// - /// Access data object supplied in the body of the get disk access operation. - /// - public static AccessUri BeginGrantAccess(this IDisksOperations operations, string resourceGroupName, string diskName, GrantAccessData grantAccessData) - { - return operations.BeginGrantAccessAsync(resourceGroupName, diskName, grantAccessData).GetAwaiter().GetResult(); - } - - /// - /// Grants access to a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - /// - /// Access data object supplied in the body of the get disk access operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGrantAccessAsync(this IDisksOperations operations, string resourceGroupName, string diskName, GrantAccessData grantAccessData, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGrantAccessWithHttpMessagesAsync(resourceGroupName, diskName, grantAccessData, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Revokes access to a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - public static void BeginRevokeAccess(this IDisksOperations operations, string resourceGroupName, string diskName) - { - operations.BeginRevokeAccessAsync(resourceGroupName, diskName).GetAwaiter().GetResult(); - } - - /// - /// Revokes access to a disk. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the managed disk that is being created. The name can't be - /// changed after the disk is created. Supported characters for the name are - /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRevokeAccessAsync(this IDisksOperations operations, string resourceGroupName, string diskName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRevokeAccessWithHttpMessagesAsync(resourceGroupName, diskName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all the disks under a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IDisksOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the disks under a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IDisksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the disks under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IDisksOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the disks under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IDisksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleriesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleriesOperations.cs index fb76aa87449c..87ff0706ea79 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleriesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleriesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// GalleriesOperations operations. /// - internal partial class GalleriesOperations : IServiceOperations, IGalleriesOperations + internal partial class GalleriesOperations : Microsoft.Rest.IServiceOperations, IGalleriesOperations { /// /// Initializes a new instance of the GalleriesOperations class. @@ -36,13 +24,13 @@ internal partial class GalleriesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal GalleriesOperations(ComputeManagementClient client) + internal GalleriesOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal GalleriesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -74,29 +62,38 @@ internal GalleriesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -106,25 +103,24 @@ internal GalleriesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -136,55 +132,56 @@ internal GalleriesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -194,9 +191,10 @@ internal GalleriesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -207,25 +205,29 @@ internal GalleriesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List galleries under a resource group. /// @@ -238,13 +240,13 @@ internal GalleriesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -253,46 +255,55 @@ internal GalleriesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -302,25 +313,24 @@ internal GalleriesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -332,55 +342,56 @@ internal GalleriesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -390,9 +401,10 @@ internal GalleriesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -403,25 +415,29 @@ internal GalleriesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves information about a Shared Image Gallery. /// @@ -432,12 +448,10 @@ internal GalleriesOperations(ComputeManagementClient client) /// The name of the Shared Image Gallery. /// /// - /// The select expression to apply on the operation. Possible values include: - /// 'Permissions' + /// The select expression to apply on the operation. /// /// - /// The expand query option to apply on the operation. Possible values include: - /// 'SharingProfile/Groups' + /// The expand query option to apply on the operation. /// /// /// Headers that will be added to request. @@ -445,13 +459,13 @@ internal GalleriesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -460,54 +474,66 @@ internal GalleriesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string select = default(string), string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string select = default(string), string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + + + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("select", select); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -525,25 +551,24 @@ internal GalleriesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -555,55 +580,56 @@ internal GalleriesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -613,9 +639,10 @@ internal GalleriesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -626,25 +653,29 @@ internal GalleriesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a Shared Image Gallery. /// @@ -658,16 +689,16 @@ internal GalleriesOperations(ComputeManagementClient client) /// Parameters supplied to the create or update Shared Image Gallery operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, Gallery gallery, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, Gallery gallery, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, gallery, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, gallery, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -683,16 +714,16 @@ internal GalleriesOperations(ComputeManagementClient client) /// Parameters supplied to the update Shared Image Gallery operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, GalleryUpdate gallery, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, GalleryUpdate gallery, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, gallery, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, gallery, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -705,16 +736,16 @@ internal GalleriesOperations(ComputeManagementClient client) /// The name of the Shared Image Gallery. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -735,13 +766,13 @@ internal GalleriesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -750,61 +781,71 @@ internal GalleriesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, Gallery gallery, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, Gallery gallery, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (gallery == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gallery"); + } + if (gallery != null) + { + gallery.Validate(); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); - } - if (gallery == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gallery"); - } - if (gallery != null) - { - gallery.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); + tracingParameters.Add("gallery", gallery); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -814,25 +855,24 @@ internal GalleriesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -844,61 +884,62 @@ internal GalleriesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(gallery != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(gallery, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(gallery, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -908,9 +949,10 @@ internal GalleriesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -921,16 +963,16 @@ internal GalleriesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -939,38 +981,42 @@ internal GalleriesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update a Shared Image Gallery. /// @@ -989,13 +1035,13 @@ internal GalleriesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1004,57 +1050,67 @@ internal GalleriesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, GalleryUpdate gallery, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, GalleryUpdate gallery, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (gallery == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gallery"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); - } - if (gallery == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gallery"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); + tracingParameters.Add("gallery", gallery); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1064,25 +1120,24 @@ internal GalleriesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1094,61 +1149,62 @@ internal GalleriesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(gallery != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(gallery, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(gallery, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1158,9 +1214,10 @@ internal GalleriesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1171,38 +1228,42 @@ internal GalleriesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete a Shared Image Gallery. /// @@ -1218,10 +1279,10 @@ internal GalleriesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1230,52 +1291,62 @@ internal GalleriesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1285,25 +1356,24 @@ internal GalleriesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1315,55 +1385,56 @@ internal GalleriesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1373,20 +1444,25 @@ internal GalleriesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List galleries under a subscription. /// @@ -1399,13 +1475,13 @@ internal GalleriesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1414,51 +1490,54 @@ internal GalleriesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1470,55 +1549,56 @@ internal GalleriesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1528,9 +1608,10 @@ internal GalleriesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1541,25 +1622,29 @@ internal GalleriesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List galleries under a resource group. /// @@ -1572,13 +1657,13 @@ internal GalleriesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1587,51 +1672,54 @@ internal GalleriesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1643,55 +1731,56 @@ internal GalleriesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1701,9 +1790,10 @@ internal GalleriesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1714,24 +1804,28 @@ internal GalleriesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleriesOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleriesOperationsExtensions.cs index 5676e56f2842..0d747147af2b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleriesOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleriesOperationsExtensions.cs @@ -1,469 +1,421 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for GalleriesOperations. + /// Extension methods for GalleriesOperations /// public static partial class GalleriesOperationsExtensions { - /// - /// List galleries under a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IGalleriesOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// List galleries under a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IGalleriesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List galleries under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage ListByResourceGroup(this IGalleriesOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// List galleries under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IGalleriesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves information about a Shared Image Gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The select expression to apply on the operation. Possible values include: - /// 'Permissions' - /// - /// - /// The expand query option to apply on the operation. Possible values include: - /// 'SharingProfile/Groups' - /// - public static Gallery Get(this IGalleriesOperations operations, string resourceGroupName, string galleryName, string select = default(string), string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, galleryName, select, expand).GetAwaiter().GetResult(); - } - - /// - /// Retrieves information about a Shared Image Gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The select expression to apply on the operation. Possible values include: - /// 'Permissions' - /// - /// - /// The expand query option to apply on the operation. Possible values include: - /// 'SharingProfile/Groups' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IGalleriesOperations operations, string resourceGroupName, string galleryName, string select = default(string), string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, galleryName, select, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update a Shared Image Gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// Parameters supplied to the create or update Shared Image Gallery operation. - /// - public static Gallery CreateOrUpdate(this IGalleriesOperations operations, string resourceGroupName, string galleryName, Gallery gallery) - { - return operations.CreateOrUpdateAsync(resourceGroupName, galleryName, gallery).GetAwaiter().GetResult(); - } - - /// - /// Create or update a Shared Image Gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// Parameters supplied to the create or update Shared Image Gallery operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IGalleriesOperations operations, string resourceGroupName, string galleryName, Gallery gallery, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, gallery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List galleries under a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IGalleriesOperations operations) + { + return ((IGalleriesOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Update a Shared Image Gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// Parameters supplied to the update Shared Image Gallery operation. - /// - public static Gallery Update(this IGalleriesOperations operations, string resourceGroupName, string galleryName, GalleryUpdate gallery) + /// + /// List galleries under a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IGalleriesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(resourceGroupName, galleryName, gallery).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// List galleries under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IGalleriesOperations operations, string resourceGroupName) + { + return ((IGalleriesOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Update a Shared Image Gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// Parameters supplied to the update Shared Image Gallery operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IGalleriesOperations operations, string resourceGroupName, string galleryName, GalleryUpdate gallery, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List galleries under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IGalleriesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, gallery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Retrieves information about a Shared Image Gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The select expression to apply on the operation. + /// + /// + /// The expand query option to apply on the operation. + /// + public static Gallery Get(this IGalleriesOperations operations, string resourceGroupName, string galleryName, string select = default(string), string expand = default(string)) + { + return ((IGalleriesOperations)operations).GetAsync(resourceGroupName, galleryName, select, expand).GetAwaiter().GetResult(); + } - /// - /// Delete a Shared Image Gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - public static void Delete(this IGalleriesOperations operations, string resourceGroupName, string galleryName) + /// + /// Retrieves information about a Shared Image Gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The select expression to apply on the operation. + /// + /// + /// The expand query option to apply on the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IGalleriesOperations operations, string resourceGroupName, string galleryName, string select = default(string), string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, galleryName, select, expand, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, galleryName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or update a Shared Image Gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + public static Gallery CreateOrUpdate(this IGalleriesOperations operations, string resourceGroupName, string galleryName, Gallery gallery) + { + return ((IGalleriesOperations)operations).CreateOrUpdateAsync(resourceGroupName, galleryName, gallery).GetAwaiter().GetResult(); + } - /// - /// Delete a Shared Image Gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IGalleriesOperations operations, string resourceGroupName, string galleryName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or update a Shared Image Gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IGalleriesOperations operations, string resourceGroupName, string galleryName, Gallery gallery, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, gallery, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Update a Shared Image Gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + public static Gallery Update(this IGalleriesOperations operations, string resourceGroupName, string galleryName, GalleryUpdate gallery) + { + return ((IGalleriesOperations)operations).UpdateAsync(resourceGroupName, galleryName, gallery).GetAwaiter().GetResult(); + } - /// - /// Create or update a Shared Image Gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// Parameters supplied to the create or update Shared Image Gallery operation. - /// - public static Gallery BeginCreateOrUpdate(this IGalleriesOperations operations, string resourceGroupName, string galleryName, Gallery gallery) + /// + /// Update a Shared Image Gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IGalleriesOperations operations, string resourceGroupName, string galleryName, GalleryUpdate gallery, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, gallery, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, galleryName, gallery).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete a Shared Image Gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + public static void Delete(this IGalleriesOperations operations, string resourceGroupName, string galleryName) + { + ((IGalleriesOperations)operations).DeleteAsync(resourceGroupName, galleryName).GetAwaiter().GetResult(); + } - /// - /// Create or update a Shared Image Gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// Parameters supplied to the create or update Shared Image Gallery operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IGalleriesOperations operations, string resourceGroupName, string galleryName, Gallery gallery, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, gallery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Delete a Shared Image Gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IGalleriesOperations operations, string resourceGroupName, string galleryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create or update a Shared Image Gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + public static Gallery BeginCreateOrUpdate(this IGalleriesOperations operations, string resourceGroupName, string galleryName, Gallery gallery) + { + return ((IGalleriesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, galleryName, gallery).GetAwaiter().GetResult(); + } - /// - /// Update a Shared Image Gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// Parameters supplied to the update Shared Image Gallery operation. - /// - public static Gallery BeginUpdate(this IGalleriesOperations operations, string resourceGroupName, string galleryName, GalleryUpdate gallery) + /// + /// Create or update a Shared Image Gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IGalleriesOperations operations, string resourceGroupName, string galleryName, Gallery gallery, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, gallery, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginUpdateAsync(resourceGroupName, galleryName, gallery).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update a Shared Image Gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + public static Gallery BeginUpdate(this IGalleriesOperations operations, string resourceGroupName, string galleryName, GalleryUpdate gallery) + { + return ((IGalleriesOperations)operations).BeginUpdateAsync(resourceGroupName, galleryName, gallery).GetAwaiter().GetResult(); + } - /// - /// Update a Shared Image Gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// Parameters supplied to the update Shared Image Gallery operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IGalleriesOperations operations, string resourceGroupName, string galleryName, GalleryUpdate gallery, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update a Shared Image Gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IGalleriesOperations operations, string resourceGroupName, string galleryName, GalleryUpdate gallery, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, gallery, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, gallery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete a Shared Image Gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + public static void BeginDelete(this IGalleriesOperations operations, string resourceGroupName, string galleryName) + { + ((IGalleriesOperations)operations).BeginDeleteAsync(resourceGroupName, galleryName).GetAwaiter().GetResult(); + } - /// - /// Delete a Shared Image Gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - public static void BeginDelete(this IGalleriesOperations operations, string resourceGroupName, string galleryName) - { - operations.BeginDeleteAsync(resourceGroupName, galleryName).GetAwaiter().GetResult(); - } + /// + /// Delete a Shared Image Gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IGalleriesOperations operations, string resourceGroupName, string galleryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List galleries under a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IGalleriesOperations operations, string nextPageLink) + { + return ((IGalleriesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Delete a Shared Image Gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IGalleriesOperations operations, string resourceGroupName, string galleryName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List galleries under a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IGalleriesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// List galleries under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IGalleriesOperations operations, string nextPageLink) + { + return ((IGalleriesOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List galleries under a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IGalleriesOperations operations, string nextPageLink) + /// + /// List galleries under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IGalleriesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// List galleries under a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IGalleriesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List galleries under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IGalleriesOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List galleries under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IGalleriesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationVersionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationVersionsOperations.cs index c3d4c8a35bf6..76a8e11d1ac3 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationVersionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationVersionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// GalleryApplicationVersionsOperations operations. /// - internal partial class GalleryApplicationVersionsOperations : IServiceOperations, IGalleryApplicationVersionsOperations + internal partial class GalleryApplicationVersionsOperations : Microsoft.Rest.IServiceOperations, IGalleryApplicationVersionsOperations { /// /// Initializes a new instance of the GalleryApplicationVersionsOperations class. @@ -36,13 +24,13 @@ internal partial class GalleryApplicationVersionsOperations : IServiceOperations /// /// Thrown when a required parameter is null /// - internal GalleryApplicationVersionsOperations(ComputeManagementClient client) + internal GalleryApplicationVersionsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,58 +71,69 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByGalleryApplicationWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByGalleryApplicationWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryApplicationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryApplicationName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryApplicationName", galleryApplicationName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryApplication", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryApplication", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryApplicationName}", System.Uri.EscapeDataString(galleryApplicationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -144,25 +143,24 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -174,55 +172,56 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -232,9 +231,10 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -245,25 +245,29 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves information about a gallery Application Version. /// @@ -280,8 +284,7 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) /// The name of the gallery Application Version to be retrieved. /// /// - /// The expand expression to apply on the operation. Possible values include: - /// 'ReplicationStatus', 'UefiSettings' + /// The expand expression to apply on the operation. /// /// /// Headers that will be added to request. @@ -289,13 +292,13 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -304,65 +307,78 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryApplicationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryApplicationName"); } + if (galleryApplicationVersionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationVersionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryApplicationVersionName"); } + + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryApplicationName", galleryApplicationName); tracingParameters.Add("galleryApplicationVersionName", galleryApplicationVersionName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryApplicationName}", System.Uri.EscapeDataString(galleryApplicationName)); _url = _url.Replace("{galleryApplicationVersionName}", System.Uri.EscapeDataString(galleryApplicationVersionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -376,25 +392,24 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -406,55 +421,56 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -464,9 +480,10 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -477,25 +494,29 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a gallery Application Version. /// @@ -516,16 +537,16 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersion galleryApplicationVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersion galleryApplicationVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -547,16 +568,16 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) /// Parameters supplied to the update gallery Application Version operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -575,16 +596,16 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) /// The name of the gallery Application Version to be retrieved. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -612,13 +633,13 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -627,73 +648,85 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersion galleryApplicationVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersion galleryApplicationVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (galleryApplicationVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryApplicationVersion"); + } + if (galleryApplicationVersion != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + galleryApplicationVersion.Validate(); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryApplicationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryApplicationName"); } + if (galleryApplicationVersionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationVersionName"); - } - if (galleryApplicationVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationVersion"); - } - if (galleryApplicationVersion != null) - { - galleryApplicationVersion.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryApplicationVersionName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryApplicationName", galleryApplicationName); tracingParameters.Add("galleryApplicationVersionName", galleryApplicationVersionName); + tracingParameters.Add("galleryApplicationVersion", galleryApplicationVersion); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryApplicationName}", System.Uri.EscapeDataString(galleryApplicationName)); _url = _url.Replace("{galleryApplicationVersionName}", System.Uri.EscapeDataString(galleryApplicationVersionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -703,25 +736,24 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -733,61 +765,62 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(galleryApplicationVersion != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(galleryApplicationVersion, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(galleryApplicationVersion, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -797,9 +830,10 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -810,16 +844,16 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -828,38 +862,42 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update a gallery Application Version. /// @@ -884,13 +922,13 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -899,69 +937,81 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (galleryApplicationVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryApplicationVersion"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryApplicationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryApplicationName"); } + if (galleryApplicationVersionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationVersionName"); - } - if (galleryApplicationVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryApplicationVersionName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryApplicationName", galleryApplicationName); tracingParameters.Add("galleryApplicationVersionName", galleryApplicationVersionName); + tracingParameters.Add("galleryApplicationVersion", galleryApplicationVersion); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryApplicationName}", System.Uri.EscapeDataString(galleryApplicationName)); _url = _url.Replace("{galleryApplicationVersionName}", System.Uri.EscapeDataString(galleryApplicationVersionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -971,25 +1021,24 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1001,61 +1050,62 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(galleryApplicationVersion != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(galleryApplicationVersion, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(galleryApplicationVersion, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1065,9 +1115,10 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1078,38 +1129,42 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete a gallery Application Version. /// @@ -1131,10 +1186,10 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1143,64 +1198,76 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryApplicationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryApplicationName"); } + if (galleryApplicationVersionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationVersionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryApplicationVersionName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryApplicationName", galleryApplicationName); tracingParameters.Add("galleryApplicationVersionName", galleryApplicationVersionName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryApplicationName}", System.Uri.EscapeDataString(galleryApplicationName)); _url = _url.Replace("{galleryApplicationVersionName}", System.Uri.EscapeDataString(galleryApplicationVersionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1210,25 +1277,24 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1240,55 +1306,56 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1298,20 +1365,25 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List gallery Application Versions in a gallery Application Definition. /// @@ -1324,13 +1396,13 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1339,51 +1411,54 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByGalleryApplicationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByGalleryApplicationNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryApplicationNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryApplicationNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1395,55 +1470,56 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1453,9 +1529,10 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1466,24 +1543,28 @@ internal GalleryApplicationVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationVersionsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationVersionsOperationsExtensions.cs index 04cc30025fb1..777ae1401ce0 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationVersionsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationVersionsOperationsExtensions.cs @@ -1,499 +1,451 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for GalleryApplicationVersionsOperations. + /// Extension methods for GalleryApplicationVersionsOperations /// public static partial class GalleryApplicationVersionsOperationsExtensions { - /// - /// List gallery Application Versions in a gallery Application Definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - public static IPage ListByGalleryApplication(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName) - { - return operations.ListByGalleryApplicationAsync(resourceGroupName, galleryName, galleryApplicationName).GetAwaiter().GetResult(); - } - - /// - /// List gallery Application Versions in a gallery Application Definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByGalleryApplicationAsync(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByGalleryApplicationWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves information about a gallery Application Version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The name of the gallery Application Version to be retrieved. - /// - /// - /// The expand expression to apply on the operation. Possible values include: - /// 'ReplicationStatus', 'UefiSettings' - /// - public static GalleryApplicationVersion Get(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand).GetAwaiter().GetResult(); - } - - /// - /// Retrieves information about a gallery Application Version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The name of the gallery Application Version to be retrieved. - /// - /// - /// The expand expression to apply on the operation. Possible values include: - /// 'ReplicationStatus', 'UefiSettings' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update a gallery Application Version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The name of the gallery Application Version to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery Application Version - /// operation. - /// - public static GalleryApplicationVersion CreateOrUpdate(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersion galleryApplicationVersion) - { - return operations.CreateOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion).GetAwaiter().GetResult(); - } - - /// - /// Create or update a gallery Application Version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The name of the gallery Application Version to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery Application Version - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersion galleryApplicationVersion, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a gallery Application Version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The name of the gallery Application Version to be retrieved. - /// - /// - /// Parameters supplied to the update gallery Application Version operation. - /// - public static GalleryApplicationVersion Update(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion) - { - return operations.UpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion).GetAwaiter().GetResult(); - } - - /// - /// Update a gallery Application Version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The name of the gallery Application Version to be retrieved. - /// - /// - /// Parameters supplied to the update gallery Application Version operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List gallery Application Versions in a gallery Application Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + public static Microsoft.Rest.Azure.IPage ListByGalleryApplication(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName) + { + return ((IGalleryApplicationVersionsOperations)operations).ListByGalleryApplicationAsync(resourceGroupName, galleryName, galleryApplicationName).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery Application Version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The name of the gallery Application Version to be retrieved. - /// - public static void Delete(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName) + /// + /// List gallery Application Versions in a gallery Application Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByGalleryApplicationAsync(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByGalleryApplicationWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves information about a gallery Application Version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The name of the gallery Application Version to be retrieved. + /// + /// + /// The expand expression to apply on the operation. + /// + public static GalleryApplicationVersion Get(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, string expand = default(string)) + { + return ((IGalleryApplicationVersionsOperations)operations).GetAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery Application Version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The name of the gallery Application Version to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves information about a gallery Application Version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The name of the gallery Application Version to be retrieved. + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Create or update a gallery Application Version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The name of the gallery Application Version to be retrieved. + /// + public static GalleryApplicationVersion CreateOrUpdate(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersion galleryApplicationVersion) + { + return ((IGalleryApplicationVersionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion).GetAwaiter().GetResult(); + } - /// - /// Create or update a gallery Application Version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The name of the gallery Application Version to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery Application Version - /// operation. - /// - public static GalleryApplicationVersion BeginCreateOrUpdate(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersion galleryApplicationVersion) + /// + /// Create or update a gallery Application Version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The name of the gallery Application Version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersion galleryApplicationVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update a gallery Application Version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The name of the gallery Application Version to be retrieved. + /// + public static GalleryApplicationVersion Update(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion) + { + return ((IGalleryApplicationVersionsOperations)operations).UpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion).GetAwaiter().GetResult(); + } - /// - /// Create or update a gallery Application Version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The name of the gallery Application Version to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery Application Version - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersion galleryApplicationVersion, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update a gallery Application Version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The name of the gallery Application Version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete a gallery Application Version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The name of the gallery Application Version to be retrieved. + /// + public static void Delete(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName) + { + ((IGalleryApplicationVersionsOperations)operations).DeleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName).GetAwaiter().GetResult(); + } - /// - /// Update a gallery Application Version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The name of the gallery Application Version to be retrieved. - /// - /// - /// Parameters supplied to the update gallery Application Version operation. - /// - public static GalleryApplicationVersion BeginUpdate(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion) - { - return operations.BeginUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion).GetAwaiter().GetResult(); - } - - /// - /// Update a gallery Application Version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The name of the gallery Application Version to be retrieved. - /// - /// - /// Parameters supplied to the update gallery Application Version operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Delete a gallery Application Version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The name of the gallery Application Version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create or update a gallery Application Version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The name of the gallery Application Version to be retrieved. + /// + public static GalleryApplicationVersion BeginCreateOrUpdate(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersion galleryApplicationVersion) + { + return ((IGalleryApplicationVersionsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery Application Version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The name of the gallery Application Version to be retrieved. - /// - public static void BeginDelete(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName) + /// + /// Create or update a gallery Application Version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The name of the gallery Application Version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersion galleryApplicationVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update a gallery Application Version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The name of the gallery Application Version to be retrieved. + /// + public static GalleryApplicationVersion BeginUpdate(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion) + { + return ((IGalleryApplicationVersionsOperations)operations).BeginUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery Application Version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The name of the gallery Application Version to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update a gallery Application Version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The name of the gallery Application Version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Delete a gallery Application Version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The name of the gallery Application Version to be retrieved. + /// + public static void BeginDelete(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName) + { + ((IGalleryApplicationVersionsOperations)operations).BeginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName).GetAwaiter().GetResult(); + } - /// - /// List gallery Application Versions in a gallery Application Definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByGalleryApplicationNext(this IGalleryApplicationVersionsOperations operations, string nextPageLink) - { - return operations.ListByGalleryApplicationNextAsync(nextPageLink).GetAwaiter().GetResult(); - } + /// + /// Delete a gallery Application Version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The name of the gallery Application Version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IGalleryApplicationVersionsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List gallery Application Versions in a gallery Application Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByGalleryApplicationNext(this IGalleryApplicationVersionsOperations operations, string nextPageLink) + { + return ((IGalleryApplicationVersionsOperations)operations).ListByGalleryApplicationNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List gallery Application Versions in a gallery Application Definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByGalleryApplicationNextAsync(this IGalleryApplicationVersionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List gallery Application Versions in a gallery Application Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByGalleryApplicationNextAsync(this IGalleryApplicationVersionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByGalleryApplicationNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByGalleryApplicationNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationsOperations.cs index 11f810fb4865..1d9399138fbe 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// GalleryApplicationsOperations operations. /// - internal partial class GalleryApplicationsOperations : IServiceOperations, IGalleryApplicationsOperations + internal partial class GalleryApplicationsOperations : Microsoft.Rest.IServiceOperations, IGalleryApplicationsOperations { /// /// Initializes a new instance of the GalleryApplicationsOperations class. @@ -36,13 +24,13 @@ internal partial class GalleryApplicationsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal GalleryApplicationsOperations(ComputeManagementClient client) + internal GalleryApplicationsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,52 +68,62 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByGalleryWithHttpMessagesAsync(string resourceGroupName, string galleryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByGalleryWithHttpMessagesAsync(string resourceGroupName, string galleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByGallery", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByGallery", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -135,25 +133,24 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -165,55 +162,56 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -223,9 +221,10 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -236,25 +235,29 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves information about a gallery Application Definition. /// @@ -273,13 +276,13 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -288,58 +291,69 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryApplicationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryApplicationName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryApplicationName", galleryApplicationName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryApplicationName}", System.Uri.EscapeDataString(galleryApplicationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -349,25 +363,24 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -379,55 +392,56 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -437,9 +451,10 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -450,25 +465,29 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a gallery Application Definition. /// @@ -485,16 +504,16 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) /// Parameters supplied to the create or update gallery Application operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplication galleryApplication, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplication galleryApplication, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -513,16 +532,16 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) /// Parameters supplied to the update gallery Application operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplicationUpdate galleryApplication, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplicationUpdate galleryApplication, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -538,16 +557,16 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) /// The name of the gallery Application Definition to be retrieved. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -571,13 +590,13 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -586,67 +605,78 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplication galleryApplication, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplication galleryApplication, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (galleryApplication == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryApplication"); } + if (galleryApplication != null) + { + galleryApplication.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryApplicationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationName"); - } - if (galleryApplication == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplication"); - } - if (galleryApplication != null) - { - galleryApplication.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryApplicationName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryApplicationName", galleryApplicationName); + tracingParameters.Add("galleryApplication", galleryApplication); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryApplicationName}", System.Uri.EscapeDataString(galleryApplicationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -656,25 +686,24 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -686,61 +715,62 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(galleryApplication != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(galleryApplication, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(galleryApplication, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -750,9 +780,10 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -763,16 +794,16 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -781,38 +812,42 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update a gallery Application Definition. /// @@ -834,13 +869,13 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -849,63 +884,74 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplicationUpdate galleryApplication, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplicationUpdate galleryApplication, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (galleryApplication == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryApplication"); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryApplicationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationName"); - } - if (galleryApplication == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplication"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryApplicationName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryApplicationName", galleryApplicationName); + tracingParameters.Add("galleryApplication", galleryApplication); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryApplicationName}", System.Uri.EscapeDataString(galleryApplicationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -915,25 +961,24 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -945,61 +990,62 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(galleryApplication != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(galleryApplication, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(galleryApplication, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1009,9 +1055,10 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1022,38 +1069,42 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete a gallery Application. /// @@ -1072,10 +1123,10 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1084,58 +1135,69 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryApplicationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryApplicationName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryApplicationName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryApplicationName", galleryApplicationName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryApplicationName}", System.Uri.EscapeDataString(galleryApplicationName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1145,25 +1207,24 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1175,55 +1236,56 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1233,20 +1295,25 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List gallery Application Definitions in a gallery. /// @@ -1259,13 +1326,13 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1274,51 +1341,54 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByGalleryNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByGalleryNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1330,55 +1400,56 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1388,9 +1459,10 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1401,24 +1473,28 @@ internal GalleryApplicationsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationsOperationsExtensions.cs index ee2a7e1287d8..7699163e36d0 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryApplicationsOperationsExtensions.cs @@ -1,439 +1,397 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for GalleryApplicationsOperations. + /// Extension methods for GalleryApplicationsOperations /// public static partial class GalleryApplicationsOperationsExtensions { - /// - /// List gallery Application Definitions in a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - public static IPage ListByGallery(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName) - { - return operations.ListByGalleryAsync(resourceGroupName, galleryName).GetAwaiter().GetResult(); - } - - /// - /// List gallery Application Definitions in a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByGalleryAsync(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByGalleryWithHttpMessagesAsync(resourceGroupName, galleryName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves information about a gallery Application Definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - public static GalleryApplication Get(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName) - { - return operations.GetAsync(resourceGroupName, galleryName, galleryApplicationName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves information about a gallery Application Definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update a gallery Application Definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery Application operation. - /// - public static GalleryApplication CreateOrUpdate(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplication galleryApplication) - { - return operations.CreateOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication).GetAwaiter().GetResult(); - } - - /// - /// Create or update a gallery Application Definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery Application operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplication galleryApplication, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a gallery Application Definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// Parameters supplied to the update gallery Application operation. - /// - public static GalleryApplication Update(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplicationUpdate galleryApplication) - { - return operations.UpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication).GetAwaiter().GetResult(); - } - - /// - /// Update a gallery Application Definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// Parameters supplied to the update gallery Application operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplicationUpdate galleryApplication, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List gallery Application Definitions in a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + public static Microsoft.Rest.Azure.IPage ListByGallery(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName) + { + return ((IGalleryApplicationsOperations)operations).ListByGalleryAsync(resourceGroupName, galleryName).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery Application. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - public static void Delete(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName) + /// + /// List gallery Application Definitions in a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByGalleryAsync(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByGalleryWithHttpMessagesAsync(resourceGroupName, galleryName, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, galleryName, galleryApplicationName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves information about a gallery Application Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + public static GalleryApplication Get(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName) + { + return ((IGalleryApplicationsOperations)operations).GetAsync(resourceGroupName, galleryName, galleryApplicationName).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery Application. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves information about a gallery Application Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Create or update a gallery Application Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + public static GalleryApplication CreateOrUpdate(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplication galleryApplication) + { + return ((IGalleryApplicationsOperations)operations).CreateOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication).GetAwaiter().GetResult(); + } - /// - /// Create or update a gallery Application Definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery Application operation. - /// - public static GalleryApplication BeginCreateOrUpdate(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplication galleryApplication) + /// + /// Create or update a gallery Application Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplication galleryApplication, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update a gallery Application Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + public static GalleryApplication Update(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplicationUpdate galleryApplication) + { + return ((IGalleryApplicationsOperations)operations).UpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication).GetAwaiter().GetResult(); + } - /// - /// Create or update a gallery Application Definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery Application operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplication galleryApplication, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update a gallery Application Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplicationUpdate galleryApplication, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete a gallery Application. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + public static void Delete(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName) + { + ((IGalleryApplicationsOperations)operations).DeleteAsync(resourceGroupName, galleryName, galleryApplicationName).GetAwaiter().GetResult(); + } - /// - /// Update a gallery Application Definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// Parameters supplied to the update gallery Application operation. - /// - public static GalleryApplication BeginUpdate(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplicationUpdate galleryApplication) - { - return operations.BeginUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication).GetAwaiter().GetResult(); - } - - /// - /// Update a gallery Application Definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// Parameters supplied to the update gallery Application operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplicationUpdate galleryApplication, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Delete a gallery Application. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create or update a gallery Application Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + public static GalleryApplication BeginCreateOrUpdate(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplication galleryApplication) + { + return ((IGalleryApplicationsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery Application. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - public static void BeginDelete(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName) + /// + /// Create or update a gallery Application Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplication galleryApplication, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update a gallery Application Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + public static GalleryApplication BeginUpdate(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplicationUpdate galleryApplication) + { + return ((IGalleryApplicationsOperations)operations).BeginUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery Application. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery Application Definition to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update a gallery Application Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplicationUpdate galleryApplication, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Delete a gallery Application. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + public static void BeginDelete(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName) + { + ((IGalleryApplicationsOperations)operations).BeginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName).GetAwaiter().GetResult(); + } - /// - /// List gallery Application Definitions in a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByGalleryNext(this IGalleryApplicationsOperations operations, string nextPageLink) - { - return operations.ListByGalleryNextAsync(nextPageLink).GetAwaiter().GetResult(); - } + /// + /// Delete a gallery Application. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery Application Definition to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IGalleryApplicationsOperations operations, string resourceGroupName, string galleryName, string galleryApplicationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryApplicationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List gallery Application Definitions in a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByGalleryNext(this IGalleryApplicationsOperations operations, string nextPageLink) + { + return ((IGalleryApplicationsOperations)operations).ListByGalleryNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List gallery Application Definitions in a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByGalleryNextAsync(this IGalleryApplicationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List gallery Application Definitions in a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByGalleryNextAsync(this IGalleryApplicationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByGalleryNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByGalleryNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryImageVersionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryImageVersionsOperations.cs index 8933ad31cac2..3f23395c89ec 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleryImageVersionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryImageVersionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// GalleryImageVersionsOperations operations. /// - internal partial class GalleryImageVersionsOperations : IServiceOperations, IGalleryImageVersionsOperations + internal partial class GalleryImageVersionsOperations : Microsoft.Rest.IServiceOperations, IGalleryImageVersionsOperations { /// /// Initializes a new instance of the GalleryImageVersionsOperations class. @@ -36,13 +24,13 @@ internal partial class GalleryImageVersionsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal GalleryImageVersionsOperations(ComputeManagementClient client) + internal GalleryImageVersionsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,58 +71,69 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByGalleryImageWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByGalleryImageWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryImageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryImageName", galleryImageName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryImage", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryImage", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryImageName}", System.Uri.EscapeDataString(galleryImageName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -144,25 +143,24 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -174,55 +172,56 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -232,9 +231,10 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -245,25 +245,29 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves information about a gallery image version. /// @@ -280,8 +284,7 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) /// The name of the gallery image version to be retrieved. /// /// - /// The expand expression to apply on the operation. Possible values include: - /// 'ReplicationStatus', 'UefiSettings' + /// The expand expression to apply on the operation. /// /// /// Headers that will be added to request. @@ -289,13 +292,13 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -304,65 +307,78 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryImageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } + if (galleryImageVersionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageVersionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageVersionName"); } + + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryImageName", galleryImageName); tracingParameters.Add("galleryImageVersionName", galleryImageVersionName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryImageName}", System.Uri.EscapeDataString(galleryImageName)); _url = _url.Replace("{galleryImageVersionName}", System.Uri.EscapeDataString(galleryImageVersionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -376,25 +392,24 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -406,55 +421,56 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -464,9 +480,10 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -477,25 +494,29 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a gallery image version. /// @@ -516,16 +537,16 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersion galleryImageVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersion galleryImageVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -547,16 +568,16 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) /// Parameters supplied to the update gallery image version operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -575,16 +596,16 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) /// The name of the gallery image version to be retrieved. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -612,13 +633,13 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -627,73 +648,85 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersion galleryImageVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersion galleryImageVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (galleryImageVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageVersion"); + } + if (galleryImageVersion != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + galleryImageVersion.Validate(); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryImageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } + if (galleryImageVersionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageVersionName"); - } - if (galleryImageVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageVersion"); - } - if (galleryImageVersion != null) - { - galleryImageVersion.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageVersionName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryImageName", galleryImageName); tracingParameters.Add("galleryImageVersionName", galleryImageVersionName); + tracingParameters.Add("galleryImageVersion", galleryImageVersion); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryImageName}", System.Uri.EscapeDataString(galleryImageName)); _url = _url.Replace("{galleryImageVersionName}", System.Uri.EscapeDataString(galleryImageVersionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -703,25 +736,24 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -733,61 +765,62 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(galleryImageVersion != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(galleryImageVersion, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(galleryImageVersion, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -797,9 +830,10 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -810,16 +844,16 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -828,38 +862,42 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update a gallery image version. /// @@ -884,13 +922,13 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -899,69 +937,81 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (galleryImageVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageVersion"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryImageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } + if (galleryImageVersionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageVersionName"); - } - if (galleryImageVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageVersionName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryImageName", galleryImageName); tracingParameters.Add("galleryImageVersionName", galleryImageVersionName); + tracingParameters.Add("galleryImageVersion", galleryImageVersion); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryImageName}", System.Uri.EscapeDataString(galleryImageName)); _url = _url.Replace("{galleryImageVersionName}", System.Uri.EscapeDataString(galleryImageVersionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -971,25 +1021,24 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1001,61 +1050,62 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(galleryImageVersion != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(galleryImageVersion, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(galleryImageVersion, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1065,9 +1115,10 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1078,38 +1129,42 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete a gallery image version. /// @@ -1131,10 +1186,10 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1143,64 +1198,76 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryImageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } + if (galleryImageVersionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageVersionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageVersionName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryImageName", galleryImageName); tracingParameters.Add("galleryImageVersionName", galleryImageVersionName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryImageName}", System.Uri.EscapeDataString(galleryImageName)); _url = _url.Replace("{galleryImageVersionName}", System.Uri.EscapeDataString(galleryImageVersionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1210,25 +1277,24 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1240,55 +1306,56 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1298,20 +1365,25 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List gallery image versions in a gallery image definition. /// @@ -1324,13 +1396,13 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1339,51 +1411,54 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByGalleryImageNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByGalleryImageNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryImageNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryImageNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1395,55 +1470,56 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1453,9 +1529,10 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1466,24 +1543,28 @@ internal GalleryImageVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryImageVersionsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryImageVersionsOperationsExtensions.cs index 19fe052490ea..c3b5d5fb6af2 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleryImageVersionsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryImageVersionsOperationsExtensions.cs @@ -1,499 +1,451 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for GalleryImageVersionsOperations. + /// Extension methods for GalleryImageVersionsOperations /// public static partial class GalleryImageVersionsOperationsExtensions { - /// - /// List gallery image versions in a gallery image definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - public static IPage ListByGalleryImage(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName) - { - return operations.ListByGalleryImageAsync(resourceGroupName, galleryName, galleryImageName).GetAwaiter().GetResult(); - } - - /// - /// List gallery image versions in a gallery image definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByGalleryImageAsync(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByGalleryImageWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves information about a gallery image version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The name of the gallery image version to be retrieved. - /// - /// - /// The expand expression to apply on the operation. Possible values include: - /// 'ReplicationStatus', 'UefiSettings' - /// - public static GalleryImageVersion Get(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand).GetAwaiter().GetResult(); - } - - /// - /// Retrieves information about a gallery image version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The name of the gallery image version to be retrieved. - /// - /// - /// The expand expression to apply on the operation. Possible values include: - /// 'ReplicationStatus', 'UefiSettings' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update a gallery image version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The name of the gallery image version to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery image version - /// operation. - /// - public static GalleryImageVersion CreateOrUpdate(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersion galleryImageVersion) - { - return operations.CreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion).GetAwaiter().GetResult(); - } - - /// - /// Create or update a gallery image version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The name of the gallery image version to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery image version - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersion galleryImageVersion, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a gallery image version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The name of the gallery image version to be retrieved. - /// - /// - /// Parameters supplied to the update gallery image version operation. - /// - public static GalleryImageVersion Update(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion) - { - return operations.UpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion).GetAwaiter().GetResult(); - } - - /// - /// Update a gallery image version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The name of the gallery image version to be retrieved. - /// - /// - /// Parameters supplied to the update gallery image version operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List gallery image versions in a gallery image definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + public static Microsoft.Rest.Azure.IPage ListByGalleryImage(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName) + { + return ((IGalleryImageVersionsOperations)operations).ListByGalleryImageAsync(resourceGroupName, galleryName, galleryImageName).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery image version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The name of the gallery image version to be retrieved. - /// - public static void Delete(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName) + /// + /// List gallery image versions in a gallery image definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByGalleryImageAsync(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByGalleryImageWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves information about a gallery image version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The name of the gallery image version to be retrieved. + /// + /// + /// The expand expression to apply on the operation. + /// + public static GalleryImageVersion Get(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, string expand = default(string)) + { + return ((IGalleryImageVersionsOperations)operations).GetAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery image version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The name of the gallery image version to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves information about a gallery image version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The name of the gallery image version to be retrieved. + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Create or update a gallery image version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The name of the gallery image version to be retrieved. + /// + public static GalleryImageVersion CreateOrUpdate(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersion galleryImageVersion) + { + return ((IGalleryImageVersionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion).GetAwaiter().GetResult(); + } - /// - /// Create or update a gallery image version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The name of the gallery image version to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery image version - /// operation. - /// - public static GalleryImageVersion BeginCreateOrUpdate(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersion galleryImageVersion) + /// + /// Create or update a gallery image version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The name of the gallery image version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersion galleryImageVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update a gallery image version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The name of the gallery image version to be retrieved. + /// + public static GalleryImageVersion Update(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion) + { + return ((IGalleryImageVersionsOperations)operations).UpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion).GetAwaiter().GetResult(); + } - /// - /// Create or update a gallery image version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The name of the gallery image version to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery image version - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersion galleryImageVersion, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update a gallery image version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The name of the gallery image version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete a gallery image version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The name of the gallery image version to be retrieved. + /// + public static void Delete(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName) + { + ((IGalleryImageVersionsOperations)operations).DeleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName).GetAwaiter().GetResult(); + } - /// - /// Update a gallery image version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The name of the gallery image version to be retrieved. - /// - /// - /// Parameters supplied to the update gallery image version operation. - /// - public static GalleryImageVersion BeginUpdate(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion) - { - return operations.BeginUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion).GetAwaiter().GetResult(); - } - - /// - /// Update a gallery image version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The name of the gallery image version to be retrieved. - /// - /// - /// Parameters supplied to the update gallery image version operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Delete a gallery image version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The name of the gallery image version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create or update a gallery image version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The name of the gallery image version to be retrieved. + /// + public static GalleryImageVersion BeginCreateOrUpdate(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersion galleryImageVersion) + { + return ((IGalleryImageVersionsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery image version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The name of the gallery image version to be retrieved. - /// - public static void BeginDelete(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName) + /// + /// Create or update a gallery image version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The name of the gallery image version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersion galleryImageVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update a gallery image version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The name of the gallery image version to be retrieved. + /// + public static GalleryImageVersion BeginUpdate(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion) + { + return ((IGalleryImageVersionsOperations)operations).BeginUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery image version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The name of the gallery image version to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update a gallery image version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The name of the gallery image version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Delete a gallery image version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The name of the gallery image version to be retrieved. + /// + public static void BeginDelete(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName) + { + ((IGalleryImageVersionsOperations)operations).BeginDeleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName).GetAwaiter().GetResult(); + } - /// - /// List gallery image versions in a gallery image definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByGalleryImageNext(this IGalleryImageVersionsOperations operations, string nextPageLink) - { - return operations.ListByGalleryImageNextAsync(nextPageLink).GetAwaiter().GetResult(); - } + /// + /// Delete a gallery image version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The name of the gallery image version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IGalleryImageVersionsOperations operations, string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List gallery image versions in a gallery image definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByGalleryImageNext(this IGalleryImageVersionsOperations operations, string nextPageLink) + { + return ((IGalleryImageVersionsOperations)operations).ListByGalleryImageNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List gallery image versions in a gallery image definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByGalleryImageNextAsync(this IGalleryImageVersionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List gallery image versions in a gallery image definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByGalleryImageNextAsync(this IGalleryImageVersionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByGalleryImageNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByGalleryImageNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryImagesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryImagesOperations.cs index f5f797b41b58..ec6ce79938df 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleryImagesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryImagesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// GalleryImagesOperations operations. /// - internal partial class GalleryImagesOperations : IServiceOperations, IGalleryImagesOperations + internal partial class GalleryImagesOperations : Microsoft.Rest.IServiceOperations, IGalleryImagesOperations { /// /// Initializes a new instance of the GalleryImagesOperations class. @@ -36,13 +24,13 @@ internal partial class GalleryImagesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal GalleryImagesOperations(ComputeManagementClient client) + internal GalleryImagesOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal GalleryImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,52 +68,62 @@ internal GalleryImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByGalleryWithHttpMessagesAsync(string resourceGroupName, string galleryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByGalleryWithHttpMessagesAsync(string resourceGroupName, string galleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByGallery", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByGallery", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -135,25 +133,24 @@ internal GalleryImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -165,55 +162,56 @@ internal GalleryImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -223,9 +221,10 @@ internal GalleryImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -236,25 +235,29 @@ internal GalleryImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves information about a gallery image definition. /// @@ -273,13 +276,13 @@ internal GalleryImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -288,58 +291,69 @@ internal GalleryImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryImageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryImageName", galleryImageName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryImageName}", System.Uri.EscapeDataString(galleryImageName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -349,25 +363,24 @@ internal GalleryImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -379,55 +392,56 @@ internal GalleryImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -437,9 +451,10 @@ internal GalleryImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -450,25 +465,29 @@ internal GalleryImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a gallery image definition. /// @@ -485,16 +504,16 @@ internal GalleryImagesOperations(ComputeManagementClient client) /// Parameters supplied to the create or update gallery image operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, GalleryImage galleryImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, GalleryImage galleryImage, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -513,16 +532,16 @@ internal GalleryImagesOperations(ComputeManagementClient client) /// Parameters supplied to the update gallery image operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, GalleryImageUpdate galleryImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, GalleryImageUpdate galleryImage, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -538,16 +557,16 @@ internal GalleryImagesOperations(ComputeManagementClient client) /// The name of the gallery image definition to be retrieved. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -571,13 +590,13 @@ internal GalleryImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -586,67 +605,78 @@ internal GalleryImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, GalleryImage galleryImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, GalleryImage galleryImage, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (galleryImage == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImage"); } + if (galleryImage != null) + { + galleryImage.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryImageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); - } - if (galleryImage == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImage"); - } - if (galleryImage != null) - { - galleryImage.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryImageName", galleryImageName); + tracingParameters.Add("galleryImage", galleryImage); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryImageName}", System.Uri.EscapeDataString(galleryImageName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -656,25 +686,24 @@ internal GalleryImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -686,61 +715,62 @@ internal GalleryImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(galleryImage != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(galleryImage, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(galleryImage, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -750,9 +780,10 @@ internal GalleryImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -763,16 +794,16 @@ internal GalleryImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -781,38 +812,42 @@ internal GalleryImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update a gallery image definition. /// @@ -834,13 +869,13 @@ internal GalleryImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -849,63 +884,74 @@ internal GalleryImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, GalleryImageUpdate galleryImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, GalleryImageUpdate galleryImage, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (galleryImage == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImage"); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryImageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); - } - if (galleryImage == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImage"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryImageName", galleryImageName); + tracingParameters.Add("galleryImage", galleryImage); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryImageName}", System.Uri.EscapeDataString(galleryImageName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -915,25 +961,24 @@ internal GalleryImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -945,61 +990,62 @@ internal GalleryImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(galleryImage != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(galleryImage, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(galleryImage, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1009,9 +1055,10 @@ internal GalleryImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1022,38 +1069,42 @@ internal GalleryImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete a gallery image. /// @@ -1072,10 +1123,10 @@ internal GalleryImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1084,58 +1135,69 @@ internal GalleryImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (galleryImageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("galleryImageName", galleryImageName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{galleryImageName}", System.Uri.EscapeDataString(galleryImageName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1145,25 +1207,24 @@ internal GalleryImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1175,55 +1236,56 @@ internal GalleryImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1233,20 +1295,25 @@ internal GalleryImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List gallery image definitions in a gallery. /// @@ -1259,13 +1326,13 @@ internal GalleryImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1274,51 +1341,54 @@ internal GalleryImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByGalleryNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByGalleryNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1330,55 +1400,56 @@ internal GalleryImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1388,9 +1459,10 @@ internal GalleryImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1401,24 +1473,28 @@ internal GalleryImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryImagesOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryImagesOperationsExtensions.cs index f8adcb02bfdb..1c50eda9e0f3 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleryImagesOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryImagesOperationsExtensions.cs @@ -1,439 +1,397 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for GalleryImagesOperations. + /// Extension methods for GalleryImagesOperations /// public static partial class GalleryImagesOperationsExtensions { - /// - /// List gallery image definitions in a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - public static IPage ListByGallery(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName) - { - return operations.ListByGalleryAsync(resourceGroupName, galleryName).GetAwaiter().GetResult(); - } - - /// - /// List gallery image definitions in a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByGalleryAsync(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByGalleryWithHttpMessagesAsync(resourceGroupName, galleryName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves information about a gallery image definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - public static GalleryImage Get(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName) - { - return operations.GetAsync(resourceGroupName, galleryName, galleryImageName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves information about a gallery image definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update a gallery image definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery image operation. - /// - public static GalleryImage CreateOrUpdate(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, GalleryImage galleryImage) - { - return operations.CreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).GetAwaiter().GetResult(); - } - - /// - /// Create or update a gallery image definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery image operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, GalleryImage galleryImage, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a gallery image definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// Parameters supplied to the update gallery image operation. - /// - public static GalleryImage Update(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, GalleryImageUpdate galleryImage) - { - return operations.UpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).GetAwaiter().GetResult(); - } - - /// - /// Update a gallery image definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// Parameters supplied to the update gallery image operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, GalleryImageUpdate galleryImage, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List gallery image definitions in a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + public static Microsoft.Rest.Azure.IPage ListByGallery(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName) + { + return ((IGalleryImagesOperations)operations).ListByGalleryAsync(resourceGroupName, galleryName).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - public static void Delete(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName) + /// + /// List gallery image definitions in a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByGalleryAsync(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByGalleryWithHttpMessagesAsync(resourceGroupName, galleryName, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, galleryName, galleryImageName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves information about a gallery image definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + public static GalleryImage Get(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName) + { + return ((IGalleryImagesOperations)operations).GetAsync(resourceGroupName, galleryName, galleryImageName).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves information about a gallery image definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Create or update a gallery image definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + public static GalleryImage CreateOrUpdate(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, GalleryImage galleryImage) + { + return ((IGalleryImagesOperations)operations).CreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).GetAwaiter().GetResult(); + } - /// - /// Create or update a gallery image definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery image operation. - /// - public static GalleryImage BeginCreateOrUpdate(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, GalleryImage galleryImage) + /// + /// Create or update a gallery image definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, GalleryImage galleryImage, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update a gallery image definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + public static GalleryImage Update(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, GalleryImageUpdate galleryImage) + { + return ((IGalleryImagesOperations)operations).UpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).GetAwaiter().GetResult(); + } - /// - /// Create or update a gallery image definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery image operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, GalleryImage galleryImage, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update a gallery image definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, GalleryImageUpdate galleryImage, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete a gallery image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + public static void Delete(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName) + { + ((IGalleryImagesOperations)operations).DeleteAsync(resourceGroupName, galleryName, galleryImageName).GetAwaiter().GetResult(); + } - /// - /// Update a gallery image definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// Parameters supplied to the update gallery image operation. - /// - public static GalleryImage BeginUpdate(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, GalleryImageUpdate galleryImage) - { - return operations.BeginUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).GetAwaiter().GetResult(); - } - - /// - /// Update a gallery image definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// Parameters supplied to the update gallery image operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, GalleryImageUpdate galleryImage, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Delete a gallery image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create or update a gallery image definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + public static GalleryImage BeginCreateOrUpdate(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, GalleryImage galleryImage) + { + return ((IGalleryImagesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - public static void BeginDelete(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName) + /// + /// Create or update a gallery image definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, GalleryImage galleryImage, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, galleryName, galleryImageName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update a gallery image definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + public static GalleryImage BeginUpdate(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, GalleryImageUpdate galleryImage) + { + return ((IGalleryImagesOperations)operations).BeginUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery image definition to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update a gallery image definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, GalleryImageUpdate galleryImage, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Delete a gallery image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + public static void BeginDelete(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName) + { + ((IGalleryImagesOperations)operations).BeginDeleteAsync(resourceGroupName, galleryName, galleryImageName).GetAwaiter().GetResult(); + } - /// - /// List gallery image definitions in a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByGalleryNext(this IGalleryImagesOperations operations, string nextPageLink) - { - return operations.ListByGalleryNextAsync(nextPageLink).GetAwaiter().GetResult(); - } + /// + /// Delete a gallery image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery image definition to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IGalleryImagesOperations operations, string resourceGroupName, string galleryName, string galleryImageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, galleryImageName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List gallery image definitions in a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByGalleryNext(this IGalleryImagesOperations operations, string nextPageLink) + { + return ((IGalleryImagesOperations)operations).ListByGalleryNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List gallery image definitions in a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByGalleryNextAsync(this IGalleryImagesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List gallery image definitions in a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByGalleryNextAsync(this IGalleryImagesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByGalleryNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByGalleryNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfileVersionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfileVersionsOperations.cs index f32a07178926..1ca6f3bca8b6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfileVersionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfileVersionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// GalleryInVMAccessControlProfileVersionsOperations operations. /// - internal partial class GalleryInVMAccessControlProfileVersionsOperations : IServiceOperations, IGalleryInVMAccessControlProfileVersionsOperations + internal partial class GalleryInVMAccessControlProfileVersionsOperations : Microsoft.Rest.IServiceOperations, IGalleryInVMAccessControlProfileVersionsOperations { /// /// Initializes a new instance of the GalleryInVMAccessControlProfileVersionsOperations class. @@ -36,13 +24,13 @@ internal partial class GalleryInVMAccessControlProfileVersionsOperations : IServ /// /// Thrown when a required parameter is null /// - internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClient client) + internal GalleryInVMAccessControlProfileVersionsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -69,13 +57,13 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -84,58 +72,69 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie /// /// A response object containing the response body and response headers. /// - public async Task>> ListByGalleryInVMAccessControlProfileWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByGalleryInVMAccessControlProfileWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (inVMAccessControlProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryInVMAccessControlProfile", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryInVMAccessControlProfile", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -145,25 +144,24 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -175,55 +173,56 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -233,9 +232,10 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -246,25 +246,29 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves information about a gallery inVMAccessControlProfile version. /// @@ -286,13 +290,13 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -301,64 +305,76 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (inVMAccessControlProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); } + if (inVMAccessControlProfileVersionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileVersionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "inVMAccessControlProfileVersionName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); tracingParameters.Add("inVMAccessControlProfileVersionName", inVMAccessControlProfileVersionName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); _url = _url.Replace("{inVMAccessControlProfileVersionName}", System.Uri.EscapeDataString(inVMAccessControlProfileVersionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -368,25 +384,24 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -398,55 +413,56 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -456,9 +472,10 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -469,25 +486,29 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a gallery inVMAccessControlProfile version. /// @@ -508,16 +529,16 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie /// inVMAccessControlProfile version operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -540,16 +561,16 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -568,16 +589,16 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie /// The name of the gallery inVMAccessControlProfile version to be retrieved. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -605,13 +626,13 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -620,73 +641,85 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (galleryInVMAccessControlProfileVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryInVMAccessControlProfileVersion"); + } + if (galleryInVMAccessControlProfileVersion != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + galleryInVMAccessControlProfileVersion.Validate(); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (inVMAccessControlProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); } + if (inVMAccessControlProfileVersionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileVersionName"); - } - if (galleryInVMAccessControlProfileVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryInVMAccessControlProfileVersion"); - } - if (galleryInVMAccessControlProfileVersion != null) - { - galleryInVMAccessControlProfileVersion.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "inVMAccessControlProfileVersionName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); tracingParameters.Add("inVMAccessControlProfileVersionName", inVMAccessControlProfileVersionName); + tracingParameters.Add("galleryInVMAccessControlProfileVersion", galleryInVMAccessControlProfileVersion); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); _url = _url.Replace("{inVMAccessControlProfileVersionName}", System.Uri.EscapeDataString(inVMAccessControlProfileVersionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -696,25 +729,24 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -726,61 +758,62 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(galleryInVMAccessControlProfileVersion != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(galleryInVMAccessControlProfileVersion, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(galleryInVMAccessControlProfileVersion, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -790,9 +823,10 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -803,16 +837,16 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -821,38 +855,42 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update a gallery inVMAccessControlProfile version. /// @@ -878,13 +916,13 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -893,69 +931,81 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (galleryInVMAccessControlProfileVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryInVMAccessControlProfileVersion"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (inVMAccessControlProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); } + if (inVMAccessControlProfileVersionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileVersionName"); - } - if (galleryInVMAccessControlProfileVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryInVMAccessControlProfileVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "inVMAccessControlProfileVersionName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); tracingParameters.Add("inVMAccessControlProfileVersionName", inVMAccessControlProfileVersionName); + tracingParameters.Add("galleryInVMAccessControlProfileVersion", galleryInVMAccessControlProfileVersion); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); _url = _url.Replace("{inVMAccessControlProfileVersionName}", System.Uri.EscapeDataString(inVMAccessControlProfileVersionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -965,25 +1015,24 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -995,61 +1044,62 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(galleryInVMAccessControlProfileVersion != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(galleryInVMAccessControlProfileVersion, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(galleryInVMAccessControlProfileVersion, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1059,9 +1109,10 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1072,38 +1123,42 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete a gallery inVMAccessControlProfile version. /// @@ -1125,10 +1180,10 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1137,64 +1192,76 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (inVMAccessControlProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); } + if (inVMAccessControlProfileVersionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileVersionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "inVMAccessControlProfileVersionName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); tracingParameters.Add("inVMAccessControlProfileVersionName", inVMAccessControlProfileVersionName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); _url = _url.Replace("{inVMAccessControlProfileVersionName}", System.Uri.EscapeDataString(inVMAccessControlProfileVersionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1204,25 +1271,24 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1234,55 +1300,56 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1292,33 +1359,38 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List gallery inVMAccessControlProfile versions in a gallery /// inVMAccessControlProfile @@ -1332,13 +1404,13 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1347,51 +1419,54 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie /// /// A response object containing the response body and response headers. /// - public async Task>> ListByGalleryInVMAccessControlProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByGalleryInVMAccessControlProfileNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryInVMAccessControlProfileNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryInVMAccessControlProfileNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1403,55 +1478,56 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1461,9 +1537,10 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1474,24 +1551,28 @@ internal GalleryInVMAccessControlProfileVersionsOperations(ComputeManagementClie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfileVersionsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfileVersionsOperationsExtensions.cs index 24c608bc1ee5..63f2c85f0f7b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfileVersionsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfileVersionsOperationsExtensions.cs @@ -1,505 +1,455 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for GalleryInVMAccessControlProfileVersionsOperations. + /// Extension methods for GalleryInVMAccessControlProfileVersionsOperations /// public static partial class GalleryInVMAccessControlProfileVersionsOperationsExtensions { - /// - /// List gallery inVMAccessControlProfile versions in a gallery - /// inVMAccessControlProfile - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - public static IPage ListByGalleryInVMAccessControlProfile(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName) - { - return operations.ListByGalleryInVMAccessControlProfileAsync(resourceGroupName, galleryName, inVMAccessControlProfileName).GetAwaiter().GetResult(); - } - - /// - /// List gallery inVMAccessControlProfile versions in a gallery - /// inVMAccessControlProfile - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByGalleryInVMAccessControlProfileAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByGalleryInVMAccessControlProfileWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves information about a gallery inVMAccessControlProfile version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The name of the gallery inVMAccessControlProfile version to be retrieved. - /// - public static GalleryInVMAccessControlProfileVersion Get(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName) - { - return operations.GetAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves information about a gallery inVMAccessControlProfile version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The name of the gallery inVMAccessControlProfile version to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update a gallery inVMAccessControlProfile version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The name of the gallery inVMAccessControlProfile version to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery - /// inVMAccessControlProfile version operation. - /// - public static GalleryInVMAccessControlProfileVersion CreateOrUpdate(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion) - { - return operations.CreateOrUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion).GetAwaiter().GetResult(); - } - - /// - /// Create or update a gallery inVMAccessControlProfile version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The name of the gallery inVMAccessControlProfile version to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery - /// inVMAccessControlProfile version operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a gallery inVMAccessControlProfile version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The name of the gallery inVMAccessControlProfile version to be retrieved. - /// - /// - /// Parameters supplied to the update gallery inVMAccessControlProfile version - /// operation. - /// - public static GalleryInVMAccessControlProfileVersion Update(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion) - { - return operations.UpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion).GetAwaiter().GetResult(); - } + /// + /// List gallery inVMAccessControlProfile versions in a gallery + /// inVMAccessControlProfile + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + public static Microsoft.Rest.Azure.IPage ListByGalleryInVMAccessControlProfile(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName) + { + return ((IGalleryInVMAccessControlProfileVersionsOperations)operations).ListByGalleryInVMAccessControlProfileAsync(resourceGroupName, galleryName, inVMAccessControlProfileName).GetAwaiter().GetResult(); + } - /// - /// Update a gallery inVMAccessControlProfile version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The name of the gallery inVMAccessControlProfile version to be retrieved. - /// - /// - /// Parameters supplied to the update gallery inVMAccessControlProfile version - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List gallery inVMAccessControlProfile versions in a gallery + /// inVMAccessControlProfile + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByGalleryInVMAccessControlProfileAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByGalleryInVMAccessControlProfileWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Retrieves information about a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be retrieved. + /// + public static GalleryInVMAccessControlProfileVersion Get(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName) + { + return ((IGalleryInVMAccessControlProfileVersionsOperations)operations).GetAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery inVMAccessControlProfile version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The name of the gallery inVMAccessControlProfile version to be retrieved. - /// - public static GalleryInVMAccessControlProfileVersionsDeleteHeaders Delete(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName) + /// + /// Retrieves information about a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, null, cancellationToken).ConfigureAwait(false)) { - return operations.DeleteAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or update a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be retrieved. + /// + public static GalleryInVMAccessControlProfileVersion CreateOrUpdate(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion) + { + return ((IGalleryInVMAccessControlProfileVersionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery inVMAccessControlProfile version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The name of the gallery inVMAccessControlProfile version to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or update a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } + return _result.Body; } + } + /// + /// Update a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be retrieved. + /// + public static GalleryInVMAccessControlProfileVersion Update(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion) + { + return ((IGalleryInVMAccessControlProfileVersionsOperations)operations).UpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion).GetAwaiter().GetResult(); + } - /// - /// Create or update a gallery inVMAccessControlProfile version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The name of the gallery inVMAccessControlProfile version to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery - /// inVMAccessControlProfile version operation. - /// - public static GalleryInVMAccessControlProfileVersion BeginCreateOrUpdate(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion) + /// + /// Update a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be retrieved. + /// + public static GalleryInVMAccessControlProfileVersionsDeleteHeaders Delete(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName) + { + return ((IGalleryInVMAccessControlProfileVersionsOperations)operations).DeleteAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName).GetAwaiter().GetResult(); + } - /// - /// Create or update a gallery inVMAccessControlProfile version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The name of the gallery inVMAccessControlProfile version to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery - /// inVMAccessControlProfile version operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Delete a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Headers; } + } + /// + /// Create or update a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be retrieved. + /// + public static GalleryInVMAccessControlProfileVersion BeginCreateOrUpdate(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion) + { + return ((IGalleryInVMAccessControlProfileVersionsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion).GetAwaiter().GetResult(); + } - /// - /// Update a gallery inVMAccessControlProfile version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The name of the gallery inVMAccessControlProfile version to be retrieved. - /// - /// - /// Parameters supplied to the update gallery inVMAccessControlProfile version - /// operation. - /// - public static GalleryInVMAccessControlProfileVersion BeginUpdate(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion) + /// + /// Create or update a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be retrieved. + /// + public static GalleryInVMAccessControlProfileVersion BeginUpdate(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion) + { + return ((IGalleryInVMAccessControlProfileVersionsOperations)operations).BeginUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion).GetAwaiter().GetResult(); + } - /// - /// Update a gallery inVMAccessControlProfile version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The name of the gallery inVMAccessControlProfile version to be retrieved. - /// - /// - /// Parameters supplied to the update gallery inVMAccessControlProfile version - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be retrieved. + /// + public static GalleryInVMAccessControlProfileVersionsDeleteHeaders BeginDelete(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName) + { + return ((IGalleryInVMAccessControlProfileVersionsOperations)operations).BeginDeleteAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery inVMAccessControlProfile version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The name of the gallery inVMAccessControlProfile version to be retrieved. - /// - public static GalleryInVMAccessControlProfileVersionsDeleteHeaders BeginDelete(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName) + /// + /// Delete a gallery inVMAccessControlProfile version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The name of the gallery inVMAccessControlProfile version to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginDeleteAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// List gallery inVMAccessControlProfile versions in a gallery + /// inVMAccessControlProfile + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByGalleryInVMAccessControlProfileNext(this IGalleryInVMAccessControlProfileVersionsOperations operations, string nextPageLink) + { + return ((IGalleryInVMAccessControlProfileVersionsOperations)operations).ListByGalleryInVMAccessControlProfileNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery inVMAccessControlProfile version. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The name of the gallery inVMAccessControlProfile version to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List gallery inVMAccessControlProfile versions in a gallery + /// inVMAccessControlProfile + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByGalleryInVMAccessControlProfileNextAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByGalleryInVMAccessControlProfileNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } + return _result.Body; } - - /// - /// List gallery inVMAccessControlProfile versions in a gallery - /// inVMAccessControlProfile - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByGalleryInVMAccessControlProfileNext(this IGalleryInVMAccessControlProfileVersionsOperations operations, string nextPageLink) - { - return operations.ListByGalleryInVMAccessControlProfileNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List gallery inVMAccessControlProfile versions in a gallery - /// inVMAccessControlProfile - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByGalleryInVMAccessControlProfileNextAsync(this IGalleryInVMAccessControlProfileVersionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByGalleryInVMAccessControlProfileNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfilesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfilesOperations.cs index 12420e8aadd2..2296822eb72e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfilesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfilesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// GalleryInVMAccessControlProfilesOperations operations. /// - internal partial class GalleryInVMAccessControlProfilesOperations : IServiceOperations, IGalleryInVMAccessControlProfilesOperations + internal partial class GalleryInVMAccessControlProfilesOperations : Microsoft.Rest.IServiceOperations, IGalleryInVMAccessControlProfilesOperations { /// /// Initializes a new instance of the GalleryInVMAccessControlProfilesOperations class. @@ -36,13 +24,13 @@ internal partial class GalleryInVMAccessControlProfilesOperations : IServiceOper /// /// Thrown when a required parameter is null /// - internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient client) + internal GalleryInVMAccessControlProfilesOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,52 +68,62 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task>> ListByGalleryWithHttpMessagesAsync(string resourceGroupName, string galleryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByGalleryWithHttpMessagesAsync(string resourceGroupName, string galleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByGallery", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByGallery", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -135,25 +133,24 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -165,55 +162,56 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -223,9 +221,10 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -236,25 +235,29 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves information about a gallery inVMAccessControlProfile. /// @@ -273,13 +276,13 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -288,58 +291,69 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (inVMAccessControlProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -349,25 +363,24 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -379,55 +392,56 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -437,9 +451,10 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -450,25 +465,29 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a gallery inVMAccessControlProfile. /// @@ -486,16 +505,16 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie /// inVMAccessControlProfile operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -515,16 +534,16 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -540,16 +559,16 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie /// The name of the gallery inVMAccessControlProfile to be retrieved. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -574,13 +593,13 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -589,67 +608,78 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (galleryInVMAccessControlProfile == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryInVMAccessControlProfile"); } + if (galleryInVMAccessControlProfile != null) + { + galleryInVMAccessControlProfile.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (inVMAccessControlProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); - } - if (galleryInVMAccessControlProfile == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryInVMAccessControlProfile"); - } - if (galleryInVMAccessControlProfile != null) - { - galleryInVMAccessControlProfile.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); + tracingParameters.Add("galleryInVMAccessControlProfile", galleryInVMAccessControlProfile); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -659,25 +689,24 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -689,61 +718,62 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(galleryInVMAccessControlProfile != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(galleryInVMAccessControlProfile, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(galleryInVMAccessControlProfile, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -753,9 +783,10 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -766,16 +797,16 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -784,38 +815,42 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update a gallery inVMAccessControlProfile. /// @@ -838,13 +873,13 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -853,63 +888,74 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (galleryInVMAccessControlProfile == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryInVMAccessControlProfile"); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (inVMAccessControlProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); - } - if (galleryInVMAccessControlProfile == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryInVMAccessControlProfile"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); + tracingParameters.Add("galleryInVMAccessControlProfile", galleryInVMAccessControlProfile); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -919,25 +965,24 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -949,61 +994,62 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(galleryInVMAccessControlProfile != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(galleryInVMAccessControlProfile, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(galleryInVMAccessControlProfile, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1013,9 +1059,10 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1026,38 +1073,42 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete a gallery inVMAccessControlProfile. /// @@ -1076,10 +1127,10 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1088,58 +1139,69 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (inVMAccessControlProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "inVMAccessControlProfileName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("inVMAccessControlProfileName", inVMAccessControlProfileName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{inVMAccessControlProfileName}", System.Uri.EscapeDataString(inVMAccessControlProfileName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1149,25 +1211,24 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1179,55 +1240,56 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1237,33 +1299,38 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List gallery inVMAccessControlProfiles in a gallery. /// @@ -1276,13 +1343,13 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1291,51 +1358,54 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task>> ListByGalleryNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByGalleryNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByGalleryNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1347,55 +1417,56 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1405,9 +1476,10 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1418,24 +1490,28 @@ internal GalleryInVMAccessControlProfilesOperations(ComputeManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfilesOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfilesOperationsExtensions.cs index db7e980fcabf..07b08918d34b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfilesOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GalleryInVMAccessControlProfilesOperationsExtensions.cs @@ -1,453 +1,403 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for GalleryInVMAccessControlProfilesOperations. + /// Extension methods for GalleryInVMAccessControlProfilesOperations /// public static partial class GalleryInVMAccessControlProfilesOperationsExtensions { - /// - /// List gallery inVMAccessControlProfiles in a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - public static IPage ListByGallery(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName) - { - return operations.ListByGalleryAsync(resourceGroupName, galleryName).GetAwaiter().GetResult(); - } - - /// - /// List gallery inVMAccessControlProfiles in a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByGalleryAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByGalleryWithHttpMessagesAsync(resourceGroupName, galleryName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves information about a gallery inVMAccessControlProfile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - public static GalleryInVMAccessControlProfile Get(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName) - { - return operations.GetAsync(resourceGroupName, galleryName, inVMAccessControlProfileName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves information about a gallery inVMAccessControlProfile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update a gallery inVMAccessControlProfile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery - /// inVMAccessControlProfile operation. - /// - public static GalleryInVMAccessControlProfile CreateOrUpdate(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile) - { - return operations.CreateOrUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile).GetAwaiter().GetResult(); - } - - /// - /// Create or update a gallery inVMAccessControlProfile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery - /// inVMAccessControlProfile operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a gallery inVMAccessControlProfile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// Parameters supplied to the update gallery inVMAccessControlProfile - /// operation. - /// - public static GalleryInVMAccessControlProfile Update(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile) - { - return operations.UpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile).GetAwaiter().GetResult(); - } + /// + /// List gallery inVMAccessControlProfiles in a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + public static Microsoft.Rest.Azure.IPage ListByGallery(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName) + { + return ((IGalleryInVMAccessControlProfilesOperations)operations).ListByGalleryAsync(resourceGroupName, galleryName).GetAwaiter().GetResult(); + } - /// - /// Update a gallery inVMAccessControlProfile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// Parameters supplied to the update gallery inVMAccessControlProfile - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List gallery inVMAccessControlProfiles in a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByGalleryAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByGalleryWithHttpMessagesAsync(resourceGroupName, galleryName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Retrieves information about a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + public static GalleryInVMAccessControlProfile Get(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName) + { + return ((IGalleryInVMAccessControlProfilesOperations)operations).GetAsync(resourceGroupName, galleryName, inVMAccessControlProfileName).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery inVMAccessControlProfile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - public static GalleryInVMAccessControlProfilesDeleteHeaders Delete(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName) + /// + /// Retrieves information about a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, null, cancellationToken).ConfigureAwait(false)) { - return operations.DeleteAsync(resourceGroupName, galleryName, inVMAccessControlProfileName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or update a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + public static GalleryInVMAccessControlProfile CreateOrUpdate(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile) + { + return ((IGalleryInVMAccessControlProfilesOperations)operations).CreateOrUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery inVMAccessControlProfile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or update a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } + return _result.Body; } + } + /// + /// Update a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + public static GalleryInVMAccessControlProfile Update(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile) + { + return ((IGalleryInVMAccessControlProfilesOperations)operations).UpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile).GetAwaiter().GetResult(); + } - /// - /// Create or update a gallery inVMAccessControlProfile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery - /// inVMAccessControlProfile operation. - /// - public static GalleryInVMAccessControlProfile BeginCreateOrUpdate(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile) + /// + /// Update a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + public static GalleryInVMAccessControlProfilesDeleteHeaders Delete(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName) + { + return ((IGalleryInVMAccessControlProfilesOperations)operations).DeleteAsync(resourceGroupName, galleryName, inVMAccessControlProfileName).GetAwaiter().GetResult(); + } - /// - /// Create or update a gallery inVMAccessControlProfile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// Parameters supplied to the create or update gallery - /// inVMAccessControlProfile operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Delete a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Headers; } + } + /// + /// Create or update a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + public static GalleryInVMAccessControlProfile BeginCreateOrUpdate(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile) + { + return ((IGalleryInVMAccessControlProfilesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile).GetAwaiter().GetResult(); + } - /// - /// Update a gallery inVMAccessControlProfile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// Parameters supplied to the update gallery inVMAccessControlProfile - /// operation. - /// - public static GalleryInVMAccessControlProfile BeginUpdate(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile) + /// + /// Create or update a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + public static GalleryInVMAccessControlProfile BeginUpdate(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile) + { + return ((IGalleryInVMAccessControlProfilesOperations)operations).BeginUpdateAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile).GetAwaiter().GetResult(); + } - /// - /// Update a gallery inVMAccessControlProfile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// Parameters supplied to the update gallery inVMAccessControlProfile - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + public static GalleryInVMAccessControlProfilesDeleteHeaders BeginDelete(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName) + { + return ((IGalleryInVMAccessControlProfilesOperations)operations).BeginDeleteAsync(resourceGroupName, galleryName, inVMAccessControlProfileName).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery inVMAccessControlProfile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - public static GalleryInVMAccessControlProfilesDeleteHeaders BeginDelete(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName) + /// + /// Delete a gallery inVMAccessControlProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The name of the gallery inVMAccessControlProfile to be retrieved. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginDeleteAsync(resourceGroupName, galleryName, inVMAccessControlProfileName).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// List gallery inVMAccessControlProfiles in a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByGalleryNext(this IGalleryInVMAccessControlProfilesOperations operations, string nextPageLink) + { + return ((IGalleryInVMAccessControlProfilesOperations)operations).ListByGalleryNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Delete a gallery inVMAccessControlProfile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The name of the gallery inVMAccessControlProfile to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IGalleryInVMAccessControlProfilesOperations operations, string resourceGroupName, string galleryName, string inVMAccessControlProfileName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List gallery inVMAccessControlProfiles in a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByGalleryNextAsync(this IGalleryInVMAccessControlProfilesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByGalleryNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, galleryName, inVMAccessControlProfileName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } + return _result.Body; } - - /// - /// List gallery inVMAccessControlProfiles in a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByGalleryNext(this IGalleryInVMAccessControlProfilesOperations operations, string nextPageLink) - { - return operations.ListByGalleryNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List gallery inVMAccessControlProfiles in a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByGalleryNextAsync(this IGalleryInVMAccessControlProfilesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByGalleryNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/GallerySharingProfileOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/GallerySharingProfileOperations.cs index 9d391370986d..b92759a75adb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GallerySharingProfileOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GallerySharingProfileOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// GallerySharingProfileOperations operations. /// - internal partial class GallerySharingProfileOperations : IServiceOperations, IGallerySharingProfileOperations + internal partial class GallerySharingProfileOperations : Microsoft.Rest.IServiceOperations, IGallerySharingProfileOperations { /// /// Initializes a new instance of the GallerySharingProfileOperations class. @@ -36,13 +24,13 @@ internal partial class GallerySharingProfileOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal GallerySharingProfileOperations(ComputeManagementClient client) + internal GallerySharingProfileOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,16 +51,16 @@ internal GallerySharingProfileOperations(ComputeManagementClient client) /// Parameters supplied to the update gallery sharing profile. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, SharingUpdate sharingUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, SharingUpdate sharingUpdate, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, sharingUpdate, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, sharingUpdate, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -93,13 +81,13 @@ internal GallerySharingProfileOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -108,61 +96,71 @@ internal GallerySharingProfileOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, SharingUpdate sharingUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, SharingUpdate sharingUpdate, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (sharingUpdate == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "sharingUpdate"); + } + if (sharingUpdate != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + sharingUpdate.Validate(); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); - } - if (sharingUpdate == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "sharingUpdate"); - } - if (sharingUpdate != null) - { - sharingUpdate.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); + tracingParameters.Add("sharingUpdate", sharingUpdate); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -172,25 +170,24 @@ internal GallerySharingProfileOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -202,61 +199,62 @@ internal GallerySharingProfileOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(sharingUpdate != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(sharingUpdate, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(sharingUpdate, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -266,9 +264,10 @@ internal GallerySharingProfileOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -279,24 +278,28 @@ internal GallerySharingProfileOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/GallerySharingProfileOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/GallerySharingProfileOperationsExtensions.cs index 7a7fd6081aa9..dba461976836 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/GallerySharingProfileOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/GallerySharingProfileOperationsExtensions.cs @@ -1,117 +1,94 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for GallerySharingProfileOperations. + /// Extension methods for GallerySharingProfileOperations /// public static partial class GallerySharingProfileOperationsExtensions { - /// - /// Update sharing profile of a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// Parameters supplied to the update gallery sharing profile. - /// - public static SharingUpdate Update(this IGallerySharingProfileOperations operations, string resourceGroupName, string galleryName, SharingUpdate sharingUpdate) - { - return operations.UpdateAsync(resourceGroupName, galleryName, sharingUpdate).GetAwaiter().GetResult(); - } + /// + /// Update sharing profile of a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + public static SharingUpdate Update(this IGallerySharingProfileOperations operations, string resourceGroupName, string galleryName, SharingUpdate sharingUpdate) + { + return ((IGallerySharingProfileOperations)operations).UpdateAsync(resourceGroupName, galleryName, sharingUpdate).GetAwaiter().GetResult(); + } - /// - /// Update sharing profile of a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// Parameters supplied to the update gallery sharing profile. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IGallerySharingProfileOperations operations, string resourceGroupName, string galleryName, SharingUpdate sharingUpdate, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update sharing profile of a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IGallerySharingProfileOperations operations, string resourceGroupName, string galleryName, SharingUpdate sharingUpdate, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, sharingUpdate, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, galleryName, sharingUpdate, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Update sharing profile of a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + public static SharingUpdate BeginUpdate(this IGallerySharingProfileOperations operations, string resourceGroupName, string galleryName, SharingUpdate sharingUpdate) + { + return ((IGallerySharingProfileOperations)operations).BeginUpdateAsync(resourceGroupName, galleryName, sharingUpdate).GetAwaiter().GetResult(); + } - /// - /// Update sharing profile of a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// Parameters supplied to the update gallery sharing profile. - /// - public static SharingUpdate BeginUpdate(this IGallerySharingProfileOperations operations, string resourceGroupName, string galleryName, SharingUpdate sharingUpdate) + /// + /// Update sharing profile of a gallery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IGallerySharingProfileOperations operations, string resourceGroupName, string galleryName, SharingUpdate sharingUpdate, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, sharingUpdate, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginUpdateAsync(resourceGroupName, galleryName, sharingUpdate).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Update sharing profile of a gallery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// Parameters supplied to the update gallery sharing profile. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IGallerySharingProfileOperations operations, string resourceGroupName, string galleryName, SharingUpdate sharingUpdate, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, galleryName, sharingUpdate, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/IAvailabilitySetsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IAvailabilitySetsOperations.cs index b5bd47356030..f525921fd968 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IAvailabilitySetsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IAvailabilitySetsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// AvailabilitySetsOperations operations. @@ -26,9 +16,12 @@ public partial interface IAvailabilitySetsOperations /// /// Lists all availability sets in a subscription. /// + /// + /// Lists all availability sets in a subscription. + /// /// /// The expand expression to apply to the operation. Allowed values are - /// 'instanceView'. + /// 'instanceView'. /// /// /// The headers that will be added to request. @@ -42,13 +35,14 @@ public partial interface IAvailabilitySetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionWithHttpMessagesAsync(string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all availability sets in a resource group. /// + /// + /// Lists all availability sets in a resource group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -64,13 +58,14 @@ public partial interface IAvailabilitySetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves information about an availability set. /// + /// + /// Retrieves information about an availability set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -89,13 +84,14 @@ public partial interface IAvailabilitySetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update an availability set. /// + /// + /// Create or update an availability set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -117,13 +113,14 @@ public partial interface IAvailabilitySetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, AvailabilitySet parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, AvailabilitySet parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update an availability set. /// + /// + /// Update an availability set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -145,13 +142,14 @@ public partial interface IAvailabilitySetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, AvailabilitySetUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, AvailabilitySetUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete an availability set. /// + /// + /// Delete an availability set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -167,13 +165,14 @@ public partial interface IAvailabilitySetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Cancel the migration operation on an Availability Set. /// + /// + /// Cancel the migration operation on an Availability Set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -189,15 +188,18 @@ public partial interface IAvailabilitySetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task CancelMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task CancelMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create a new Flexible Virtual Machine Scale Set and migrate all the - /// Virtual Machines in the Availability Set. This does not trigger a - /// downtime on the Virtual Machines. + /// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual + /// Machines in the Availability Set. This does not trigger a downtime on the + /// Virtual Machines. /// + /// + /// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual + /// Machines in the Availability Set. This does not trigger a downtime on the + /// Virtual Machines. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -217,16 +219,20 @@ public partial interface IAvailabilitySetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ConvertToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ConvertToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Start migration operation on an Availability Set to move its - /// Virtual Machines to a Virtual Machine Scale Set. This should be - /// followed by a migrate operation on each Virtual Machine that - /// triggers a downtime on the Virtual Machine. + /// Start migration operation on an Availability Set to move its Virtual + /// Machines to a Virtual Machine Scale Set. This should be followed by a + /// migrate operation on each Virtual Machine that triggers a downtime on the + /// Virtual Machine. /// + /// + /// Start migration operation on an Availability Set to move its Virtual + /// Machines to a Virtual Machine Scale Set. This should be followed by a + /// migrate operation on each Virtual Machine that triggers a downtime on the + /// Virtual Machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -235,8 +241,7 @@ public partial interface IAvailabilitySetsOperations /// /// /// Specifies information about the Virtual Machine Scale Set that the - /// Availability Set should be migrated to. Minimum api‐version: - /// 2024‐11‐01. + /// Availability Set should be migrated to. Minimum api‐version: 2024‐11‐01. /// /// /// The headers that will be added to request. @@ -247,14 +252,16 @@ public partial interface IAvailabilitySetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task StartMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task StartMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Validates that the Virtual Machines in the Availability Set can be - /// migrated to the provided Virtual Machine Scale Set. + /// Validates that the Virtual Machines in the Availability Set can be migrated + /// to the provided Virtual Machine Scale Set. /// + /// + /// Validates that the Virtual Machines in the Availability Set can be migrated + /// to the provided Virtual Machine Scale Set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -263,8 +270,7 @@ public partial interface IAvailabilitySetsOperations /// /// /// Specifies information about the Virtual Machine Scale Set that the - /// Availability Set should be migrated to. Minimum api‐version: - /// 2024‐11‐01. + /// Availability Set should be migrated to. Minimum api‐version: 2024‐11‐01. /// /// /// The headers that will be added to request. @@ -275,14 +281,16 @@ public partial interface IAvailabilitySetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ValidateMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ValidateMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all available virtual machine sizes that can be used to - /// create a new virtual machine in an existing availability set. + /// Lists all available virtual machine sizes that can be used to create a new + /// virtual machine in an existing availability set. /// + /// + /// Lists all available virtual machine sizes that can be used to create a new + /// virtual machine in an existing availability set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -301,15 +309,18 @@ public partial interface IAvailabilitySetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAvailableSizesWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAvailableSizesWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create a new Flexible Virtual Machine Scale Set and migrate all the - /// Virtual Machines in the Availability Set. This does not trigger a - /// downtime on the Virtual Machines. + /// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual + /// Machines in the Availability Set. This does not trigger a downtime on the + /// Virtual Machines. /// + /// + /// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual + /// Machines in the Availability Set. This does not trigger a downtime on the + /// Virtual Machines. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -329,13 +340,14 @@ public partial interface IAvailabilitySetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginConvertToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginConvertToVirtualMachineScaleSetWithHttpMessagesAsync(string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all availability sets in a subscription. /// + /// + /// Lists all availability sets in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -351,13 +363,14 @@ public partial interface IAvailabilitySetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all availability sets in a resource group. /// + /// + /// Lists all availability sets in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -373,9 +386,7 @@ public partial interface IAvailabilitySetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/ICapacityReservationGroupsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ICapacityReservationGroupsOperations.cs index 1ad0ea4506de..fea670894bfb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ICapacityReservationGroupsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ICapacityReservationGroupsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// CapacityReservationGroupsOperations operations. @@ -24,27 +14,29 @@ namespace Microsoft.Azure.Management.Compute public partial interface ICapacityReservationGroupsOperations { /// - /// Lists all of the capacity reservation groups in the subscription. - /// Use the nextLink property in the response to get the next page of - /// capacity reservation groups. + /// Lists all of the capacity reservation groups in the subscription. Use the + /// nextLink property in the response to get the next page of capacity + /// reservation groups. /// + /// + /// Lists all of the capacity reservation groups in the subscription. Use the + /// nextLink property in the response to get the next page of capacity + /// reservation groups. + /// /// - /// The expand expression to apply on the operation. Based on the - /// expand param(s) specified we return Virtual Machine or ScaleSet VM - /// Instance or both resource Ids which are associated to capacity - /// reservation group in the response. Possible values include: - /// 'virtualMachineScaleSetVMs/$ref', 'virtualMachines/$ref' + /// The expand expression to apply on the operation. Based on the expand + /// param(s) specified we return Virtual Machine or ScaleSet VM Instance or + /// both resource Ids which are associated to capacity reservation group in the + /// response. /// /// - /// The query option to fetch Capacity Reservation Group Resource Ids. - /// <br> 'CreatedInSubscription' enables fetching Resource Ids - /// for all capacity reservation group resources created in the - /// subscription. <br> 'SharedWithSubscription' enables fetching - /// Resource Ids for all capacity reservation group resources shared - /// with the subscription. <br> 'All' enables fetching Resource - /// Ids for all capacity reservation group resources shared with the - /// subscription and created in the subscription. Possible values - /// include: 'CreatedInSubscription', 'SharedWithSubscription', 'All' + /// The query option to fetch Capacity Reservation Group Resource Ids. <br> + /// 'CreatedInSubscription' enables fetching Resource Ids for all capacity + /// reservation group resources created in the subscription. <br> + /// 'SharedWithSubscription' enables fetching Resource Ids for all capacity + /// reservation group resources shared with the subscription. <br> 'All' + /// enables fetching Resource Ids for all capacity reservation group resources + /// shared with the subscription and created in the subscription. /// /// /// The headers that will be added to request. @@ -58,24 +50,26 @@ public partial interface ICapacityReservationGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionWithHttpMessagesAsync(string expand = default(string), string resourceIdsOnly = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(string expand = default(string), string resourceIdsOnly = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all of the capacity reservation groups in the specified - /// resource group. Use the nextLink property in the response to get - /// the next page of capacity reservation groups. + /// Lists all of the capacity reservation groups in the specified resource + /// group. Use the nextLink property in the response to get the next page of + /// capacity reservation groups. /// + /// + /// Lists all of the capacity reservation groups in the specified resource + /// group. Use the nextLink property in the response to get the next page of + /// capacity reservation groups. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The expand expression to apply on the operation. Based on the - /// expand param(s) specified we return Virtual Machine or ScaleSet VM - /// Instance or both resource Ids which are associated to capacity - /// reservation group in the response. Possible values include: - /// 'virtualMachineScaleSetVMs/$ref', 'virtualMachines/$ref' + /// The expand expression to apply on the operation. Based on the expand + /// param(s) specified we return Virtual Machine or ScaleSet VM Instance or + /// both resource Ids which are associated to capacity reservation group in the + /// response. /// /// /// The headers that will be added to request. @@ -89,14 +83,16 @@ public partial interface ICapacityReservationGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation that retrieves information about a capacity - /// reservation group. + /// The operation that retrieves information about a capacity reservation + /// group. /// + /// + /// The operation that retrieves information about a capacity reservation + /// group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -104,12 +100,11 @@ public partial interface ICapacityReservationGroupsOperations /// The name of the capacity reservation group. /// /// - /// The expand expression to apply on the operation. 'InstanceView' - /// will retrieve the list of instance views of the capacity - /// reservations under the capacity reservation group which is a - /// snapshot of the runtime properties of a capacity reservation that - /// is managed by the platform and can change outside of control plane - /// operations. Possible values include: 'instanceView' + /// The expand expression to apply on the operation. 'InstanceView' will + /// retrieve the list of instance views of the capacity reservations under the + /// capacity reservation group which is a snapshot of the runtime properties of + /// a capacity reservation that is managed by the platform and can change + /// outside of control plane operations. /// /// /// The headers that will be added to request. @@ -123,16 +118,20 @@ public partial interface ICapacityReservationGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to create or update a capacity reservation group. - /// When updating a capacity reservation group, only tags and sharing - /// profile may be modified. Please refer to - /// https://aka.ms/CapacityReservation for more details. + /// The operation to create or update a capacity reservation group. When + /// updating a capacity reservation group, only tags and sharing profile may be + /// modified. Please refer to https://aka.ms/CapacityReservation for more + /// details. /// + /// + /// The operation to create or update a capacity reservation group. When + /// updating a capacity reservation group, only tags and sharing profile may be + /// modified. Please refer to https://aka.ms/CapacityReservation for more + /// details. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -154,15 +153,16 @@ public partial interface ICapacityReservationGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, CapacityReservationGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, CapacityReservationGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to update a capacity reservation group. When updating - /// a capacity reservation group, only tags and sharing profile may be - /// modified. + /// The operation to update a capacity reservation group. When updating a + /// capacity reservation group, only tags and sharing profile may be modified. /// + /// + /// The operation to update a capacity reservation group. When updating a + /// capacity reservation group, only tags and sharing profile may be modified. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -170,8 +170,7 @@ public partial interface ICapacityReservationGroupsOperations /// The name of the capacity reservation group. /// /// - /// Parameters supplied to the Update capacity reservation Group - /// operation. + /// Parameters supplied to the Update capacity reservation Group operation. /// /// /// The headers that will be added to request. @@ -185,18 +184,22 @@ public partial interface ICapacityReservationGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, CapacityReservationGroupUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, CapacityReservationGroupUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to delete a capacity reservation group. This - /// operation is allowed only if all the associated resources are - /// disassociated from the reservation group and all capacity - /// reservations under the reservation group have also been deleted. - /// Please refer to https://aka.ms/CapacityReservation for more - /// details. + /// The operation to delete a capacity reservation group. This operation is + /// allowed only if all the associated resources are disassociated from the + /// reservation group and all capacity reservations under the reservation group + /// have also been deleted. Please refer to https://aka.ms/CapacityReservation + /// for more details. /// + /// + /// The operation to delete a capacity reservation group. This operation is + /// allowed only if all the associated resources are disassociated from the + /// reservation group and all capacity reservations under the reservation group + /// have also been deleted. Please refer to https://aka.ms/CapacityReservation + /// for more details. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -212,15 +215,18 @@ public partial interface ICapacityReservationGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all of the capacity reservation groups in the subscription. - /// Use the nextLink property in the response to get the next page of - /// capacity reservation groups. + /// Lists all of the capacity reservation groups in the subscription. Use the + /// nextLink property in the response to get the next page of capacity + /// reservation groups. /// + /// + /// Lists all of the capacity reservation groups in the subscription. Use the + /// nextLink property in the response to get the next page of capacity + /// reservation groups. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -236,15 +242,18 @@ public partial interface ICapacityReservationGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all of the capacity reservation groups in the specified - /// resource group. Use the nextLink property in the response to get - /// the next page of capacity reservation groups. + /// Lists all of the capacity reservation groups in the specified resource + /// group. Use the nextLink property in the response to get the next page of + /// capacity reservation groups. /// + /// + /// Lists all of the capacity reservation groups in the specified resource + /// group. Use the nextLink property in the response to get the next page of + /// capacity reservation groups. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -260,9 +269,7 @@ public partial interface ICapacityReservationGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/ICapacityReservationsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ICapacityReservationsOperations.cs index d861e467b11e..3bde028c33b7 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ICapacityReservationsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ICapacityReservationsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// CapacityReservationsOperations operations. @@ -25,9 +15,14 @@ public partial interface ICapacityReservationsOperations { /// /// Lists all of the capacity reservations in the specified capacity - /// reservation group. Use the nextLink property in the response to get - /// the next page of capacity reservations. + /// reservation group. Use the nextLink property in the response to get the + /// next page of capacity reservations. /// + /// + /// Lists all of the capacity reservations in the specified capacity + /// reservation group. Use the nextLink property in the response to get the + /// next page of capacity reservations. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -46,14 +41,14 @@ public partial interface ICapacityReservationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByCapacityReservationGroupWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByCapacityReservationGroupWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation that retrieves information about the capacity - /// reservation. + /// The operation that retrieves information about the capacity reservation. /// + /// + /// The operation that retrieves information about the capacity reservation. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -64,11 +59,9 @@ public partial interface ICapacityReservationsOperations /// The name of the capacity reservation. /// /// - /// The expand expression to apply on the operation. 'InstanceView' - /// retrieves a snapshot of the runtime properties of the capacity - /// reservation that is managed by the platform and can change outside - /// of control plane operations. Possible values include: - /// 'instanceView' + /// The expand expression to apply on the operation. 'InstanceView' retrieves a + /// snapshot of the runtime properties of the capacity reservation that is + /// managed by the platform and can change outside of control plane operations. /// /// /// The headers that will be added to request. @@ -82,16 +75,18 @@ public partial interface ICapacityReservationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to create or update a capacity reservation. Please - /// note some properties can be set only during capacity reservation - /// creation. Please refer to https://aka.ms/CapacityReservation for - /// more details. + /// The operation to create or update a capacity reservation. Please note some + /// properties can be set only during capacity reservation creation. Please + /// refer to https://aka.ms/CapacityReservation for more details. /// + /// + /// The operation to create or update a capacity reservation. Please note some + /// properties can be set only during capacity reservation creation. Please + /// refer to https://aka.ms/CapacityReservation for more details. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -116,13 +111,14 @@ public partial interface ICapacityReservationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservation parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to update a capacity reservation. /// + /// + /// The operation to update a capacity reservation. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -147,18 +143,22 @@ public partial interface ICapacityReservationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservationUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservationUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to delete a capacity reservation. This operation is - /// allowed only when all the associated resources are disassociated - /// from the capacity reservation. Please refer to - /// https://aka.ms/CapacityReservation for more details. Note: Block - /// capacity reservations cannot be deleted after it has been - /// successfully allocated until the schedule end time. + /// The operation to delete a capacity reservation. This operation is allowed + /// only when all the associated resources are disassociated from the capacity + /// reservation. Please refer to https://aka.ms/CapacityReservation for more + /// details. Note: Block capacity reservations cannot be deleted after it has + /// been successfully allocated until the schedule end time. /// + /// + /// The operation to delete a capacity reservation. This operation is allowed + /// only when all the associated resources are disassociated from the capacity + /// reservation. Please refer to https://aka.ms/CapacityReservation for more + /// details. Note: Block capacity reservations cannot be deleted after it has + /// been successfully allocated until the schedule end time. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -177,16 +177,18 @@ public partial interface ICapacityReservationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to create or update a capacity reservation. Please - /// note some properties can be set only during capacity reservation - /// creation. Please refer to https://aka.ms/CapacityReservation for - /// more details. + /// The operation to create or update a capacity reservation. Please note some + /// properties can be set only during capacity reservation creation. Please + /// refer to https://aka.ms/CapacityReservation for more details. /// + /// + /// The operation to create or update a capacity reservation. Please note some + /// properties can be set only during capacity reservation creation. Please + /// refer to https://aka.ms/CapacityReservation for more details. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -211,13 +213,14 @@ public partial interface ICapacityReservationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservation parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservation parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to update a capacity reservation. /// + /// + /// The operation to update a capacity reservation. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -242,18 +245,22 @@ public partial interface ICapacityReservationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservationUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, CapacityReservationUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to delete a capacity reservation. This operation is - /// allowed only when all the associated resources are disassociated - /// from the capacity reservation. Please refer to - /// https://aka.ms/CapacityReservation for more details. Note: Block - /// capacity reservations cannot be deleted after it has been - /// successfully allocated until the schedule end time. + /// The operation to delete a capacity reservation. This operation is allowed + /// only when all the associated resources are disassociated from the capacity + /// reservation. Please refer to https://aka.ms/CapacityReservation for more + /// details. Note: Block capacity reservations cannot be deleted after it has + /// been successfully allocated until the schedule end time. /// + /// + /// The operation to delete a capacity reservation. This operation is allowed + /// only when all the associated resources are disassociated from the capacity + /// reservation. Please refer to https://aka.ms/CapacityReservation for more + /// details. Note: Block capacity reservations cannot be deleted after it has + /// been successfully allocated until the schedule end time. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -272,15 +279,18 @@ public partial interface ICapacityReservationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string capacityReservationGroupName, string capacityReservationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all of the capacity reservations in the specified capacity - /// reservation group. Use the nextLink property in the response to get - /// the next page of capacity reservations. + /// reservation group. Use the nextLink property in the response to get the + /// next page of capacity reservations. /// + /// + /// Lists all of the capacity reservations in the specified capacity + /// reservation group. Use the nextLink property in the response to get the + /// next page of capacity reservations. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -296,9 +306,7 @@ public partial interface ICapacityReservationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByCapacityReservationGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByCapacityReservationGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/ICommunityGalleriesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ICommunityGalleriesOperations.cs index cf3ca259465a..ae1dc92fcaeb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ICommunityGalleriesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ICommunityGalleriesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// CommunityGalleriesOperations operations. @@ -26,6 +16,9 @@ public partial interface ICommunityGalleriesOperations /// /// Get a community gallery by gallery public name. /// + /// + /// Get a community gallery by gallery public name. + /// /// /// The name of Azure region. /// @@ -44,9 +37,7 @@ public partial interface ICommunityGalleriesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string location, string publicGalleryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string publicGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/ICommunityGalleryImageVersionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ICommunityGalleryImageVersionsOperations.cs index e3265c773995..820f9b24fcf2 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ICommunityGalleryImageVersionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ICommunityGalleryImageVersionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// CommunityGalleryImageVersionsOperations operations. @@ -26,6 +16,9 @@ public partial interface ICommunityGalleryImageVersionsOperations /// /// List community gallery image versions inside an image. /// + /// + /// List community gallery image versions inside an image. + /// /// /// The name of Azure region. /// @@ -47,13 +40,14 @@ public partial interface ICommunityGalleryImageVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, string publicGalleryName, string galleryImageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string publicGalleryName, string galleryImageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get a community gallery image version. /// + /// + /// Get a community gallery image version. + /// /// /// The name of Azure region. /// @@ -64,10 +58,10 @@ public partial interface ICommunityGalleryImageVersionsOperations /// The name of the community gallery image definition. /// /// - /// The name of the community gallery image version. Needs to follow - /// semantic version name pattern: The allowed characters are digit and - /// period. Digits must be within the range of a 32-bit integer. - /// Format: <MajorVersion>.<MinorVersion>.<Patch> + /// The name of the community gallery image version. Needs to follow semantic + /// version name pattern: The allowed characters are digit and period. Digits + /// must be within the range of a 32-bit integer. Format: + /// <MajorVersion>.<MinorVersion>.<Patch> /// /// /// The headers that will be added to request. @@ -81,13 +75,14 @@ public partial interface ICommunityGalleryImageVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string location, string publicGalleryName, string galleryImageName, string galleryImageVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string publicGalleryName, string galleryImageName, string galleryImageVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List community gallery image versions inside an image. /// + /// + /// List community gallery image versions inside an image. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -103,9 +98,7 @@ public partial interface ICommunityGalleryImageVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/ICommunityGalleryImagesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ICommunityGalleryImagesOperations.cs index 24ab6e0678f7..4b6c83d74b64 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ICommunityGalleryImagesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ICommunityGalleryImagesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// CommunityGalleryImagesOperations operations. @@ -26,6 +16,9 @@ public partial interface ICommunityGalleryImagesOperations /// /// List community gallery images inside a gallery. /// + /// + /// List community gallery images inside a gallery. + /// /// /// The name of Azure region. /// @@ -44,13 +37,14 @@ public partial interface ICommunityGalleryImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, string publicGalleryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string publicGalleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get a community gallery image. /// + /// + /// Get a community gallery image. + /// /// /// The name of Azure region. /// @@ -72,13 +66,14 @@ public partial interface ICommunityGalleryImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string location, string publicGalleryName, string galleryImageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string publicGalleryName, string galleryImageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List community gallery images inside a gallery. /// + /// + /// List community gallery images inside a gallery. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -94,9 +89,7 @@ public partial interface ICommunityGalleryImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IComputeManagementClient.cs b/src/Compute/Compute.Management.Sdk/Generated/IComputeManagementClient.cs index 090e6ffa52c7..c3b7ce739106 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IComputeManagementClient.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IComputeManagementClient.cs @@ -1,23 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; /// + /// The Compute Management Client. /// - public partial interface IComputeManagementClient : System.IDisposable + public partial interface IComputeManagementClient : System.IDisposable { /// /// The base URI of the service. @@ -27,278 +22,282 @@ public partial interface IComputeManagementClient : System.IDisposable /// /// Gets or sets json serialization settings. /// - JsonSerializerSettings SerializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - JsonSerializerSettings DeserializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - ServiceClientCredentials Credentials { get; } + Microsoft.Rest.ServiceClientCredentials Credentials { get;} + /// /// Subscription credentials which uniquely identify Microsoft Azure - /// subscription. The subscription ID forms part of the URI for every - /// service call. + /// subscription. The subscription ID forms part of the URI for every service + /// call. /// - string SubscriptionId { get; set; } + string SubscriptionId { get; set;} + /// /// The preferred language for the response. /// - string AcceptLanguage { get; set; } + string AcceptLanguage { get; set;} + /// /// The retry timeout in seconds for Long Running Operations. Default - /// value is 30. + /// /// value is 30. /// - int? LongRunningOperationRetryTimeout { get; set; } + int? LongRunningOperationRetryTimeout { get; set;} + /// /// Whether a unique x-ms-client-request-id should be generated. When - /// set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - bool? GenerateClientRequestId { get; set; } + bool? GenerateClientRequestId { get; set;} /// - /// Gets the IOperations. + /// Gets the IOperations /// IOperations Operations { get; } /// - /// Gets the IAvailabilitySetsOperations. + /// Gets the IAvailabilitySetsOperations /// IAvailabilitySetsOperations AvailabilitySets { get; } /// - /// Gets the ICapacityReservationGroupsOperations. + /// Gets the ICapacityReservationGroupsOperations /// ICapacityReservationGroupsOperations CapacityReservationGroups { get; } /// - /// Gets the IDedicatedHostGroupsOperations. + /// Gets the IDedicatedHostGroupsOperations /// IDedicatedHostGroupsOperations DedicatedHostGroups { get; } /// - /// Gets the IImagesOperations. + /// Gets the IImagesOperations /// IImagesOperations Images { get; } /// - /// Gets the IVirtualMachineImagesEdgeZoneOperations. + /// Gets the IVirtualMachineImagesEdgeZoneOperations /// IVirtualMachineImagesEdgeZoneOperations VirtualMachineImagesEdgeZone { get; } /// - /// Gets the IVirtualMachineImagesOperations. + /// Gets the IVirtualMachineImagesOperations /// IVirtualMachineImagesOperations VirtualMachineImages { get; } /// - /// Gets the ILogAnalyticsOperations. + /// Gets the ILogAnalyticsOperations /// ILogAnalyticsOperations LogAnalytics { get; } /// - /// Gets the IVirtualMachineExtensionImagesOperations. + /// Gets the IVirtualMachineExtensionImagesOperations /// IVirtualMachineExtensionImagesOperations VirtualMachineExtensionImages { get; } /// - /// Gets the IVirtualMachineRunCommandsOperations. + /// Gets the IVirtualMachineRunCommandsOperations /// IVirtualMachineRunCommandsOperations VirtualMachineRunCommands { get; } /// - /// Gets the IUsageOperations. + /// Gets the IUsageOperations /// IUsageOperations Usage { get; } /// - /// Gets the IVirtualMachineScaleSetsOperations. + /// Gets the IVirtualMachineScaleSetsOperations /// IVirtualMachineScaleSetsOperations VirtualMachineScaleSets { get; } /// - /// Gets the IVirtualMachinesOperations. + /// Gets the IVirtualMachinesOperations /// IVirtualMachinesOperations VirtualMachines { get; } /// - /// Gets the IVirtualMachineSizesOperations. + /// Gets the IVirtualMachineSizesOperations /// IVirtualMachineSizesOperations VirtualMachineSizes { get; } /// - /// Gets the IProximityPlacementGroupsOperations. + /// Gets the IProximityPlacementGroupsOperations /// IProximityPlacementGroupsOperations ProximityPlacementGroups { get; } /// - /// Gets the IRestorePointCollectionsOperations. + /// Gets the IRestorePointCollectionsOperations /// IRestorePointCollectionsOperations RestorePointCollections { get; } /// - /// Gets the ISshPublicKeysOperations. + /// Gets the ISshPublicKeysOperations /// ISshPublicKeysOperations SshPublicKeys { get; } /// - /// Gets the ICapacityReservationsOperations. + /// Gets the ICapacityReservationsOperations /// ICapacityReservationsOperations CapacityReservations { get; } /// - /// Gets the IDedicatedHostsOperations. + /// Gets the IDedicatedHostsOperations /// IDedicatedHostsOperations DedicatedHosts { get; } /// - /// Gets the IRestorePointsOperations. + /// Gets the IRestorePointsOperations /// IRestorePointsOperations RestorePoints { get; } /// - /// Gets the IVirtualMachineScaleSetRollingUpgradesOperations. + /// Gets the IVirtualMachineScaleSetRollingUpgradesOperations /// IVirtualMachineScaleSetRollingUpgradesOperations VirtualMachineScaleSetRollingUpgrades { get; } /// - /// Gets the IVirtualMachineScaleSetExtensionsOperations. + /// Gets the IVirtualMachineScaleSetExtensionsOperations /// IVirtualMachineScaleSetExtensionsOperations VirtualMachineScaleSetExtensions { get; } /// - /// Gets the IVirtualMachineScaleSetVMsOperations. + /// Gets the IVirtualMachineScaleSetVMSOperations /// - IVirtualMachineScaleSetVMsOperations VirtualMachineScaleSetVMs { get; } + IVirtualMachineScaleSetVMSOperations VirtualMachineScaleSetVMS { get; } /// - /// Gets the IVirtualMachineScaleSetVMExtensionsOperations. + /// Gets the IVirtualMachineScaleSetVMExtensionsOperations /// IVirtualMachineScaleSetVMExtensionsOperations VirtualMachineScaleSetVMExtensions { get; } /// - /// Gets the IVirtualMachineScaleSetVMRunCommandsOperations. + /// Gets the IVirtualMachineScaleSetVMRunCommandsOperations /// IVirtualMachineScaleSetVMRunCommandsOperations VirtualMachineScaleSetVMRunCommands { get; } /// - /// Gets the IVirtualMachineExtensionsOperations. + /// Gets the IVirtualMachineExtensionsOperations /// IVirtualMachineExtensionsOperations VirtualMachineExtensions { get; } /// - /// Gets the IDiskAccessesOperations. + /// Gets the IDiskAccessesOperations /// IDiskAccessesOperations DiskAccesses { get; } /// - /// Gets the IDiskEncryptionSetsOperations. + /// Gets the IDiskEncryptionSetsOperations /// IDiskEncryptionSetsOperations DiskEncryptionSets { get; } /// - /// Gets the IDisksOperations. + /// Gets the IDisksOperations /// IDisksOperations Disks { get; } /// - /// Gets the ISnapshotsOperations. + /// Gets the ISnapshotsOperations /// ISnapshotsOperations Snapshots { get; } /// - /// Gets the IDiskRestorePointOperations. + /// Gets the IDiskRestorePointOperations /// IDiskRestorePointOperations DiskRestorePoint { get; } /// - /// Gets the IGalleriesOperations. + /// Gets the IGalleriesOperations /// IGalleriesOperations Galleries { get; } /// - /// Gets the ICommunityGalleriesOperations. + /// Gets the ICommunityGalleriesOperations /// ICommunityGalleriesOperations CommunityGalleries { get; } /// - /// Gets the ICommunityGalleryImagesOperations. + /// Gets the ICommunityGalleryImagesOperations /// ICommunityGalleryImagesOperations CommunityGalleryImages { get; } /// - /// Gets the ICommunityGalleryImageVersionsOperations. + /// Gets the ICommunityGalleryImageVersionsOperations /// ICommunityGalleryImageVersionsOperations CommunityGalleryImageVersions { get; } /// - /// Gets the ISharedGalleriesOperations. + /// Gets the ISharedGalleriesOperations /// ISharedGalleriesOperations SharedGalleries { get; } /// - /// Gets the ISharedGalleryImagesOperations. + /// Gets the ISharedGalleryImagesOperations /// ISharedGalleryImagesOperations SharedGalleryImages { get; } /// - /// Gets the ISharedGalleryImageVersionsOperations. + /// Gets the ISharedGalleryImageVersionsOperations /// ISharedGalleryImageVersionsOperations SharedGalleryImageVersions { get; } /// - /// Gets the IGalleryApplicationsOperations. + /// Gets the IGalleryApplicationsOperations /// IGalleryApplicationsOperations GalleryApplications { get; } /// - /// Gets the IGalleryApplicationVersionsOperations. + /// Gets the IGalleryApplicationVersionsOperations /// IGalleryApplicationVersionsOperations GalleryApplicationVersions { get; } /// - /// Gets the IGalleryImagesOperations. + /// Gets the IGalleryImagesOperations /// IGalleryImagesOperations GalleryImages { get; } /// - /// Gets the IGalleryImageVersionsOperations. + /// Gets the IGalleryImageVersionsOperations /// IGalleryImageVersionsOperations GalleryImageVersions { get; } /// - /// Gets the IGalleryInVMAccessControlProfilesOperations. + /// Gets the IGalleryInVMAccessControlProfilesOperations /// IGalleryInVMAccessControlProfilesOperations GalleryInVMAccessControlProfiles { get; } /// - /// Gets the IGalleryInVMAccessControlProfileVersionsOperations. + /// Gets the IGalleryInVMAccessControlProfileVersionsOperations /// IGalleryInVMAccessControlProfileVersionsOperations GalleryInVMAccessControlProfileVersions { get; } /// - /// Gets the IGallerySharingProfileOperations. + /// Gets the IGallerySharingProfileOperations /// IGallerySharingProfileOperations GallerySharingProfile { get; } /// - /// Gets the ISoftDeletedResourceOperations. + /// Gets the ISoftDeletedResourceOperations /// ISoftDeletedResourceOperations SoftDeletedResource { get; } /// - /// Gets the IResourceSkusOperations. + /// Gets the IResourceSkusOperations /// IResourceSkusOperations ResourceSkus { get; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IDedicatedHostGroupsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IDedicatedHostGroupsOperations.cs index b82dd2613d74..903a0cbb49d5 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IDedicatedHostGroupsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IDedicatedHostGroupsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DedicatedHostGroupsOperations operations. @@ -25,9 +15,14 @@ public partial interface IDedicatedHostGroupsOperations { /// /// Lists all of the dedicated host groups in the subscription. Use the - /// nextLink property in the response to get the next page of dedicated - /// host groups. + /// nextLink property in the response to get the next page of dedicated host + /// groups. /// + /// + /// Lists all of the dedicated host groups in the subscription. Use the + /// nextLink property in the response to get the next page of dedicated host + /// groups. + /// /// /// The headers that will be added to request. /// @@ -40,15 +35,18 @@ public partial interface IDedicatedHostGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all of the dedicated host groups in the specified resource - /// group. Use the nextLink property in the response to get the next - /// page of dedicated host groups. + /// Lists all of the dedicated host groups in the specified resource group. Use + /// the nextLink property in the response to get the next page of dedicated + /// host groups. /// + /// + /// Lists all of the dedicated host groups in the specified resource group. Use + /// the nextLink property in the response to get the next page of dedicated + /// host groups. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -64,13 +62,14 @@ public partial interface IDedicatedHostGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves information about a dedicated host group. /// + /// + /// Retrieves information about a dedicated host group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -78,11 +77,9 @@ public partial interface IDedicatedHostGroupsOperations /// The name of the dedicated host group. /// /// - /// The expand expression to apply on the operation. 'InstanceView' - /// will retrieve the list of instance views of the dedicated hosts - /// under the dedicated host group. 'UserData' is not supported for - /// dedicated host group. Possible values include: 'instanceView', - /// 'userData', 'resiliencyView' + /// The expand expression to apply on the operation. 'InstanceView' will + /// retrieve the list of instance views of the dedicated hosts under the + /// dedicated host group. 'UserData' is not supported for dedicated host group. /// /// /// The headers that will be added to request. @@ -96,15 +93,18 @@ public partial interface IDedicatedHostGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, InstanceViewTypes? expand = default(InstanceViewTypes?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, InstanceViewTypes? expand = default(InstanceViewTypes?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or update a dedicated host group. For details of Dedicated - /// Host and Dedicated Host Groups please see [Dedicated Host - /// Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + /// Create or update a dedicated host group. For details of Dedicated Host and + /// Dedicated Host Groups please see [Dedicated Host Documentation] + /// (https://go.microsoft.com/fwlink/?linkid=2082596) /// + /// + /// Create or update a dedicated host group. For details of Dedicated Host and + /// Dedicated Host Groups please see [Dedicated Host Documentation] + /// (https://go.microsoft.com/fwlink/?linkid=2082596) + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -126,13 +126,14 @@ public partial interface IDedicatedHostGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, DedicatedHostGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, DedicatedHostGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update an dedicated host group. /// + /// + /// Update an dedicated host group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -154,13 +155,14 @@ public partial interface IDedicatedHostGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, DedicatedHostGroupUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, DedicatedHostGroupUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a dedicated host group. /// + /// + /// Delete a dedicated host group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -176,15 +178,18 @@ public partial interface IDedicatedHostGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all of the dedicated host groups in the subscription. Use the - /// nextLink property in the response to get the next page of dedicated - /// host groups. + /// nextLink property in the response to get the next page of dedicated host + /// groups. /// + /// + /// Lists all of the dedicated host groups in the subscription. Use the + /// nextLink property in the response to get the next page of dedicated host + /// groups. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -200,15 +205,18 @@ public partial interface IDedicatedHostGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all of the dedicated host groups in the specified resource - /// group. Use the nextLink property in the response to get the next - /// page of dedicated host groups. + /// Lists all of the dedicated host groups in the specified resource group. Use + /// the nextLink property in the response to get the next page of dedicated + /// host groups. /// + /// + /// Lists all of the dedicated host groups in the specified resource group. Use + /// the nextLink property in the response to get the next page of dedicated + /// host groups. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -224,9 +232,7 @@ public partial interface IDedicatedHostGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IDedicatedHostsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IDedicatedHostsOperations.cs index 85056d13eaf5..61a9e3fafc73 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IDedicatedHostsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IDedicatedHostsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DedicatedHostsOperations operations. @@ -24,10 +14,15 @@ namespace Microsoft.Azure.Management.Compute public partial interface IDedicatedHostsOperations { /// - /// Lists all of the dedicated hosts in the specified dedicated host - /// group. Use the nextLink property in the response to get the next - /// page of dedicated hosts. + /// Lists all of the dedicated hosts in the specified dedicated host group. Use + /// the nextLink property in the response to get the next page of dedicated + /// hosts. /// + /// + /// Lists all of the dedicated hosts in the specified dedicated host group. Use + /// the nextLink property in the response to get the next page of dedicated + /// hosts. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -46,13 +41,14 @@ public partial interface IDedicatedHostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByHostGroupWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByHostGroupWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves information about a dedicated host. /// + /// + /// Retrieves information about a dedicated host. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -63,10 +59,9 @@ public partial interface IDedicatedHostsOperations /// The name of the dedicated host. /// /// - /// The expand expression to apply on the operation. 'InstanceView' - /// will retrieve the list of instance views of the dedicated host. - /// 'UserData' is not supported for dedicated host. Possible values - /// include: 'instanceView', 'userData', 'resiliencyView' + /// The expand expression to apply on the operation. 'InstanceView' will + /// retrieve the list of instance views of the dedicated host. 'UserData' is + /// not supported for dedicated host. /// /// /// The headers that will be added to request. @@ -80,13 +75,14 @@ public partial interface IDedicatedHostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, InstanceViewTypes? expand = default(InstanceViewTypes?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, InstanceViewTypes? expand = default(InstanceViewTypes?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a dedicated host . /// + /// + /// Create or update a dedicated host . + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -111,13 +107,14 @@ public partial interface IDedicatedHostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, DedicatedHost parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, DedicatedHost parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a dedicated host . /// + /// + /// Update a dedicated host . + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -142,13 +139,14 @@ public partial interface IDedicatedHostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, DedicatedHostUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, DedicatedHostUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a dedicated host. /// + /// + /// Delete a dedicated host. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -167,15 +165,18 @@ public partial interface IDedicatedHostsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all available dedicated host sizes to which the specified - /// dedicated host can be resized. NOTE: The dedicated host sizes - /// provided can be used to only scale up the existing dedicated host. + /// Lists all available dedicated host sizes to which the specified dedicated + /// host can be resized. NOTE: The dedicated host sizes provided can be used to + /// only scale up the existing dedicated host. /// + /// + /// Lists all available dedicated host sizes to which the specified dedicated + /// host can be resized. NOTE: The dedicated host sizes provided can be used to + /// only scale up the existing dedicated host. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -197,19 +198,24 @@ public partial interface IDedicatedHostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAvailableSizesWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAvailableSizesWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Redeploy the dedicated host. The operation will complete - /// successfully once the dedicated host has migrated to a new node and - /// is running. To determine the health of VMs deployed on the - /// dedicated host after the redeploy check the Resource Health Center - /// in the Azure Portal. Please refer to + /// Redeploy the dedicated host. The operation will complete successfully once + /// the dedicated host has migrated to a new node and is running. To determine + /// the health of VMs deployed on the dedicated host after the redeploy check + /// the Resource Health Center in the Azure Portal. Please refer to /// https://docs.microsoft.com/azure/service-health/resource-health-overview /// for more details. /// + /// + /// Redeploy the dedicated host. The operation will complete successfully once + /// the dedicated host has migrated to a new node and is running. To determine + /// the health of VMs deployed on the dedicated host after the redeploy check + /// the Resource Health Center in the Azure Portal. Please refer to + /// https://docs.microsoft.com/azure/service-health/resource-health-overview + /// for more details. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -228,19 +234,24 @@ public partial interface IDedicatedHostsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> RedeployWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> RedeployWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Restart the dedicated host. The operation will complete - /// successfully once the dedicated host has restarted and is running. - /// To determine the health of VMs deployed on the dedicated host after - /// the restart check the Resource Health Center in the Azure Portal. - /// Please refer to + /// Restart the dedicated host. The operation will complete successfully once + /// the dedicated host has restarted and is running. To determine the health of + /// VMs deployed on the dedicated host after the restart check the Resource + /// Health Center in the Azure Portal. Please refer to /// https://docs.microsoft.com/azure/service-health/resource-health-overview /// for more details. /// + /// + /// Restart the dedicated host. The operation will complete successfully once + /// the dedicated host has restarted and is running. To determine the health of + /// VMs deployed on the dedicated host after the restart check the Resource + /// Health Center in the Azure Portal. Please refer to + /// https://docs.microsoft.com/azure/service-health/resource-health-overview + /// for more details. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -259,13 +270,14 @@ public partial interface IDedicatedHostsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> RestartWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> RestartWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a dedicated host . /// + /// + /// Create or update a dedicated host . + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -290,13 +302,14 @@ public partial interface IDedicatedHostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, DedicatedHost parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, DedicatedHost parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a dedicated host . /// + /// + /// Update a dedicated host . + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -321,13 +334,14 @@ public partial interface IDedicatedHostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, DedicatedHostUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, DedicatedHostUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a dedicated host. /// + /// + /// Delete a dedicated host. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -346,19 +360,24 @@ public partial interface IDedicatedHostsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Redeploy the dedicated host. The operation will complete - /// successfully once the dedicated host has migrated to a new node and - /// is running. To determine the health of VMs deployed on the - /// dedicated host after the redeploy check the Resource Health Center - /// in the Azure Portal. Please refer to + /// Redeploy the dedicated host. The operation will complete successfully once + /// the dedicated host has migrated to a new node and is running. To determine + /// the health of VMs deployed on the dedicated host after the redeploy check + /// the Resource Health Center in the Azure Portal. Please refer to /// https://docs.microsoft.com/azure/service-health/resource-health-overview /// for more details. /// + /// + /// Redeploy the dedicated host. The operation will complete successfully once + /// the dedicated host has migrated to a new node and is running. To determine + /// the health of VMs deployed on the dedicated host after the redeploy check + /// the Resource Health Center in the Azure Portal. Please refer to + /// https://docs.microsoft.com/azure/service-health/resource-health-overview + /// for more details. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -377,19 +396,24 @@ public partial interface IDedicatedHostsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginRedeployWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginRedeployWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Restart the dedicated host. The operation will complete - /// successfully once the dedicated host has restarted and is running. - /// To determine the health of VMs deployed on the dedicated host after - /// the restart check the Resource Health Center in the Azure Portal. - /// Please refer to + /// Restart the dedicated host. The operation will complete successfully once + /// the dedicated host has restarted and is running. To determine the health of + /// VMs deployed on the dedicated host after the restart check the Resource + /// Health Center in the Azure Portal. Please refer to /// https://docs.microsoft.com/azure/service-health/resource-health-overview /// for more details. /// + /// + /// Restart the dedicated host. The operation will complete successfully once + /// the dedicated host has restarted and is running. To determine the health of + /// VMs deployed on the dedicated host after the restart check the Resource + /// Health Center in the Azure Portal. Please refer to + /// https://docs.microsoft.com/azure/service-health/resource-health-overview + /// for more details. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -408,15 +432,18 @@ public partial interface IDedicatedHostsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginRestartWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginRestartWithHttpMessagesAsync(string resourceGroupName, string hostGroupName, string hostName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all of the dedicated hosts in the specified dedicated host - /// group. Use the nextLink property in the response to get the next - /// page of dedicated hosts. + /// Lists all of the dedicated hosts in the specified dedicated host group. Use + /// the nextLink property in the response to get the next page of dedicated + /// hosts. /// + /// + /// Lists all of the dedicated hosts in the specified dedicated host group. Use + /// the nextLink property in the response to get the next page of dedicated + /// hosts. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -432,9 +459,7 @@ public partial interface IDedicatedHostsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByHostGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByHostGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IDiskAccessesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IDiskAccessesOperations.cs index a07de0adf354..9192a70a1e65 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IDiskAccessesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IDiskAccessesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DiskAccessesOperations operations. @@ -26,6 +16,9 @@ public partial interface IDiskAccessesOperations /// /// Lists all the disk access resources under a subscription. /// + /// + /// Lists all the disk access resources under a subscription. + /// /// /// The headers that will be added to request. /// @@ -38,13 +31,14 @@ public partial interface IDiskAccessesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the disk access resources under a resource group. /// + /// + /// Lists all the disk access resources under a resource group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -60,21 +54,22 @@ public partial interface IDiskAccessesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets information about a disk access resource. /// + /// + /// Gets information about a disk access resource. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The - /// name can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// The headers that will be added to request. @@ -88,25 +83,25 @@ public partial interface IDiskAccessesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a disk access resource /// + /// + /// Creates or updates a disk access resource + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The - /// name can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// - /// disk access object supplied in the body of the Put disk access - /// operation. + /// disk access object supplied in the body of the Put disk access operation. /// /// /// The headers that will be added to request. @@ -120,21 +115,22 @@ public partial interface IDiskAccessesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, DiskAccess diskAccess, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, DiskAccess diskAccess, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates (patches) a disk access resource. /// + /// + /// Updates (patches) a disk access resource. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The - /// name can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// Resource tags @@ -151,21 +147,22 @@ public partial interface IDiskAccessesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a disk access resource. /// + /// + /// Deletes a disk access resource. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The - /// name can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// The headers that will be added to request. @@ -176,22 +173,24 @@ public partial interface IDiskAccessesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// List information about private endpoint connections under a disk - /// access resource + /// List information about private endpoint connections under a disk access + /// resource /// + /// + /// List information about private endpoint connections under a disk access + /// resource + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The - /// name can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// The headers that will be added to request. @@ -205,22 +204,24 @@ public partial interface IDiskAccessesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListPrivateEndpointConnectionsWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListPrivateEndpointConnectionsWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets information about a private endpoint connection under a disk - /// access resource. + /// Gets information about a private endpoint connection under a disk access + /// resource. /// + /// + /// Gets information about a private endpoint connection under a disk access + /// resource. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The - /// name can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// The name of the private endpoint connection. @@ -237,30 +238,31 @@ public partial interface IDiskAccessesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Approve or reject a private endpoint connection under disk access - /// resource, this can't be used to create a new private endpoint - /// connection. + /// Approve or reject a private endpoint connection under disk access resource, + /// this can't be used to create a new private endpoint connection. /// + /// + /// Approve or reject a private endpoint connection under disk access resource, + /// this can't be used to create a new private endpoint connection. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The - /// name can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// The name of the private endpoint connection. /// /// - /// A collection of information about the state of the connection - /// between DiskAccess and Virtual Network. + /// A collection of information about the state of the connection between + /// DiskAccess and Virtual Network. /// /// /// The headers that will be added to request. @@ -274,21 +276,22 @@ public partial interface IDiskAccessesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, PrivateLinkServiceConnectionState privateLinkServiceConnectionState, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a private endpoint connection under a disk access resource. /// + /// + /// Deletes a private endpoint connection under a disk access resource. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The - /// name can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// The name of the private endpoint connection. @@ -302,21 +305,22 @@ public partial interface IDiskAccessesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the private link resources possible under disk access resource /// + /// + /// Gets the private link resources possible under disk access resource + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The - /// name can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// The headers that will be added to request. @@ -330,25 +334,25 @@ public partial interface IDiskAccessesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a disk access resource /// + /// + /// Creates or updates a disk access resource + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The - /// name can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// - /// disk access object supplied in the body of the Put disk access - /// operation. + /// disk access object supplied in the body of the Put disk access operation. /// /// /// The headers that will be added to request. @@ -362,21 +366,22 @@ public partial interface IDiskAccessesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, DiskAccess diskAccess, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, DiskAccess diskAccess, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates (patches) a disk access resource. /// + /// + /// Updates (patches) a disk access resource. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The - /// name can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// Resource tags @@ -393,21 +398,22 @@ public partial interface IDiskAccessesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a disk access resource. /// + /// + /// Deletes a disk access resource. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The - /// name can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// The headers that will be added to request. @@ -418,30 +424,31 @@ public partial interface IDiskAccessesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Approve or reject a private endpoint connection under disk access - /// resource, this can't be used to create a new private endpoint - /// connection. + /// Approve or reject a private endpoint connection under disk access resource, + /// this can't be used to create a new private endpoint connection. /// + /// + /// Approve or reject a private endpoint connection under disk access resource, + /// this can't be used to create a new private endpoint connection. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The - /// name can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// The name of the private endpoint connection. /// /// - /// A collection of information about the state of the connection - /// between DiskAccess and Virtual Network. + /// A collection of information about the state of the connection between + /// DiskAccess and Virtual Network. /// /// /// The headers that will be added to request. @@ -455,21 +462,22 @@ public partial interface IDiskAccessesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, PrivateLinkServiceConnectionState privateLinkServiceConnectionState, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a private endpoint connection under a disk access resource. /// + /// + /// Deletes a private endpoint connection under a disk access resource. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk access resource that is being created. The - /// name can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk access resource that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// The name of the private endpoint connection. @@ -483,13 +491,14 @@ public partial interface IDiskAccessesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteAPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string diskAccessName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the disk access resources under a subscription. /// + /// + /// Lists all the disk access resources under a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -505,13 +514,14 @@ public partial interface IDiskAccessesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the disk access resources under a resource group. /// + /// + /// Lists all the disk access resources under a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -527,14 +537,16 @@ public partial interface IDiskAccessesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// List information about private endpoint connections under a disk - /// access resource + /// List information about private endpoint connections under a disk access + /// resource /// + /// + /// List information about private endpoint connections under a disk access + /// resource + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -550,9 +562,7 @@ public partial interface IDiskAccessesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListPrivateEndpointConnectionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListPrivateEndpointConnectionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IDiskEncryptionSetsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IDiskEncryptionSetsOperations.cs index f6d4d2d6cb71..a3e9e98e1686 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IDiskEncryptionSetsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IDiskEncryptionSetsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DiskEncryptionSetsOperations operations. @@ -26,6 +16,9 @@ public partial interface IDiskEncryptionSetsOperations /// /// Lists all the disk encryption sets under a subscription. /// + /// + /// Lists all the disk encryption sets under a subscription. + /// /// /// The headers that will be added to request. /// @@ -38,13 +31,14 @@ public partial interface IDiskEncryptionSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the disk encryption sets under a resource group. /// + /// + /// Lists all the disk encryption sets under a resource group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -60,21 +54,22 @@ public partial interface IDiskEncryptionSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets information about a disk encryption set. /// + /// + /// Gets information about a disk encryption set. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk encryption set that is being created. The name - /// can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// The headers that will be added to request. @@ -88,25 +83,26 @@ public partial interface IDiskEncryptionSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a disk encryption set /// + /// + /// Creates or updates a disk encryption set + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk encryption set that is being created. The name - /// can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// - /// disk encryption set object supplied in the body of the Put disk - /// encryption set operation. + /// disk encryption set object supplied in the body of the Put disk encryption + /// set operation. /// /// /// The headers that will be added to request. @@ -120,21 +116,22 @@ public partial interface IDiskEncryptionSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSet diskEncryptionSet, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSet diskEncryptionSet, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates (patches) a disk encryption set. /// + /// + /// Updates (patches) a disk encryption set. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk encryption set that is being created. The name - /// can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// disk encryption set object supplied in the body of the Patch disk @@ -152,21 +149,22 @@ public partial interface IDiskEncryptionSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a disk encryption set. /// + /// + /// Deletes a disk encryption set. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk encryption set that is being created. The name - /// can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// The headers that will be added to request. @@ -177,22 +175,22 @@ public partial interface IDiskEncryptionSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all resources that are encrypted with this disk encryption - /// set. + /// Lists all resources that are encrypted with this disk encryption set. /// + /// + /// Lists all resources that are encrypted with this disk encryption set. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk encryption set that is being created. The name - /// can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// The headers that will be added to request. @@ -206,25 +204,26 @@ public partial interface IDiskEncryptionSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAssociatedResourcesWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAssociatedResourcesWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a disk encryption set /// + /// + /// Creates or updates a disk encryption set + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk encryption set that is being created. The name - /// can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// - /// disk encryption set object supplied in the body of the Put disk - /// encryption set operation. + /// disk encryption set object supplied in the body of the Put disk encryption + /// set operation. /// /// /// The headers that will be added to request. @@ -238,21 +237,22 @@ public partial interface IDiskEncryptionSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSet diskEncryptionSet, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSet diskEncryptionSet, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates (patches) a disk encryption set. /// + /// + /// Updates (patches) a disk encryption set. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk encryption set that is being created. The name - /// can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// disk encryption set object supplied in the body of the Patch disk @@ -270,21 +270,22 @@ public partial interface IDiskEncryptionSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a disk encryption set. /// + /// + /// Deletes a disk encryption set. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the disk encryption set that is being created. The name - /// can't be changed after the disk encryption set is created. - /// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The - /// maximum name length is 80 characters. + /// The name of the disk encryption set that is being created. The name can't + /// be changed after the disk encryption set is created. Supported characters + /// for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 + /// characters. /// /// /// The headers that will be added to request. @@ -295,13 +296,14 @@ public partial interface IDiskEncryptionSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string diskEncryptionSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the disk encryption sets under a subscription. /// + /// + /// Lists all the disk encryption sets under a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -317,13 +319,14 @@ public partial interface IDiskEncryptionSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the disk encryption sets under a resource group. /// + /// + /// Lists all the disk encryption sets under a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -339,14 +342,14 @@ public partial interface IDiskEncryptionSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all resources that are encrypted with this disk encryption - /// set. + /// Lists all resources that are encrypted with this disk encryption set. /// + /// + /// Lists all resources that are encrypted with this disk encryption set. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -362,9 +365,7 @@ public partial interface IDiskEncryptionSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAssociatedResourcesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAssociatedResourcesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IDiskRestorePointOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IDiskRestorePointOperations.cs index bc3d503001ca..d325f91c1b7a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IDiskRestorePointOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IDiskRestorePointOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DiskRestorePointOperations operations. @@ -26,16 +16,18 @@ public partial interface IDiskRestorePointOperations /// /// Lists diskRestorePoints under a vmRestorePoint. /// + /// + /// Lists diskRestorePoints under a vmRestorePoint. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the restore point collection that the disk restore - /// point belongs. + /// The name of the restore point collection that the disk restore point + /// belongs. /// /// - /// The name of the vm restore point that the disk disk restore point - /// belongs. + /// The name of the vm restore point that the disk disk restore point belongs. /// /// /// The headers that will be added to request. @@ -49,23 +41,23 @@ public partial interface IDiskRestorePointOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByRestorePointWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByRestorePointWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get disk restorePoint resource /// + /// + /// Get disk restorePoint resource + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the restore point collection that the disk restore - /// point belongs. + /// The name of the restore point collection that the disk restore point + /// belongs. /// /// - /// The name of the vm restore point that the disk disk restore point - /// belongs. + /// The name of the vm restore point that the disk disk restore point belongs. /// /// /// The name of the DiskRestorePoint @@ -82,30 +74,29 @@ public partial interface IDiskRestorePointOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Grants access to a diskRestorePoint. /// + /// + /// Grants access to a diskRestorePoint. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the restore point collection that the disk restore - /// point belongs. + /// The name of the restore point collection that the disk restore point + /// belongs. /// /// - /// The name of the vm restore point that the disk disk restore point - /// belongs. + /// The name of the vm restore point that the disk disk restore point belongs. /// /// /// The name of the DiskRestorePoint /// /// - /// Access data object supplied in the body of the get disk access - /// operation. + /// Access data object supplied in the body of the get disk access operation. /// /// /// The headers that will be added to request. @@ -119,23 +110,23 @@ public partial interface IDiskRestorePointOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GrantAccessWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, GrantAccessData grantAccessData, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GrantAccessWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, GrantAccessData grantAccessData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Revokes access to a diskRestorePoint. /// + /// + /// Revokes access to a diskRestorePoint. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the restore point collection that the disk restore - /// point belongs. + /// The name of the restore point collection that the disk restore point + /// belongs. /// /// - /// The name of the vm restore point that the disk disk restore point - /// belongs. + /// The name of the vm restore point that the disk disk restore point belongs. /// /// /// The name of the DiskRestorePoint @@ -149,30 +140,29 @@ public partial interface IDiskRestorePointOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task RevokeAccessWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task RevokeAccessWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Grants access to a diskRestorePoint. /// + /// + /// Grants access to a diskRestorePoint. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the restore point collection that the disk restore - /// point belongs. + /// The name of the restore point collection that the disk restore point + /// belongs. /// /// - /// The name of the vm restore point that the disk disk restore point - /// belongs. + /// The name of the vm restore point that the disk disk restore point belongs. /// /// /// The name of the DiskRestorePoint /// /// - /// Access data object supplied in the body of the get disk access - /// operation. + /// Access data object supplied in the body of the get disk access operation. /// /// /// The headers that will be added to request. @@ -186,23 +176,23 @@ public partial interface IDiskRestorePointOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGrantAccessWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, GrantAccessData grantAccessData, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGrantAccessWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, GrantAccessData grantAccessData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Revokes access to a diskRestorePoint. /// + /// + /// Revokes access to a diskRestorePoint. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the restore point collection that the disk restore - /// point belongs. + /// The name of the restore point collection that the disk restore point + /// belongs. /// /// - /// The name of the vm restore point that the disk disk restore point - /// belongs. + /// The name of the vm restore point that the disk disk restore point belongs. /// /// /// The name of the DiskRestorePoint @@ -216,13 +206,14 @@ public partial interface IDiskRestorePointOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRevokeAccessWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginRevokeAccessWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string vmRestorePointName, string diskRestorePointName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists diskRestorePoints under a vmRestorePoint. /// + /// + /// Lists diskRestorePoints under a vmRestorePoint. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -238,9 +229,7 @@ public partial interface IDiskRestorePointOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByRestorePointNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByRestorePointNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IDisksOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IDisksOperations.cs index b06f764c73e3..f3bae40770f6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IDisksOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IDisksOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DisksOperations operations. @@ -26,6 +16,9 @@ public partial interface IDisksOperations /// /// Lists all the disks under a subscription. /// + /// + /// Lists all the disks under a subscription. + /// /// /// The headers that will be added to request. /// @@ -38,13 +31,14 @@ public partial interface IDisksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the disks under a resource group. /// + /// + /// Lists all the disks under a resource group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -60,21 +54,21 @@ public partial interface IDisksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets information about a disk. /// + /// + /// Gets information about a disk. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't - /// be changed after the disk is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// /// /// The headers that will be added to request. @@ -88,21 +82,21 @@ public partial interface IDisksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string diskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string diskName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a disk. /// + /// + /// Creates or updates a disk. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't - /// be changed after the disk is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// /// /// Disk object supplied in the body of the Put disk operation. @@ -119,21 +113,21 @@ public partial interface IDisksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskName, Disk disk, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskName, Disk disk, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates (patches) a disk. /// + /// + /// Updates (patches) a disk. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't - /// be changed after the disk is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// /// /// Disk object supplied in the body of the Patch disk operation. @@ -150,21 +144,21 @@ public partial interface IDisksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string diskName, DiskUpdate disk, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string diskName, DiskUpdate disk, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a disk. /// + /// + /// Deletes a disk. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't - /// be changed after the disk is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// /// /// The headers that will be added to request. @@ -175,25 +169,24 @@ public partial interface IDisksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string diskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string diskName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Grants access to a disk. /// + /// + /// Grants access to a disk. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't - /// be changed after the disk is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// /// - /// Access data object supplied in the body of the get disk access - /// operation. + /// Access data object supplied in the body of the get disk access operation. /// /// /// The headers that will be added to request. @@ -207,21 +200,21 @@ public partial interface IDisksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GrantAccessWithHttpMessagesAsync(string resourceGroupName, string diskName, GrantAccessData grantAccessData, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GrantAccessWithHttpMessagesAsync(string resourceGroupName, string diskName, GrantAccessData grantAccessData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Revokes access to a disk. /// + /// + /// Revokes access to a disk. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't - /// be changed after the disk is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// /// /// The headers that will be added to request. @@ -232,21 +225,21 @@ public partial interface IDisksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task RevokeAccessWithHttpMessagesAsync(string resourceGroupName, string diskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task RevokeAccessWithHttpMessagesAsync(string resourceGroupName, string diskName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a disk. /// + /// + /// Creates or updates a disk. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't - /// be changed after the disk is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// /// /// Disk object supplied in the body of the Put disk operation. @@ -263,21 +256,21 @@ public partial interface IDisksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskName, Disk disk, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string diskName, Disk disk, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates (patches) a disk. /// + /// + /// Updates (patches) a disk. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't - /// be changed after the disk is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// /// /// Disk object supplied in the body of the Patch disk operation. @@ -294,21 +287,21 @@ public partial interface IDisksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string diskName, DiskUpdate disk, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string diskName, DiskUpdate disk, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a disk. /// + /// + /// Deletes a disk. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't - /// be changed after the disk is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// /// /// The headers that will be added to request. @@ -319,25 +312,24 @@ public partial interface IDisksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string diskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string diskName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Grants access to a disk. /// + /// + /// Grants access to a disk. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't - /// be changed after the disk is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// /// - /// Access data object supplied in the body of the get disk access - /// operation. + /// Access data object supplied in the body of the get disk access operation. /// /// /// The headers that will be added to request. @@ -351,21 +343,21 @@ public partial interface IDisksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGrantAccessWithHttpMessagesAsync(string resourceGroupName, string diskName, GrantAccessData grantAccessData, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGrantAccessWithHttpMessagesAsync(string resourceGroupName, string diskName, GrantAccessData grantAccessData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Revokes access to a disk. /// + /// + /// Revokes access to a disk. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the managed disk that is being created. The name can't - /// be changed after the disk is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 - /// characters. + /// The name of the managed disk that is being created. The name can't be + /// changed after the disk is created. Supported characters for the name are + /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// /// /// The headers that will be added to request. @@ -376,13 +368,14 @@ public partial interface IDisksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRevokeAccessWithHttpMessagesAsync(string resourceGroupName, string diskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginRevokeAccessWithHttpMessagesAsync(string resourceGroupName, string diskName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the disks under a subscription. /// + /// + /// Lists all the disks under a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -398,13 +391,14 @@ public partial interface IDisksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all the disks under a resource group. /// + /// + /// Lists all the disks under a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -420,9 +414,7 @@ public partial interface IDisksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IGalleriesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IGalleriesOperations.cs index 4dd5b098dbe1..037647ad15c4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IGalleriesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IGalleriesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// GalleriesOperations operations. @@ -26,6 +16,9 @@ public partial interface IGalleriesOperations /// /// List galleries under a subscription. /// + /// + /// List galleries under a subscription. + /// /// /// The headers that will be added to request. /// @@ -38,13 +31,14 @@ public partial interface IGalleriesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List galleries under a resource group. /// + /// + /// List galleries under a resource group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -60,13 +54,14 @@ public partial interface IGalleriesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves information about a Shared Image Gallery. /// + /// + /// Retrieves information about a Shared Image Gallery. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -74,12 +69,10 @@ public partial interface IGalleriesOperations /// The name of the Shared Image Gallery. /// /// - /// The select expression to apply on the operation. Possible values - /// include: 'Permissions' + /// The select expression to apply on the operation. /// /// - /// The expand query option to apply on the operation. Possible values - /// include: 'SharingProfile/Groups' + /// The expand query option to apply on the operation. /// /// /// The headers that will be added to request. @@ -93,13 +86,14 @@ public partial interface IGalleriesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string select = default(string), string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string select = default(string), string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a Shared Image Gallery. /// + /// + /// Create or update a Shared Image Gallery. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -107,8 +101,7 @@ public partial interface IGalleriesOperations /// The name of the Shared Image Gallery. /// /// - /// Parameters supplied to the create or update Shared Image Gallery - /// operation. + /// Parameters supplied to the create or update Shared Image Gallery operation. /// /// /// The headers that will be added to request. @@ -122,13 +115,14 @@ public partial interface IGalleriesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, Gallery gallery, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, Gallery gallery, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a Shared Image Gallery. /// + /// + /// Update a Shared Image Gallery. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -150,13 +144,14 @@ public partial interface IGalleriesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, GalleryUpdate gallery, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, GalleryUpdate gallery, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a Shared Image Gallery. /// + /// + /// Delete a Shared Image Gallery. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -172,13 +167,14 @@ public partial interface IGalleriesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a Shared Image Gallery. /// + /// + /// Create or update a Shared Image Gallery. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -186,8 +182,7 @@ public partial interface IGalleriesOperations /// The name of the Shared Image Gallery. /// /// - /// Parameters supplied to the create or update Shared Image Gallery - /// operation. + /// Parameters supplied to the create or update Shared Image Gallery operation. /// /// /// The headers that will be added to request. @@ -201,13 +196,14 @@ public partial interface IGalleriesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, Gallery gallery, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, Gallery gallery, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a Shared Image Gallery. /// + /// + /// Update a Shared Image Gallery. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -229,13 +225,14 @@ public partial interface IGalleriesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, GalleryUpdate gallery, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, GalleryUpdate gallery, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a Shared Image Gallery. /// + /// + /// Delete a Shared Image Gallery. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -251,13 +248,14 @@ public partial interface IGalleriesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List galleries under a subscription. /// + /// + /// List galleries under a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -273,13 +271,14 @@ public partial interface IGalleriesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List galleries under a resource group. /// + /// + /// List galleries under a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -295,9 +294,7 @@ public partial interface IGalleriesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IGalleryApplicationVersionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IGalleryApplicationVersionsOperations.cs index 6a03594d955b..61c979821708 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IGalleryApplicationVersionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IGalleryApplicationVersionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// GalleryApplicationVersionsOperations operations. @@ -24,9 +14,11 @@ namespace Microsoft.Azure.Management.Compute public partial interface IGalleryApplicationVersionsOperations { /// - /// List gallery Application Versions in a gallery Application - /// Definition. + /// List gallery Application Versions in a gallery Application Definition. /// + /// + /// List gallery Application Versions in a gallery Application Definition. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -48,13 +40,14 @@ public partial interface IGalleryApplicationVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByGalleryApplicationWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByGalleryApplicationWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves information about a gallery Application Version. /// + /// + /// Retrieves information about a gallery Application Version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -68,8 +61,7 @@ public partial interface IGalleryApplicationVersionsOperations /// The name of the gallery Application Version to be retrieved. /// /// - /// The expand expression to apply on the operation. Possible values - /// include: 'ReplicationStatus', 'UefiSettings' + /// The expand expression to apply on the operation. /// /// /// The headers that will be added to request. @@ -83,13 +75,14 @@ public partial interface IGalleryApplicationVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a gallery Application Version. /// + /// + /// Create or update a gallery Application Version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -103,8 +96,8 @@ public partial interface IGalleryApplicationVersionsOperations /// The name of the gallery Application Version to be retrieved. /// /// - /// Parameters supplied to the create or update gallery Application - /// Version operation. + /// Parameters supplied to the create or update gallery Application Version + /// operation. /// /// /// The headers that will be added to request. @@ -118,13 +111,14 @@ public partial interface IGalleryApplicationVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersion galleryApplicationVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersion galleryApplicationVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a gallery Application Version. /// + /// + /// Update a gallery Application Version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -138,8 +132,7 @@ public partial interface IGalleryApplicationVersionsOperations /// The name of the gallery Application Version to be retrieved. /// /// - /// Parameters supplied to the update gallery Application Version - /// operation. + /// Parameters supplied to the update gallery Application Version operation. /// /// /// The headers that will be added to request. @@ -153,13 +146,14 @@ public partial interface IGalleryApplicationVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a gallery Application Version. /// + /// + /// Delete a gallery Application Version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -181,13 +175,14 @@ public partial interface IGalleryApplicationVersionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a gallery Application Version. /// + /// + /// Create or update a gallery Application Version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -201,8 +196,8 @@ public partial interface IGalleryApplicationVersionsOperations /// The name of the gallery Application Version to be retrieved. /// /// - /// Parameters supplied to the create or update gallery Application - /// Version operation. + /// Parameters supplied to the create or update gallery Application Version + /// operation. /// /// /// The headers that will be added to request. @@ -216,13 +211,14 @@ public partial interface IGalleryApplicationVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersion galleryApplicationVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersion galleryApplicationVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a gallery Application Version. /// + /// + /// Update a gallery Application Version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -236,8 +232,7 @@ public partial interface IGalleryApplicationVersionsOperations /// The name of the gallery Application Version to be retrieved. /// /// - /// Parameters supplied to the update gallery Application Version - /// operation. + /// Parameters supplied to the update gallery Application Version operation. /// /// /// The headers that will be added to request. @@ -251,13 +246,14 @@ public partial interface IGalleryApplicationVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a gallery Application Version. /// + /// + /// Delete a gallery Application Version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -279,14 +275,14 @@ public partial interface IGalleryApplicationVersionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, string galleryApplicationVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// List gallery Application Versions in a gallery Application - /// Definition. + /// List gallery Application Versions in a gallery Application Definition. /// + /// + /// List gallery Application Versions in a gallery Application Definition. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -302,9 +298,7 @@ public partial interface IGalleryApplicationVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByGalleryApplicationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByGalleryApplicationNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IGalleryApplicationsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IGalleryApplicationsOperations.cs index ae727113ed53..635f57b0fc72 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IGalleryApplicationsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IGalleryApplicationsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// GalleryApplicationsOperations operations. @@ -26,6 +16,9 @@ public partial interface IGalleryApplicationsOperations /// /// List gallery Application Definitions in a gallery. /// + /// + /// List gallery Application Definitions in a gallery. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -44,13 +37,14 @@ public partial interface IGalleryApplicationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByGalleryWithHttpMessagesAsync(string resourceGroupName, string galleryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByGalleryWithHttpMessagesAsync(string resourceGroupName, string galleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves information about a gallery Application Definition. /// + /// + /// Retrieves information about a gallery Application Definition. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -72,13 +66,14 @@ public partial interface IGalleryApplicationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a gallery Application Definition. /// + /// + /// Create or update a gallery Application Definition. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -89,8 +84,7 @@ public partial interface IGalleryApplicationsOperations /// The name of the gallery Application Definition to be retrieved. /// /// - /// Parameters supplied to the create or update gallery Application - /// operation. + /// Parameters supplied to the create or update gallery Application operation. /// /// /// The headers that will be added to request. @@ -104,13 +98,14 @@ public partial interface IGalleryApplicationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplication galleryApplication, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplication galleryApplication, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a gallery Application Definition. /// + /// + /// Update a gallery Application Definition. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -135,13 +130,14 @@ public partial interface IGalleryApplicationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplicationUpdate galleryApplication, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplicationUpdate galleryApplication, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a gallery Application. /// + /// + /// Delete a gallery Application. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -160,13 +156,14 @@ public partial interface IGalleryApplicationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a gallery Application Definition. /// + /// + /// Create or update a gallery Application Definition. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -177,8 +174,7 @@ public partial interface IGalleryApplicationsOperations /// The name of the gallery Application Definition to be retrieved. /// /// - /// Parameters supplied to the create or update gallery Application - /// operation. + /// Parameters supplied to the create or update gallery Application operation. /// /// /// The headers that will be added to request. @@ -192,13 +188,14 @@ public partial interface IGalleryApplicationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplication galleryApplication, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplication galleryApplication, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a gallery Application Definition. /// + /// + /// Update a gallery Application Definition. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -223,13 +220,14 @@ public partial interface IGalleryApplicationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplicationUpdate galleryApplication, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, GalleryApplicationUpdate galleryApplication, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a gallery Application. /// + /// + /// Delete a gallery Application. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -248,13 +246,14 @@ public partial interface IGalleryApplicationsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryApplicationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List gallery Application Definitions in a gallery. /// + /// + /// List gallery Application Definitions in a gallery. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -270,9 +269,7 @@ public partial interface IGalleryApplicationsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByGalleryNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByGalleryNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IGalleryImageVersionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IGalleryImageVersionsOperations.cs index d0908e5ae147..f89000206d76 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IGalleryImageVersionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IGalleryImageVersionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// GalleryImageVersionsOperations operations. @@ -26,6 +16,9 @@ public partial interface IGalleryImageVersionsOperations /// /// List gallery image versions in a gallery image definition. /// + /// + /// List gallery image versions in a gallery image definition. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -47,13 +40,14 @@ public partial interface IGalleryImageVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByGalleryImageWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByGalleryImageWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves information about a gallery image version. /// + /// + /// Retrieves information about a gallery image version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -67,8 +61,7 @@ public partial interface IGalleryImageVersionsOperations /// The name of the gallery image version to be retrieved. /// /// - /// The expand expression to apply on the operation. Possible values - /// include: 'ReplicationStatus', 'UefiSettings' + /// The expand expression to apply on the operation. /// /// /// The headers that will be added to request. @@ -82,13 +75,14 @@ public partial interface IGalleryImageVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a gallery image version. /// + /// + /// Create or update a gallery image version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -117,13 +111,14 @@ public partial interface IGalleryImageVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersion galleryImageVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersion galleryImageVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a gallery image version. /// + /// + /// Update a gallery image version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -151,13 +146,14 @@ public partial interface IGalleryImageVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a gallery image version. /// + /// + /// Delete a gallery image version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -179,13 +175,14 @@ public partial interface IGalleryImageVersionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a gallery image version. /// + /// + /// Create or update a gallery image version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -214,13 +211,14 @@ public partial interface IGalleryImageVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersion galleryImageVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersion galleryImageVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a gallery image version. /// + /// + /// Update a gallery image version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -248,13 +246,14 @@ public partial interface IGalleryImageVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a gallery image version. /// + /// + /// Delete a gallery image version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -276,13 +275,14 @@ public partial interface IGalleryImageVersionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, string galleryImageVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List gallery image versions in a gallery image definition. /// + /// + /// List gallery image versions in a gallery image definition. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -298,9 +298,7 @@ public partial interface IGalleryImageVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByGalleryImageNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByGalleryImageNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IGalleryImagesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IGalleryImagesOperations.cs index 4f4228200a5b..f3a015d24714 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IGalleryImagesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IGalleryImagesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// GalleryImagesOperations operations. @@ -26,6 +16,9 @@ public partial interface IGalleryImagesOperations /// /// List gallery image definitions in a gallery. /// + /// + /// List gallery image definitions in a gallery. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -44,13 +37,14 @@ public partial interface IGalleryImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByGalleryWithHttpMessagesAsync(string resourceGroupName, string galleryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByGalleryWithHttpMessagesAsync(string resourceGroupName, string galleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves information about a gallery image definition. /// + /// + /// Retrieves information about a gallery image definition. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -72,13 +66,14 @@ public partial interface IGalleryImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a gallery image definition. /// + /// + /// Create or update a gallery image definition. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -89,8 +84,7 @@ public partial interface IGalleryImagesOperations /// The name of the gallery image definition to be retrieved. /// /// - /// Parameters supplied to the create or update gallery image - /// operation. + /// Parameters supplied to the create or update gallery image operation. /// /// /// The headers that will be added to request. @@ -104,13 +98,14 @@ public partial interface IGalleryImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, GalleryImage galleryImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, GalleryImage galleryImage, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a gallery image definition. /// + /// + /// Update a gallery image definition. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -135,13 +130,14 @@ public partial interface IGalleryImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, GalleryImageUpdate galleryImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, GalleryImageUpdate galleryImage, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a gallery image. /// + /// + /// Delete a gallery image. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -160,13 +156,14 @@ public partial interface IGalleryImagesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a gallery image definition. /// + /// + /// Create or update a gallery image definition. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -177,8 +174,7 @@ public partial interface IGalleryImagesOperations /// The name of the gallery image definition to be retrieved. /// /// - /// Parameters supplied to the create or update gallery image - /// operation. + /// Parameters supplied to the create or update gallery image operation. /// /// /// The headers that will be added to request. @@ -192,13 +188,14 @@ public partial interface IGalleryImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, GalleryImage galleryImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, GalleryImage galleryImage, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a gallery image definition. /// + /// + /// Update a gallery image definition. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -223,13 +220,14 @@ public partial interface IGalleryImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, GalleryImageUpdate galleryImage, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, GalleryImageUpdate galleryImage, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a gallery image. /// + /// + /// Delete a gallery image. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -248,13 +246,14 @@ public partial interface IGalleryImagesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string galleryImageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List gallery image definitions in a gallery. /// + /// + /// List gallery image definitions in a gallery. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -270,9 +269,7 @@ public partial interface IGalleryImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByGalleryNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByGalleryNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IGalleryInVMAccessControlProfileVersionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IGalleryInVMAccessControlProfileVersionsOperations.cs index 19d5905c88c1..c9ac0df42a33 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IGalleryInVMAccessControlProfileVersionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IGalleryInVMAccessControlProfileVersionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// GalleryInVMAccessControlProfileVersionsOperations operations. @@ -27,6 +17,10 @@ public partial interface IGalleryInVMAccessControlProfileVersionsOperations /// List gallery inVMAccessControlProfile versions in a gallery /// inVMAccessControlProfile /// + /// + /// List gallery inVMAccessControlProfile versions in a gallery + /// inVMAccessControlProfile + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -48,14 +42,14 @@ public partial interface IGalleryInVMAccessControlProfileVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByGalleryInVMAccessControlProfileWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByGalleryInVMAccessControlProfileWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves information about a gallery inVMAccessControlProfile - /// version. + /// Retrieves information about a gallery inVMAccessControlProfile version. /// + /// + /// Retrieves information about a gallery inVMAccessControlProfile version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -66,8 +60,7 @@ public partial interface IGalleryInVMAccessControlProfileVersionsOperations /// The name of the gallery inVMAccessControlProfile to be retrieved. /// /// - /// The name of the gallery inVMAccessControlProfile version to be - /// retrieved. + /// The name of the gallery inVMAccessControlProfile version to be retrieved. /// /// /// The headers that will be added to request. @@ -81,13 +74,14 @@ public partial interface IGalleryInVMAccessControlProfileVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a gallery inVMAccessControlProfile version. /// + /// + /// Create or update a gallery inVMAccessControlProfile version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -98,8 +92,7 @@ public partial interface IGalleryInVMAccessControlProfileVersionsOperations /// The name of the gallery inVMAccessControlProfile to be retrieved. /// /// - /// The name of the gallery inVMAccessControlProfile version to be - /// retrieved. + /// The name of the gallery inVMAccessControlProfile version to be retrieved. /// /// /// Parameters supplied to the create or update gallery @@ -117,13 +110,14 @@ public partial interface IGalleryInVMAccessControlProfileVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a gallery inVMAccessControlProfile version. /// + /// + /// Update a gallery inVMAccessControlProfile version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -134,12 +128,11 @@ public partial interface IGalleryInVMAccessControlProfileVersionsOperations /// The name of the gallery inVMAccessControlProfile to be retrieved. /// /// - /// The name of the gallery inVMAccessControlProfile version to be - /// retrieved. + /// The name of the gallery inVMAccessControlProfile version to be retrieved. /// /// - /// Parameters supplied to the update gallery inVMAccessControlProfile - /// version operation. + /// Parameters supplied to the update gallery inVMAccessControlProfile version + /// operation. /// /// /// The headers that will be added to request. @@ -153,13 +146,14 @@ public partial interface IGalleryInVMAccessControlProfileVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a gallery inVMAccessControlProfile version. /// + /// + /// Delete a gallery inVMAccessControlProfile version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -170,8 +164,7 @@ public partial interface IGalleryInVMAccessControlProfileVersionsOperations /// The name of the gallery inVMAccessControlProfile to be retrieved. /// /// - /// The name of the gallery inVMAccessControlProfile version to be - /// retrieved. + /// The name of the gallery inVMAccessControlProfile version to be retrieved. /// /// /// The headers that will be added to request. @@ -182,13 +175,14 @@ public partial interface IGalleryInVMAccessControlProfileVersionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a gallery inVMAccessControlProfile version. /// + /// + /// Create or update a gallery inVMAccessControlProfile version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -199,8 +193,7 @@ public partial interface IGalleryInVMAccessControlProfileVersionsOperations /// The name of the gallery inVMAccessControlProfile to be retrieved. /// /// - /// The name of the gallery inVMAccessControlProfile version to be - /// retrieved. + /// The name of the gallery inVMAccessControlProfile version to be retrieved. /// /// /// Parameters supplied to the create or update gallery @@ -218,13 +211,14 @@ public partial interface IGalleryInVMAccessControlProfileVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersion galleryInVMAccessControlProfileVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a gallery inVMAccessControlProfile version. /// + /// + /// Update a gallery inVMAccessControlProfile version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -235,12 +229,11 @@ public partial interface IGalleryInVMAccessControlProfileVersionsOperations /// The name of the gallery inVMAccessControlProfile to be retrieved. /// /// - /// The name of the gallery inVMAccessControlProfile version to be - /// retrieved. + /// The name of the gallery inVMAccessControlProfile version to be retrieved. /// /// - /// Parameters supplied to the update gallery inVMAccessControlProfile - /// version operation. + /// Parameters supplied to the update gallery inVMAccessControlProfile version + /// operation. /// /// /// The headers that will be added to request. @@ -254,13 +247,14 @@ public partial interface IGalleryInVMAccessControlProfileVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, GalleryInVMAccessControlProfileVersionUpdate galleryInVMAccessControlProfileVersion, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a gallery inVMAccessControlProfile version. /// + /// + /// Delete a gallery inVMAccessControlProfile version. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -271,8 +265,7 @@ public partial interface IGalleryInVMAccessControlProfileVersionsOperations /// The name of the gallery inVMAccessControlProfile to be retrieved. /// /// - /// The name of the gallery inVMAccessControlProfile version to be - /// retrieved. + /// The name of the gallery inVMAccessControlProfile version to be retrieved. /// /// /// The headers that will be added to request. @@ -283,14 +276,16 @@ public partial interface IGalleryInVMAccessControlProfileVersionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, string inVMAccessControlProfileVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List gallery inVMAccessControlProfile versions in a gallery /// inVMAccessControlProfile /// + /// + /// List gallery inVMAccessControlProfile versions in a gallery + /// inVMAccessControlProfile + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -306,9 +301,7 @@ public partial interface IGalleryInVMAccessControlProfileVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByGalleryInVMAccessControlProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByGalleryInVMAccessControlProfileNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IGalleryInVMAccessControlProfilesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IGalleryInVMAccessControlProfilesOperations.cs index 867d5d3c84e6..ed73db8dd7f0 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IGalleryInVMAccessControlProfilesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IGalleryInVMAccessControlProfilesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// GalleryInVMAccessControlProfilesOperations operations. @@ -26,6 +16,9 @@ public partial interface IGalleryInVMAccessControlProfilesOperations /// /// List gallery inVMAccessControlProfiles in a gallery. /// + /// + /// List gallery inVMAccessControlProfiles in a gallery. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -44,13 +37,14 @@ public partial interface IGalleryInVMAccessControlProfilesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByGalleryWithHttpMessagesAsync(string resourceGroupName, string galleryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByGalleryWithHttpMessagesAsync(string resourceGroupName, string galleryName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves information about a gallery inVMAccessControlProfile. /// + /// + /// Retrieves information about a gallery inVMAccessControlProfile. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -72,13 +66,14 @@ public partial interface IGalleryInVMAccessControlProfilesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a gallery inVMAccessControlProfile. /// + /// + /// Create or update a gallery inVMAccessControlProfile. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -104,13 +99,14 @@ public partial interface IGalleryInVMAccessControlProfilesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a gallery inVMAccessControlProfile. /// + /// + /// Update a gallery inVMAccessControlProfile. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -136,13 +132,14 @@ public partial interface IGalleryInVMAccessControlProfilesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a gallery inVMAccessControlProfile. /// + /// + /// Delete a gallery inVMAccessControlProfile. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -161,13 +158,14 @@ public partial interface IGalleryInVMAccessControlProfilesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a gallery inVMAccessControlProfile. /// + /// + /// Create or update a gallery inVMAccessControlProfile. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -193,13 +191,14 @@ public partial interface IGalleryInVMAccessControlProfilesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfile galleryInVMAccessControlProfile, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a gallery inVMAccessControlProfile. /// + /// + /// Update a gallery inVMAccessControlProfile. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -225,13 +224,14 @@ public partial interface IGalleryInVMAccessControlProfilesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, GalleryInVMAccessControlProfileUpdate galleryInVMAccessControlProfile, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a gallery inVMAccessControlProfile. /// + /// + /// Delete a gallery inVMAccessControlProfile. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -250,13 +250,14 @@ public partial interface IGalleryInVMAccessControlProfilesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string galleryName, string inVMAccessControlProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List gallery inVMAccessControlProfiles in a gallery. /// + /// + /// List gallery inVMAccessControlProfiles in a gallery. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -272,9 +273,7 @@ public partial interface IGalleryInVMAccessControlProfilesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByGalleryNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByGalleryNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IGallerySharingProfileOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IGallerySharingProfileOperations.cs index b643d5e42b32..4edb81284603 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IGallerySharingProfileOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IGallerySharingProfileOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// GallerySharingProfileOperations operations. @@ -26,6 +16,9 @@ public partial interface IGallerySharingProfileOperations /// /// Update sharing profile of a gallery. /// + /// + /// Update sharing profile of a gallery. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -47,13 +40,14 @@ public partial interface IGallerySharingProfileOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, SharingUpdate sharingUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, SharingUpdate sharingUpdate, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update sharing profile of a gallery. /// + /// + /// Update sharing profile of a gallery. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -75,9 +69,7 @@ public partial interface IGallerySharingProfileOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, SharingUpdate sharingUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string galleryName, SharingUpdate sharingUpdate, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IImagesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IImagesOperations.cs index 7eec02c85bb5..cf0e875d1647 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IImagesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IImagesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ImagesOperations operations. @@ -24,10 +14,15 @@ namespace Microsoft.Azure.Management.Compute public partial interface IImagesOperations { /// - /// Gets the list of Images in the subscription. Use nextLink property - /// in the response to get the next page of Images. Do this till - /// nextLink is null to fetch all the Images. + /// Gets the list of Images in the subscription. Use nextLink property in the + /// response to get the next page of Images. Do this till nextLink is null to + /// fetch all the Images. /// + /// + /// Gets the list of Images in the subscription. Use nextLink property in the + /// response to get the next page of Images. Do this till nextLink is null to + /// fetch all the Images. + /// /// /// The headers that will be added to request. /// @@ -40,15 +35,18 @@ public partial interface IImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the list of images under a resource group. Use nextLink - /// property in the response to get the next page of Images. Do this - /// till nextLink is null to fetch all the Images. + /// Gets the list of images under a resource group. Use nextLink property in + /// the response to get the next page of Images. Do this till nextLink is null + /// to fetch all the Images. /// + /// + /// Gets the list of images under a resource group. Use nextLink property in + /// the response to get the next page of Images. Do this till nextLink is null + /// to fetch all the Images. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -64,13 +62,14 @@ public partial interface IImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets an image. /// + /// + /// Gets an image. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -92,13 +91,14 @@ public partial interface IImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string imageName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string imageName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update an image. /// + /// + /// Create or update an image. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -120,13 +120,14 @@ public partial interface IImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string imageName, Image parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string imageName, Image parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update an image. /// + /// + /// Update an image. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -148,13 +149,14 @@ public partial interface IImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string imageName, ImageUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string imageName, ImageUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes an Image. /// + /// + /// Deletes an Image. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -170,13 +172,14 @@ public partial interface IImagesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string imageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string imageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update an image. /// + /// + /// Create or update an image. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -198,13 +201,14 @@ public partial interface IImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string imageName, Image parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string imageName, Image parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update an image. /// + /// + /// Update an image. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -226,13 +230,14 @@ public partial interface IImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string imageName, ImageUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string imageName, ImageUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes an Image. /// + /// + /// Deletes an Image. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -248,15 +253,18 @@ public partial interface IImagesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string imageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string imageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the list of Images in the subscription. Use nextLink property - /// in the response to get the next page of Images. Do this till - /// nextLink is null to fetch all the Images. + /// Gets the list of Images in the subscription. Use nextLink property in the + /// response to get the next page of Images. Do this till nextLink is null to + /// fetch all the Images. /// + /// + /// Gets the list of Images in the subscription. Use nextLink property in the + /// response to get the next page of Images. Do this till nextLink is null to + /// fetch all the Images. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -272,15 +280,18 @@ public partial interface IImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the list of images under a resource group. Use nextLink - /// property in the response to get the next page of Images. Do this - /// till nextLink is null to fetch all the Images. + /// Gets the list of images under a resource group. Use nextLink property in + /// the response to get the next page of Images. Do this till nextLink is null + /// to fetch all the Images. /// + /// + /// Gets the list of images under a resource group. Use nextLink property in + /// the response to get the next page of Images. Do this till nextLink is null + /// to fetch all the Images. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -296,9 +307,7 @@ public partial interface IImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/ILogAnalyticsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ILogAnalyticsOperations.cs index 99a110005eb4..9e2a191e649f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ILogAnalyticsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ILogAnalyticsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// LogAnalyticsOperations operations. @@ -24,15 +14,18 @@ namespace Microsoft.Azure.Management.Compute public partial interface ILogAnalyticsOperations { /// - /// Export logs that show Api requests made by this subscription in the - /// given time window to show throttling activities. + /// Export logs that show Api requests made by this subscription in the given + /// time window to show throttling activities. /// + /// + /// Export logs that show Api requests made by this subscription in the given + /// time window to show throttling activities. + /// /// /// The name of Azure region. /// /// - /// Parameters supplied to the LogAnalytics getRequestRateByInterval - /// Api. + /// Parameters supplied to the LogAnalytics getRequestRateByInterval Api. /// /// /// The headers that will be added to request. @@ -46,14 +39,16 @@ public partial interface ILogAnalyticsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ExportRequestRateByIntervalWithHttpMessagesAsync(string location, RequestRateByIntervalInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ExportRequestRateByIntervalWithHttpMessagesAsync(string location, RequestRateByIntervalInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Export logs that show total throttled Api requests for this - /// subscription in the given time window. + /// Export logs that show total throttled Api requests for this subscription in + /// the given time window. /// + /// + /// Export logs that show total throttled Api requests for this subscription in + /// the given time window. + /// /// /// The name of Azure region. /// @@ -72,20 +67,21 @@ public partial interface ILogAnalyticsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ExportThrottledRequestsWithHttpMessagesAsync(string location, ThrottledRequestsInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ExportThrottledRequestsWithHttpMessagesAsync(string location, ThrottledRequestsInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Export logs that show Api requests made by this subscription in the - /// given time window to show throttling activities. + /// Export logs that show Api requests made by this subscription in the given + /// time window to show throttling activities. /// + /// + /// Export logs that show Api requests made by this subscription in the given + /// time window to show throttling activities. + /// /// /// The name of Azure region. /// /// - /// Parameters supplied to the LogAnalytics getRequestRateByInterval - /// Api. + /// Parameters supplied to the LogAnalytics getRequestRateByInterval Api. /// /// /// The headers that will be added to request. @@ -99,14 +95,16 @@ public partial interface ILogAnalyticsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginExportRequestRateByIntervalWithHttpMessagesAsync(string location, RequestRateByIntervalInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginExportRequestRateByIntervalWithHttpMessagesAsync(string location, RequestRateByIntervalInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Export logs that show total throttled Api requests for this - /// subscription in the given time window. + /// Export logs that show total throttled Api requests for this subscription in + /// the given time window. /// + /// + /// Export logs that show total throttled Api requests for this subscription in + /// the given time window. + /// /// /// The name of Azure region. /// @@ -125,9 +123,7 @@ public partial interface ILogAnalyticsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginExportThrottledRequestsWithHttpMessagesAsync(string location, ThrottledRequestsInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginExportThrottledRequestsWithHttpMessagesAsync(string location, ThrottledRequestsInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IOperations.cs index 96b5c5081a42..fd00bd3759d2 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// Operations operations. @@ -26,6 +16,9 @@ public partial interface IOperations /// /// List the operations for the provider /// + /// + /// List the operations for the provider + /// /// /// The headers that will be added to request. /// @@ -38,9 +31,7 @@ public partial interface IOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IProximityPlacementGroupsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IProximityPlacementGroupsOperations.cs index f97b5bcb4a3a..5c17ebb70aa7 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IProximityPlacementGroupsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IProximityPlacementGroupsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ProximityPlacementGroupsOperations operations. @@ -26,6 +16,9 @@ public partial interface IProximityPlacementGroupsOperations /// /// Lists all proximity placement groups in a subscription. /// + /// + /// Lists all proximity placement groups in a subscription. + /// /// /// The headers that will be added to request. /// @@ -38,13 +31,14 @@ public partial interface IProximityPlacementGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all proximity placement groups in a resource group. /// + /// + /// Lists all proximity placement groups in a resource group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -60,13 +54,14 @@ public partial interface IProximityPlacementGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves information about a proximity placement group . /// + /// + /// Retrieves information about a proximity placement group . + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -74,8 +69,8 @@ public partial interface IProximityPlacementGroupsOperations /// The name of the proximity placement group. /// /// - /// includeColocationStatus=true enables fetching the colocation status - /// of all the resources in the proximity placement group. + /// includeColocationStatus=true enables fetching the colocation status of all + /// the resources in the proximity placement group. /// /// /// The headers that will be added to request. @@ -89,13 +84,14 @@ public partial interface IProximityPlacementGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, string includeColocationStatus = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, string includeColocationStatus = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a proximity placement group. /// + /// + /// Create or update a proximity placement group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -103,8 +99,7 @@ public partial interface IProximityPlacementGroupsOperations /// The name of the proximity placement group. /// /// - /// Parameters supplied to the Create Proximity Placement Group - /// operation. + /// Parameters supplied to the Create Proximity Placement Group operation. /// /// /// The headers that will be added to request. @@ -118,13 +113,14 @@ public partial interface IProximityPlacementGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, ProximityPlacementGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, ProximityPlacementGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a proximity placement group. /// + /// + /// Update a proximity placement group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -146,13 +142,14 @@ public partial interface IProximityPlacementGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a proximity placement group. /// + /// + /// Delete a proximity placement group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -168,13 +165,14 @@ public partial interface IProximityPlacementGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all proximity placement groups in a subscription. /// + /// + /// Lists all proximity placement groups in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -190,13 +188,14 @@ public partial interface IProximityPlacementGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all proximity placement groups in a resource group. /// + /// + /// Lists all proximity placement groups in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -212,9 +211,7 @@ public partial interface IProximityPlacementGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IResourceSkusOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IResourceSkusOperations.cs index 1c2279dafc80..c4bb722c3772 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IResourceSkusOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IResourceSkusOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ResourceSkusOperations operations. @@ -24,12 +14,14 @@ namespace Microsoft.Azure.Management.Compute public partial interface IResourceSkusOperations { /// - /// Gets the list of Microsoft.Compute SKUs available for your - /// Subscription. + /// Gets the list of Microsoft.Compute SKUs available for your Subscription. /// + /// + /// Gets the list of Microsoft.Compute SKUs available for your Subscription. + /// /// - /// The filter to apply on the operation. Only **location** filter is - /// supported currently. + /// The filter to apply on the operation. Only **location** filter is supported + /// currently. /// /// /// To Include Extended Locations information or not in the response. @@ -40,20 +32,20 @@ public partial interface IResourceSkusOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string filter = default(string), string includeExtendedLocations = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string filter = default(string), string includeExtendedLocations = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the list of Microsoft.Compute SKUs available for your - /// Subscription. + /// Gets the list of Microsoft.Compute SKUs available for your Subscription. /// + /// + /// Gets the list of Microsoft.Compute SKUs available for your Subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -63,15 +55,13 @@ public partial interface IResourceSkusOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IRestorePointCollectionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IRestorePointCollectionsOperations.cs index f13f37b13d62..55fa0d2ce302 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IRestorePointCollectionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IRestorePointCollectionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// RestorePointCollectionsOperations operations. @@ -25,10 +15,16 @@ public partial interface IRestorePointCollectionsOperations { /// /// Gets the list of restore point collections in the subscription. Use - /// nextLink property in the response to get the next page of restore - /// point collections. Do this till nextLink is not null to fetch all - /// the restore point collections. + /// nextLink property in the response to get the next page of restore point + /// collections. Do this till nextLink is not null to fetch all the restore + /// point collections. /// + /// + /// Gets the list of restore point collections in the subscription. Use + /// nextLink property in the response to get the next page of restore point + /// collections. Do this till nextLink is not null to fetch all the restore + /// point collections. + /// /// /// The headers that will be added to request. /// @@ -41,13 +37,14 @@ public partial interface IRestorePointCollectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the list of restore point collections in a resource group. /// + /// + /// Gets the list of restore point collections in a resource group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -63,13 +60,14 @@ public partial interface IRestorePointCollectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to get the restore point collection. /// + /// + /// The operation to get the restore point collection. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -77,10 +75,9 @@ public partial interface IRestorePointCollectionsOperations /// The name of the restore point collection. /// /// - /// The expand expression to apply on the operation. If - /// expand=restorePoints, server will return all contained restore - /// points in the restorePointCollection. Possible values include: - /// 'restorePoints' + /// The expand expression to apply on the operation. If expand=restorePoints, + /// server will return all contained restore points in the + /// restorePointCollection. /// /// /// The headers that will be added to request. @@ -94,15 +91,18 @@ public partial interface IRestorePointCollectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to create or update the restore point collection. - /// Please refer to https://aka.ms/RestorePoints for more details. When - /// updating a restore point collection, only tags may be modified. + /// The operation to create or update the restore point collection. Please + /// refer to https://aka.ms/RestorePoints for more details. When updating a + /// restore point collection, only tags may be modified. /// + /// + /// The operation to create or update the restore point collection. Please + /// refer to https://aka.ms/RestorePoints for more details. When updating a + /// restore point collection, only tags may be modified. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -110,8 +110,8 @@ public partial interface IRestorePointCollectionsOperations /// The name of the restore point collection. /// /// - /// Parameters supplied to the Create or Update restore point - /// collection operation. + /// Parameters supplied to the Create or Update restore point collection + /// operation. /// /// /// The headers that will be added to request. @@ -125,13 +125,14 @@ public partial interface IRestorePointCollectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, RestorePointCollection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, RestorePointCollection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to update the restore point collection. /// + /// + /// The operation to update the restore point collection. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -139,8 +140,7 @@ public partial interface IRestorePointCollectionsOperations /// The name of the restore point collection. /// /// - /// Parameters supplied to the Update restore point collection - /// operation. + /// Parameters supplied to the Update restore point collection operation. /// /// /// The headers that will be added to request. @@ -154,14 +154,16 @@ public partial interface IRestorePointCollectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, RestorePointCollectionUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, RestorePointCollectionUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to delete the restore point collection. This - /// operation will also delete all the contained restore points. + /// The operation to delete the restore point collection. This operation will + /// also delete all the contained restore points. /// + /// + /// The operation to delete the restore point collection. This operation will + /// also delete all the contained restore points. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -177,14 +179,16 @@ public partial interface IRestorePointCollectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to delete the restore point collection. This - /// operation will also delete all the contained restore points. + /// The operation to delete the restore point collection. This operation will + /// also delete all the contained restore points. /// + /// + /// The operation to delete the restore point collection. This operation will + /// also delete all the contained restore points. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -200,16 +204,20 @@ public partial interface IRestorePointCollectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the list of restore point collections in the subscription. Use - /// nextLink property in the response to get the next page of restore - /// point collections. Do this till nextLink is not null to fetch all - /// the restore point collections. + /// nextLink property in the response to get the next page of restore point + /// collections. Do this till nextLink is not null to fetch all the restore + /// point collections. /// + /// + /// Gets the list of restore point collections in the subscription. Use + /// nextLink property in the response to get the next page of restore point + /// collections. Do this till nextLink is not null to fetch all the restore + /// point collections. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -225,13 +233,14 @@ public partial interface IRestorePointCollectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the list of restore point collections in a resource group. /// + /// + /// Gets the list of restore point collections in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -247,9 +256,7 @@ public partial interface IRestorePointCollectionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IRestorePointsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IRestorePointsOperations.cs index fb145e30e952..37776fb71d66 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IRestorePointsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IRestorePointsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// RestorePointsOperations operations. @@ -26,6 +16,9 @@ public partial interface IRestorePointsOperations /// /// The operation to get the restore point. /// + /// + /// The operation to get the restore point. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -36,9 +29,8 @@ public partial interface IRestorePointsOperations /// The name of the restore point. /// /// - /// The expand expression to apply on the operation. 'InstanceView' - /// retrieves information about the run-time state of a restore point. - /// Possible values include: 'instanceView' + /// The expand expression to apply on the operation. 'InstanceView' retrieves + /// information about the run-time state of a restore point. /// /// /// The headers that will be added to request. @@ -52,14 +44,16 @@ public partial interface IRestorePointsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to create the restore point. Updating properties of - /// an existing restore point is not allowed + /// The operation to create the restore point. Updating properties of an + /// existing restore point is not allowed /// + /// + /// The operation to create the restore point. Updating properties of an + /// existing restore point is not allowed + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -84,13 +78,14 @@ public partial interface IRestorePointsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, RestorePoint parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, RestorePoint parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to delete the restore point. /// + /// + /// The operation to delete the restore point. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -109,14 +104,16 @@ public partial interface IRestorePointsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to create the restore point. Updating properties of - /// an existing restore point is not allowed + /// The operation to create the restore point. Updating properties of an + /// existing restore point is not allowed /// + /// + /// The operation to create the restore point. Updating properties of an + /// existing restore point is not allowed + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -141,13 +138,14 @@ public partial interface IRestorePointsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, RestorePoint parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, RestorePoint parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to delete the restore point. /// + /// + /// The operation to delete the restore point. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -166,9 +164,7 @@ public partial interface IRestorePointsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/ISharedGalleriesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ISharedGalleriesOperations.cs index 4dd8b9844005..7ee56d6c709e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ISharedGalleriesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ISharedGalleriesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SharedGalleriesOperations operations. @@ -26,12 +16,15 @@ public partial interface ISharedGalleriesOperations /// /// List shared galleries by subscription id or tenant id. /// + /// + /// List shared galleries by subscription id or tenant id. + /// /// /// The name of Azure region. /// /// - /// The query parameter to decide what shared galleries to fetch when - /// doing listing operations. Possible values include: 'tenant' + /// The query parameter to decide what shared galleries to fetch when doing + /// listing operations. /// /// /// The headers that will be added to request. @@ -45,13 +38,14 @@ public partial interface ISharedGalleriesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, string sharedTo = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string sharedTo = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get a shared gallery by subscription id or tenant id. /// + /// + /// Get a shared gallery by subscription id or tenant id. + /// /// /// The name of Azure region. /// @@ -70,13 +64,14 @@ public partial interface ISharedGalleriesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string location, string galleryUniqueName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string galleryUniqueName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List shared galleries by subscription id or tenant id. /// + /// + /// List shared galleries by subscription id or tenant id. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -92,9 +87,7 @@ public partial interface ISharedGalleriesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/ISharedGalleryImageVersionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ISharedGalleryImageVersionsOperations.cs index 2c76c6e1df12..bb4af9c589a1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ISharedGalleryImageVersionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ISharedGalleryImageVersionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SharedGalleryImageVersionsOperations operations. @@ -26,6 +16,9 @@ public partial interface ISharedGalleryImageVersionsOperations /// /// List shared gallery image versions by subscription id or tenant id. /// + /// + /// List shared gallery image versions by subscription id or tenant id. + /// /// /// The name of Azure region. /// @@ -33,12 +26,12 @@ public partial interface ISharedGalleryImageVersionsOperations /// The unique name of the Shared Gallery. /// /// - /// The name of the Shared Gallery Image Definition from which the - /// Image Versions are to be listed. + /// The name of the Shared Gallery Image Definition from which the Image + /// Versions are to be listed. /// /// - /// The query parameter to decide what shared galleries to fetch when - /// doing listing operations. Possible values include: 'tenant' + /// The query parameter to decide what shared galleries to fetch when doing + /// listing operations. /// /// /// The headers that will be added to request. @@ -52,13 +45,14 @@ public partial interface ISharedGalleryImageVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, string galleryUniqueName, string galleryImageName, string sharedTo = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string galleryUniqueName, string galleryImageName, string sharedTo = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get a shared gallery image version by subscription id or tenant id. /// + /// + /// Get a shared gallery image version by subscription id or tenant id. + /// /// /// The name of Azure region. /// @@ -66,14 +60,13 @@ public partial interface ISharedGalleryImageVersionsOperations /// The unique name of the Shared Gallery. /// /// - /// The name of the Shared Gallery Image Definition from which the - /// Image Versions are to be listed. + /// The name of the Shared Gallery Image Definition from which the Image + /// Versions are to be listed. /// /// - /// The name of the gallery image version to be created. Needs to - /// follow semantic version name pattern: The allowed characters are - /// digit and period. Digits must be within the range of a 32-bit - /// integer. Format: + /// The name of the gallery image version to be created. Needs to follow + /// semantic version name pattern: The allowed characters are digit and period. + /// Digits must be within the range of a 32-bit integer. Format: /// <MajorVersion>.<MinorVersion>.<Patch> /// /// @@ -88,13 +81,14 @@ public partial interface ISharedGalleryImageVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string location, string galleryUniqueName, string galleryImageName, string galleryImageVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string galleryUniqueName, string galleryImageName, string galleryImageVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List shared gallery image versions by subscription id or tenant id. /// + /// + /// List shared gallery image versions by subscription id or tenant id. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -110,9 +104,7 @@ public partial interface ISharedGalleryImageVersionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/ISharedGalleryImagesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ISharedGalleryImagesOperations.cs index 631141770fd3..1f6b66f3925c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ISharedGalleryImagesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ISharedGalleryImagesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SharedGalleryImagesOperations operations. @@ -26,6 +16,9 @@ public partial interface ISharedGalleryImagesOperations /// /// List shared gallery images by subscription id or tenant id. /// + /// + /// List shared gallery images by subscription id or tenant id. + /// /// /// The name of Azure region. /// @@ -33,8 +26,8 @@ public partial interface ISharedGalleryImagesOperations /// The unique name of the Shared Gallery. /// /// - /// The query parameter to decide what shared galleries to fetch when - /// doing listing operations. Possible values include: 'tenant' + /// The query parameter to decide what shared galleries to fetch when doing + /// listing operations. /// /// /// The headers that will be added to request. @@ -48,13 +41,14 @@ public partial interface ISharedGalleryImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, string galleryUniqueName, string sharedTo = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string galleryUniqueName, string sharedTo = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get a shared gallery image by subscription id or tenant id. /// + /// + /// Get a shared gallery image by subscription id or tenant id. + /// /// /// The name of Azure region. /// @@ -62,8 +56,8 @@ public partial interface ISharedGalleryImagesOperations /// The unique name of the Shared Gallery. /// /// - /// The name of the Shared Gallery Image Definition from which the - /// Image Versions are to be listed. + /// The name of the Shared Gallery Image Definition from which the Image + /// Versions are to be listed. /// /// /// The headers that will be added to request. @@ -77,13 +71,14 @@ public partial interface ISharedGalleryImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string location, string galleryUniqueName, string galleryImageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string galleryUniqueName, string galleryImageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List shared gallery images by subscription id or tenant id. /// + /// + /// List shared gallery images by subscription id or tenant id. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -99,9 +94,7 @@ public partial interface ISharedGalleryImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/ISnapshotsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ISnapshotsOperations.cs index a0d4967f3e7b..a3fefa726fdc 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ISnapshotsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ISnapshotsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SnapshotsOperations operations. @@ -26,6 +16,9 @@ public partial interface ISnapshotsOperations /// /// Lists snapshots under a subscription. /// + /// + /// Lists snapshots under a subscription. + /// /// /// The headers that will be added to request. /// @@ -38,13 +31,14 @@ public partial interface ISnapshotsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists snapshots under a resource group. /// + /// + /// Lists snapshots under a resource group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -60,21 +54,21 @@ public partial interface ISnapshotsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets information about a snapshot. /// + /// + /// Gets information about a snapshot. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be - /// changed after the snapshot is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The max name length is 80 - /// characters. + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// /// /// The headers that will be added to request. @@ -88,21 +82,21 @@ public partial interface ISnapshotsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a snapshot. /// + /// + /// Creates or updates a snapshot. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be - /// changed after the snapshot is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The max name length is 80 - /// characters. + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// /// /// Snapshot object supplied in the body of the Put disk operation. @@ -119,25 +113,24 @@ public partial interface ISnapshotsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Snapshot snapshot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Snapshot snapshot, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates (patches) a snapshot. /// + /// + /// Updates (patches) a snapshot. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be - /// changed after the snapshot is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The max name length is 80 - /// characters. + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// /// - /// Snapshot object supplied in the body of the Patch snapshot - /// operation. + /// Snapshot object supplied in the body of the Patch snapshot operation. /// /// /// The headers that will be added to request. @@ -151,21 +144,21 @@ public partial interface ISnapshotsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string snapshotName, SnapshotUpdate snapshot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string snapshotName, SnapshotUpdate snapshot, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a snapshot. /// + /// + /// Deletes a snapshot. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be - /// changed after the snapshot is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The max name length is 80 - /// characters. + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// /// /// The headers that will be added to request. @@ -176,21 +169,21 @@ public partial interface ISnapshotsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Grants access to a snapshot. /// + /// + /// Grants access to a snapshot. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be - /// changed after the snapshot is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The max name length is 80 - /// characters. + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// /// /// Access data object supplied in the body of the get snapshot access @@ -208,21 +201,21 @@ public partial interface ISnapshotsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GrantAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, GrantAccessData grantAccessData, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GrantAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, GrantAccessData grantAccessData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Revokes access to a snapshot. /// + /// + /// Revokes access to a snapshot. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be - /// changed after the snapshot is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The max name length is 80 - /// characters. + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// /// /// The headers that will be added to request. @@ -233,21 +226,21 @@ public partial interface ISnapshotsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task RevokeAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task RevokeAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a snapshot. /// + /// + /// Creates or updates a snapshot. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be - /// changed after the snapshot is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The max name length is 80 - /// characters. + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// /// /// Snapshot object supplied in the body of the Put disk operation. @@ -264,25 +257,24 @@ public partial interface ISnapshotsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Snapshot snapshot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Snapshot snapshot, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates (patches) a snapshot. /// + /// + /// Updates (patches) a snapshot. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be - /// changed after the snapshot is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The max name length is 80 - /// characters. + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// /// - /// Snapshot object supplied in the body of the Patch snapshot - /// operation. + /// Snapshot object supplied in the body of the Patch snapshot operation. /// /// /// The headers that will be added to request. @@ -296,21 +288,21 @@ public partial interface ISnapshotsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string snapshotName, SnapshotUpdate snapshot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string snapshotName, SnapshotUpdate snapshot, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a snapshot. /// + /// + /// Deletes a snapshot. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be - /// changed after the snapshot is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The max name length is 80 - /// characters. + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// /// /// The headers that will be added to request. @@ -321,21 +313,21 @@ public partial interface ISnapshotsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Grants access to a snapshot. /// + /// + /// Grants access to a snapshot. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be - /// changed after the snapshot is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The max name length is 80 - /// characters. + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// /// /// Access data object supplied in the body of the get snapshot access @@ -353,21 +345,21 @@ public partial interface ISnapshotsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGrantAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, GrantAccessData grantAccessData, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGrantAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, GrantAccessData grantAccessData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Revokes access to a snapshot. /// + /// + /// Revokes access to a snapshot. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be - /// changed after the snapshot is created. Supported characters for the - /// name are a-z, A-Z, 0-9, _ and -. The max name length is 80 - /// characters. + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// /// /// The headers that will be added to request. @@ -378,13 +370,14 @@ public partial interface ISnapshotsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRevokeAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginRevokeAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists snapshots under a subscription. /// + /// + /// Lists snapshots under a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -400,13 +393,14 @@ public partial interface ISnapshotsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists snapshots under a resource group. /// + /// + /// Lists snapshots under a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -422,9 +416,7 @@ public partial interface ISnapshotsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/ISoftDeletedResourceOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ISoftDeletedResourceOperations.cs index bb9bda27fd40..1773562e9047 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ISoftDeletedResourceOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ISoftDeletedResourceOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SoftDeletedResourceOperations operations. @@ -27,6 +17,10 @@ public partial interface ISoftDeletedResourceOperations /// List soft-deleted resources of an artifact in the gallery, such as /// soft-deleted gallery image version of an image. /// + /// + /// List soft-deleted resources of an artifact in the gallery, such as + /// soft-deleted gallery image version of an image. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -34,12 +28,11 @@ public partial interface ISoftDeletedResourceOperations /// The name of the Shared Image Gallery. /// /// - /// The type of the artifact to be listed, such as gallery image - /// version. + /// The type of the artifact to be listed, such as gallery image version. /// /// - /// The artifact name to be listed. If artifact type is Images, then - /// the artifact name should be the gallery image name. + /// The artifact name to be listed. If artifact type is Images, then the + /// artifact name should be the gallery image name. /// /// /// The headers that will be added to request. @@ -53,14 +46,16 @@ public partial interface ISoftDeletedResourceOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByArtifactNameWithHttpMessagesAsync(string resourceGroupName, string galleryName, string artifactType, string artifactName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByArtifactNameWithHttpMessagesAsync(string resourceGroupName, string galleryName, string artifactType, string artifactName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List soft-deleted resources of an artifact in the gallery, such as /// soft-deleted gallery image version of an image. /// + /// + /// List soft-deleted resources of an artifact in the gallery, such as + /// soft-deleted gallery image version of an image. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -76,9 +71,7 @@ public partial interface ISoftDeletedResourceOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByArtifactNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByArtifactNameNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/ISshPublicKeysOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ISshPublicKeysOperations.cs index 2d95d94f8cbe..14e79ad260ad 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ISshPublicKeysOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ISshPublicKeysOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SshPublicKeysOperations operations. @@ -24,10 +14,13 @@ namespace Microsoft.Azure.Management.Compute public partial interface ISshPublicKeysOperations { /// - /// Lists all of the SSH public keys in the subscription. Use the - /// nextLink property in the response to get the next page of SSH - /// public keys. + /// Lists all of the SSH public keys in the subscription. Use the nextLink + /// property in the response to get the next page of SSH public keys. /// + /// + /// Lists all of the SSH public keys in the subscription. Use the nextLink + /// property in the response to get the next page of SSH public keys. + /// /// /// The headers that will be added to request. /// @@ -40,15 +33,16 @@ public partial interface ISshPublicKeysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all of the SSH public keys in the specified resource group. - /// Use the nextLink property in the response to get the next page of - /// SSH public keys. + /// Lists all of the SSH public keys in the specified resource group. Use the + /// nextLink property in the response to get the next page of SSH public keys. /// + /// + /// Lists all of the SSH public keys in the specified resource group. Use the + /// nextLink property in the response to get the next page of SSH public keys. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -64,13 +58,14 @@ public partial interface ISshPublicKeysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves information about an SSH public key. /// + /// + /// Retrieves information about an SSH public key. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -89,13 +84,14 @@ public partial interface ISshPublicKeysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates a new SSH public key resource. /// + /// + /// Creates a new SSH public key resource. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -117,13 +113,14 @@ public partial interface ISshPublicKeysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, SshPublicKeyResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, SshPublicKeyResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a new SSH public key resource. /// + /// + /// Updates a new SSH public key resource. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -145,13 +142,14 @@ public partial interface ISshPublicKeysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, SshPublicKeyUpdateResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, SshPublicKeyUpdateResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete an SSH public key. /// + /// + /// Delete an SSH public key. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -167,16 +165,20 @@ public partial interface ISshPublicKeysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Generates and returns a public/private key pair and populates the - /// SSH public key resource with the public key. The length of the key - /// will be 3072 bits. This operation can only be performed once per - /// SSH public key resource. + /// Generates and returns a public/private key pair and populates the SSH + /// public key resource with the public key. The length of the key will be 3072 + /// bits. This operation can only be performed once per SSH public key + /// resource. /// + /// + /// Generates and returns a public/private key pair and populates the SSH + /// public key resource with the public key. The length of the key will be 3072 + /// bits. This operation can only be performed once per SSH public key + /// resource. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -184,9 +186,8 @@ public partial interface ISshPublicKeysOperations /// The name of the SSH public key. /// /// - /// The encryption type of the SSH keys to be generated. See - /// SshEncryptionTypes for possible set of values. If not provided, - /// will default to RSA. Possible values include: 'RSA', 'Ed25519' + /// The encryption type of the SSH keys to be generated. See SshEncryptionTypes + /// for possible set of values. If not provided, will default to RSA /// /// /// The headers that will be added to request. @@ -200,15 +201,16 @@ public partial interface ISshPublicKeysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GenerateKeyPairWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, string encryptionType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GenerateKeyPairWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, string encryptionType = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all of the SSH public keys in the subscription. Use the - /// nextLink property in the response to get the next page of SSH - /// public keys. + /// Lists all of the SSH public keys in the subscription. Use the nextLink + /// property in the response to get the next page of SSH public keys. /// + /// + /// Lists all of the SSH public keys in the subscription. Use the nextLink + /// property in the response to get the next page of SSH public keys. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -224,15 +226,16 @@ public partial interface ISshPublicKeysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all of the SSH public keys in the specified resource group. - /// Use the nextLink property in the response to get the next page of - /// SSH public keys. + /// Lists all of the SSH public keys in the specified resource group. Use the + /// nextLink property in the response to get the next page of SSH public keys. /// + /// + /// Lists all of the SSH public keys in the specified resource group. Use the + /// nextLink property in the response to get the next page of SSH public keys. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -248,9 +251,7 @@ public partial interface ISshPublicKeysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IUsageOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IUsageOperations.cs index d88df59fe8f2..b805299ec063 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IUsageOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IUsageOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// UsageOperations operations. @@ -24,10 +14,15 @@ namespace Microsoft.Azure.Management.Compute public partial interface IUsageOperations { /// - /// Gets, for the specified location, the current compute resource - /// usage information as well as the limits for compute resources under - /// the subscription. + /// Gets, for the specified location, the current compute resource usage + /// information as well as the limits for compute resources under the + /// subscription. /// + /// + /// Gets, for the specified location, the current compute resource usage + /// information as well as the limits for compute resources under the + /// subscription. + /// /// /// The name of Azure region. /// @@ -43,15 +38,18 @@ public partial interface IUsageOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets, for the specified location, the current compute resource - /// usage information as well as the limits for compute resources under - /// the subscription. + /// Gets, for the specified location, the current compute resource usage + /// information as well as the limits for compute resources under the + /// subscription. /// + /// + /// Gets, for the specified location, the current compute resource usage + /// information as well as the limits for compute resources under the + /// subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -67,9 +65,7 @@ public partial interface IUsageOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineExtensionImagesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineExtensionImagesOperations.cs index 2315f6b9a514..b8a7461eeb0b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineExtensionImagesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineExtensionImagesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineExtensionImagesOperations operations. @@ -26,10 +16,14 @@ public partial interface IVirtualMachineExtensionImagesOperations /// /// Gets a list of virtual machine extension image types. /// + /// + /// Gets a list of virtual machine extension image types. + /// /// /// The name of Azure region. /// /// + /// /// /// /// The headers that will be added to request. @@ -43,26 +37,31 @@ public partial interface IVirtualMachineExtensionImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListTypesWithHttpMessagesAsync(string location, string publisherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListTypesWithHttpMessagesAsync(string location, string publisherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a list of virtual machine extension image versions. /// + /// + /// Gets a list of virtual machine extension image versions. + /// /// /// The name of Azure region. /// /// + /// /// /// + /// /// /// /// The filter to apply on the operation. /// /// + /// /// /// + /// /// /// /// The headers that will be added to request. @@ -76,21 +75,25 @@ public partial interface IVirtualMachineExtensionImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListVersionsWithHttpMessagesAsync(string location, string publisherName, string type, string filter = default(string), int? top = default(int?), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListVersionsWithHttpMessagesAsync(string location, string publisherName, string type, string filter = default(string), int? top = default(int?), string orderby = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a virtual machine extension image. /// + /// + /// Gets a virtual machine extension image. + /// /// /// The name of Azure region. /// /// + /// /// /// + /// /// /// + /// /// /// /// The headers that will be added to request. @@ -104,9 +107,7 @@ public partial interface IVirtualMachineExtensionImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string location, string publisherName, string type, string version, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string publisherName, string type, string version, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineExtensionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineExtensionsOperations.cs index f9df5c547764..25cf64fa29ee 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineExtensionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineExtensionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineExtensionsOperations operations. @@ -26,6 +16,9 @@ public partial interface IVirtualMachineExtensionsOperations /// /// The operation to get all extensions of a Virtual Machine. /// + /// + /// The operation to get all extensions of a Virtual Machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -47,13 +40,14 @@ public partial interface IVirtualMachineExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListWithHttpMessagesAsync(string resourceGroupName, string vmName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string vmName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to get the extension. /// + /// + /// The operation to get the extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -78,13 +72,14 @@ public partial interface IVirtualMachineExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to create or update the extension. /// + /// + /// The operation to create or update the extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -95,8 +90,7 @@ public partial interface IVirtualMachineExtensionsOperations /// The name of the virtual machine extension. /// /// - /// Parameters supplied to the Create Virtual Machine Extension - /// operation. + /// Parameters supplied to the Create Virtual Machine Extension operation. /// /// /// The headers that will be added to request. @@ -110,13 +104,14 @@ public partial interface IVirtualMachineExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtension extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to update the extension. /// + /// + /// The operation to update the extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -127,8 +122,7 @@ public partial interface IVirtualMachineExtensionsOperations /// The name of the virtual machine extension. /// /// - /// Parameters supplied to the Update Virtual Machine Extension - /// operation. + /// Parameters supplied to the Update Virtual Machine Extension operation. /// /// /// The headers that will be added to request. @@ -142,13 +136,14 @@ public partial interface IVirtualMachineExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to delete the extension. /// + /// + /// The operation to delete the extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -167,13 +162,14 @@ public partial interface IVirtualMachineExtensionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to create or update the extension. /// + /// + /// The operation to create or update the extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -184,8 +180,7 @@ public partial interface IVirtualMachineExtensionsOperations /// The name of the virtual machine extension. /// /// - /// Parameters supplied to the Create Virtual Machine Extension - /// operation. + /// Parameters supplied to the Create Virtual Machine Extension operation. /// /// /// The headers that will be added to request. @@ -199,13 +194,14 @@ public partial interface IVirtualMachineExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtension extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to update the extension. /// + /// + /// The operation to update the extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -216,8 +212,7 @@ public partial interface IVirtualMachineExtensionsOperations /// The name of the virtual machine extension. /// /// - /// Parameters supplied to the Update Virtual Machine Extension - /// operation. + /// Parameters supplied to the Update Virtual Machine Extension operation. /// /// /// The headers that will be added to request. @@ -231,13 +226,14 @@ public partial interface IVirtualMachineExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to delete the extension. /// + /// + /// The operation to delete the extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -256,9 +252,7 @@ public partial interface IVirtualMachineExtensionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineImagesEdgeZoneOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineImagesEdgeZoneOperations.cs index 24f0dc956172..85908120897e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineImagesEdgeZoneOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineImagesEdgeZoneOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineImagesEdgeZoneOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Compute public partial interface IVirtualMachineImagesEdgeZoneOperations { /// - /// Gets a list of virtual machine image publishers for the specified - /// Azure location and edge zone. + /// Gets a list of virtual machine image publishers for the specified Azure + /// location and edge zone. /// + /// + /// Gets a list of virtual machine image publishers for the specified Azure + /// location and edge zone. + /// /// /// The name of Azure region. /// @@ -45,14 +39,16 @@ public partial interface IVirtualMachineImagesEdgeZoneOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListPublishersWithHttpMessagesAsync(string location, string edgeZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListPublishersWithHttpMessagesAsync(string location, string edgeZone, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets a list of virtual machine image offers for the specified - /// location, edge zone and publisher. + /// Gets a list of virtual machine image offers for the specified location, + /// edge zone and publisher. /// + /// + /// Gets a list of virtual machine image offers for the specified location, + /// edge zone and publisher. + /// /// /// The name of Azure region. /// @@ -74,14 +70,16 @@ public partial interface IVirtualMachineImagesEdgeZoneOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListOffersWithHttpMessagesAsync(string location, string edgeZone, string publisherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListOffersWithHttpMessagesAsync(string location, string edgeZone, string publisherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets a list of virtual machine image SKUs for the specified - /// location, edge zone, publisher, and offer. + /// Gets a list of virtual machine image SKUs for the specified location, edge + /// zone, publisher, and offer. /// + /// + /// Gets a list of virtual machine image SKUs for the specified location, edge + /// zone, publisher, and offer. + /// /// /// The name of Azure region. /// @@ -106,14 +104,16 @@ public partial interface IVirtualMachineImagesEdgeZoneOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListSkusWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListSkusWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a list of all virtual machine image versions for the specified /// location, edge zone, publisher, offer, and SKU. /// + /// + /// Gets a list of all virtual machine image versions for the specified + /// location, edge zone, publisher, offer, and SKU. + /// /// /// The name of Azure region. /// @@ -133,12 +133,11 @@ public partial interface IVirtualMachineImagesEdgeZoneOperations /// The expand expression to apply on the operation. /// /// - /// An integer value specifying the number of images to return that - /// matches supplied values. + /// An integer value specifying the number of images to return that matches + /// supplied values. /// /// - /// Specifies the order of the results returned. Formatted as an OData - /// query. + /// Specifies the order of the results returned. Formatted as an OData query. /// /// /// The headers that will be added to request. @@ -152,13 +151,14 @@ public partial interface IVirtualMachineImagesEdgeZoneOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a virtual machine image in an edge zone. /// + /// + /// Gets a virtual machine image in an edge zone. + /// /// /// The name of Azure region. /// @@ -189,9 +189,7 @@ public partial interface IVirtualMachineImagesEdgeZoneOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, string skus, string version, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, string skus, string version, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineImagesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineImagesOperations.cs index de013c393552..92bd242542e0 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineImagesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineImagesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineImagesOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Compute public partial interface IVirtualMachineImagesOperations { /// - /// Gets a list of all virtual machine image versions for the specified - /// edge zone + /// Gets a list of all virtual machine image versions for the specified edge + /// zone /// + /// + /// Gets a list of all virtual machine image versions for the specified edge + /// zone + /// /// /// The name of Azure region. /// @@ -45,14 +39,16 @@ public partial interface IVirtualMachineImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListByEdgeZoneWithHttpMessagesAsync(string location, string edgeZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListByEdgeZoneWithHttpMessagesAsync(string location, string edgeZone, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets a list of virtual machine image publishers for the specified - /// Azure location. + /// Gets a list of virtual machine image publishers for the specified Azure + /// location. /// + /// + /// Gets a list of virtual machine image publishers for the specified Azure + /// location. + /// /// /// The name of Azure region. /// @@ -68,14 +64,16 @@ public partial interface IVirtualMachineImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListPublishersWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListPublishersWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets a list of virtual machine image offers for the specified - /// location and publisher. + /// Gets a list of virtual machine image offers for the specified location and + /// publisher. /// + /// + /// Gets a list of virtual machine image offers for the specified location and + /// publisher. + /// /// /// The name of Azure region. /// @@ -94,14 +92,16 @@ public partial interface IVirtualMachineImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListOffersWithHttpMessagesAsync(string location, string publisherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListOffersWithHttpMessagesAsync(string location, string publisherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets a list of virtual machine image SKUs for the specified - /// location, publisher, and offer. + /// Gets a list of virtual machine image SKUs for the specified location, + /// publisher, and offer. /// + /// + /// Gets a list of virtual machine image SKUs for the specified location, + /// publisher, and offer. + /// /// /// The name of Azure region. /// @@ -123,14 +123,16 @@ public partial interface IVirtualMachineImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListSkusWithHttpMessagesAsync(string location, string publisherName, string offer, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListSkusWithHttpMessagesAsync(string location, string publisherName, string offer, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a list of all virtual machine image versions for the specified /// location, publisher, offer, and SKU. /// + /// + /// Gets a list of all virtual machine image versions for the specified + /// location, publisher, offer, and SKU. + /// /// /// The name of Azure region. /// @@ -147,8 +149,10 @@ public partial interface IVirtualMachineImagesOperations /// The expand expression to apply on the operation. /// /// + /// /// /// + /// /// /// /// The headers that will be added to request. @@ -162,13 +166,14 @@ public partial interface IVirtualMachineImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a virtual machine image. /// + /// + /// Gets a virtual machine image. + /// /// /// The name of Azure region. /// @@ -196,10 +201,8 @@ public partial interface IVirtualMachineImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string location, string publisherName, string offer, string skus, string version, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string publisherName, string offer, string skus, string version, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The name of Azure region. /// @@ -216,8 +219,10 @@ public partial interface IVirtualMachineImagesOperations /// The expand expression to apply on the operation. /// /// + /// /// /// + /// /// /// /// The headers that will be added to request. @@ -231,9 +236,7 @@ public partial interface IVirtualMachineImagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithPropertiesWithHttpMessagesAsync(string location, string publisherName, string offer, string skus, string expand, int? top = default(int?), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithPropertiesWithHttpMessagesAsync(string location, string publisherName, string offer, string skus, string expand, int? top = default(int?), string orderby = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineRunCommandsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineRunCommandsOperations.cs index 1e958d64b002..5d3a6d0344a0 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineRunCommandsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineRunCommandsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineRunCommandsOperations operations. @@ -26,6 +16,9 @@ public partial interface IVirtualMachineRunCommandsOperations /// /// Lists all available run commands for a subscription in a location. /// + /// + /// Lists all available run commands for a subscription in a location. + /// /// /// The name of Azure region. /// @@ -41,21 +34,22 @@ public partial interface IVirtualMachineRunCommandsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets specific run command for a subscription in a location. /// + /// + /// Gets specific run command for a subscription in a location. + /// /// /// The name of Azure region. /// /// - /// Specifies a commandId of predefined built-in script. Command IDs - /// available for Linux are listed at - /// https://aka.ms/RunCommandManagedLinux#available-commands, Windows - /// at https://aka.ms/RunCommandManagedWindows#available-commands. + /// Specifies a commandId of predefined built-in script. Command IDs available + /// for Linux are listed at + /// https://aka.ms/RunCommandManagedLinux#available-commands, Windows at + /// https://aka.ms/RunCommandManagedWindows#available-commands. /// /// /// The headers that will be added to request. @@ -69,13 +63,14 @@ public partial interface IVirtualMachineRunCommandsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string location, string commandId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string commandId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to get all run commands of a Virtual Machine. /// + /// + /// The operation to get all run commands of a Virtual Machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -97,13 +92,14 @@ public partial interface IVirtualMachineRunCommandsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByVirtualMachineWithHttpMessagesAsync(string resourceGroupName, string vmName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByVirtualMachineWithHttpMessagesAsync(string resourceGroupName, string vmName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to get the run command. /// + /// + /// The operation to get the run command. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -128,13 +124,14 @@ public partial interface IVirtualMachineRunCommandsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetByVirtualMachineWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetByVirtualMachineWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to create or update the run command. /// + /// + /// The operation to create or update the run command. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -145,8 +142,7 @@ public partial interface IVirtualMachineRunCommandsOperations /// The name of the VirtualMachineRunCommand /// /// - /// Parameters supplied to the Create Virtual Machine RunCommand - /// operation. + /// Parameters supplied to the Create Virtual Machine RunCommand operation. /// /// /// The headers that will be added to request. @@ -160,13 +156,14 @@ public partial interface IVirtualMachineRunCommandsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommand runCommand, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommand runCommand, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to update the run command. /// + /// + /// The operation to update the run command. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -177,8 +174,7 @@ public partial interface IVirtualMachineRunCommandsOperations /// The name of the VirtualMachineRunCommand /// /// - /// Parameters supplied to the Update Virtual Machine RunCommand - /// operation. + /// Parameters supplied to the Update Virtual Machine RunCommand operation. /// /// /// The headers that will be added to request. @@ -192,13 +188,14 @@ public partial interface IVirtualMachineRunCommandsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommandUpdate runCommand, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommandUpdate runCommand, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to delete the run command. /// + /// + /// The operation to delete the run command. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -217,13 +214,14 @@ public partial interface IVirtualMachineRunCommandsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to create or update the run command. /// + /// + /// The operation to create or update the run command. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -234,8 +232,7 @@ public partial interface IVirtualMachineRunCommandsOperations /// The name of the VirtualMachineRunCommand /// /// - /// Parameters supplied to the Create Virtual Machine RunCommand - /// operation. + /// Parameters supplied to the Create Virtual Machine RunCommand operation. /// /// /// The headers that will be added to request. @@ -249,13 +246,14 @@ public partial interface IVirtualMachineRunCommandsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommand runCommand, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommand runCommand, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to update the run command. /// + /// + /// The operation to update the run command. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -266,8 +264,7 @@ public partial interface IVirtualMachineRunCommandsOperations /// The name of the VirtualMachineRunCommand /// /// - /// Parameters supplied to the Update Virtual Machine RunCommand - /// operation. + /// Parameters supplied to the Update Virtual Machine RunCommand operation. /// /// /// The headers that will be added to request. @@ -281,13 +278,14 @@ public partial interface IVirtualMachineRunCommandsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommandUpdate runCommand, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommandUpdate runCommand, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to delete the run command. /// + /// + /// The operation to delete the run command. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -306,13 +304,14 @@ public partial interface IVirtualMachineRunCommandsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all available run commands for a subscription in a location. /// + /// + /// Lists all available run commands for a subscription in a location. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -328,13 +327,14 @@ public partial interface IVirtualMachineRunCommandsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to get all run commands of a Virtual Machine. /// + /// + /// The operation to get all run commands of a Virtual Machine. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -350,9 +350,7 @@ public partial interface IVirtualMachineRunCommandsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByVirtualMachineNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByVirtualMachineNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetExtensionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetExtensionsOperations.cs index 670ba9f458e1..f7ad4d4e830a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetExtensionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetExtensionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineScaleSetExtensionsOperations operations. @@ -26,6 +16,9 @@ public partial interface IVirtualMachineScaleSetExtensionsOperations /// /// Gets a list of all extensions in a VM scale set. /// + /// + /// Gets a list of all extensions in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -44,13 +37,14 @@ public partial interface IVirtualMachineScaleSetExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to get the extension. /// + /// + /// The operation to get the extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -75,13 +69,14 @@ public partial interface IVirtualMachineScaleSetExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to create or update an extension. /// + /// + /// The operation to create or update an extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -106,13 +101,14 @@ public partial interface IVirtualMachineScaleSetExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to update an extension. /// + /// + /// The operation to update an extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -137,13 +133,14 @@ public partial interface IVirtualMachineScaleSetExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to delete the extension. /// + /// + /// The operation to delete the extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -162,13 +159,14 @@ public partial interface IVirtualMachineScaleSetExtensionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to create or update an extension. /// + /// + /// The operation to create or update an extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -193,13 +191,14 @@ public partial interface IVirtualMachineScaleSetExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to update an extension. /// + /// + /// The operation to update an extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -224,13 +223,14 @@ public partial interface IVirtualMachineScaleSetExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to delete the extension. /// + /// + /// The operation to delete the extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -249,13 +249,14 @@ public partial interface IVirtualMachineScaleSetExtensionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a list of all extensions in a VM scale set. /// + /// + /// Gets a list of all extensions in a VM scale set. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -271,9 +272,7 @@ public partial interface IVirtualMachineScaleSetExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetRollingUpgradesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetRollingUpgradesOperations.cs index 74dc973bce31..d2efadaeb184 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetRollingUpgradesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetRollingUpgradesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineScaleSetRollingUpgradesOperations operations. @@ -24,11 +14,15 @@ namespace Microsoft.Azure.Management.Compute public partial interface IVirtualMachineScaleSetRollingUpgradesOperations { /// - /// Starts a rolling upgrade to move all extensions for all virtual - /// machine scale set instances to the latest available extension - /// version. Instances which are already running the latest extension - /// versions are not affected. + /// Starts a rolling upgrade to move all extensions for all virtual machine + /// scale set instances to the latest available extension version. Instances + /// which are already running the latest extension versions are not affected. /// + /// + /// Starts a rolling upgrade to move all extensions for all virtual machine + /// scale set instances to the latest available extension version. Instances + /// which are already running the latest extension versions are not affected. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -44,16 +38,18 @@ public partial interface IVirtualMachineScaleSetRollingUpgradesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task StartExtensionUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task StartExtensionUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Starts a rolling upgrade to move all virtual machine scale set - /// instances to the latest available Platform Image OS version. - /// Instances which are already running the latest available OS version - /// are not affected. + /// Starts a rolling upgrade to move all virtual machine scale set instances to + /// the latest available Platform Image OS version. Instances which are already + /// running the latest available OS version are not affected. /// + /// + /// Starts a rolling upgrade to move all virtual machine scale set instances to + /// the latest available Platform Image OS version. Instances which are already + /// running the latest available OS version are not affected. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -69,13 +65,14 @@ public partial interface IVirtualMachineScaleSetRollingUpgradesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task StartOSUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task StartOSUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Cancels the current virtual machine scale set rolling upgrade. /// + /// + /// Cancels the current virtual machine scale set rolling upgrade. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -91,14 +88,14 @@ public partial interface IVirtualMachineScaleSetRollingUpgradesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task CancelWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task CancelWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the status of the latest virtual machine scale set rolling - /// upgrade. + /// Gets the status of the latest virtual machine scale set rolling upgrade. /// + /// + /// Gets the status of the latest virtual machine scale set rolling upgrade. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -117,16 +114,18 @@ public partial interface IVirtualMachineScaleSetRollingUpgradesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetLatestWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetLatestWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Starts a rolling upgrade to move all extensions for all virtual - /// machine scale set instances to the latest available extension - /// version. Instances which are already running the latest extension - /// versions are not affected. + /// Starts a rolling upgrade to move all extensions for all virtual machine + /// scale set instances to the latest available extension version. Instances + /// which are already running the latest extension versions are not affected. /// + /// + /// Starts a rolling upgrade to move all extensions for all virtual machine + /// scale set instances to the latest available extension version. Instances + /// which are already running the latest extension versions are not affected. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -142,16 +141,18 @@ public partial interface IVirtualMachineScaleSetRollingUpgradesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginStartExtensionUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginStartExtensionUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Starts a rolling upgrade to move all virtual machine scale set - /// instances to the latest available Platform Image OS version. - /// Instances which are already running the latest available OS version - /// are not affected. + /// Starts a rolling upgrade to move all virtual machine scale set instances to + /// the latest available Platform Image OS version. Instances which are already + /// running the latest available OS version are not affected. /// + /// + /// Starts a rolling upgrade to move all virtual machine scale set instances to + /// the latest available Platform Image OS version. Instances which are already + /// running the latest available OS version are not affected. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -167,13 +168,14 @@ public partial interface IVirtualMachineScaleSetRollingUpgradesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginStartOSUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginStartOSUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Cancels the current virtual machine scale set rolling upgrade. /// + /// + /// Cancels the current virtual machine scale set rolling upgrade. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -189,9 +191,7 @@ public partial interface IVirtualMachineScaleSetRollingUpgradesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginCancelWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginCancelWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetVMExtensionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetVMExtensionsOperations.cs index 76eca9e019ae..4e23c05a8f39 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetVMExtensionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetVMExtensionsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineScaleSetVMExtensionsOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Compute public partial interface IVirtualMachineScaleSetVMExtensionsOperations { /// - /// The operation to get all extensions of an instance in Virtual - /// Machine Scaleset. + /// The operation to get all extensions of an instance in Virtual Machine + /// Scaleset. /// + /// + /// The operation to get all extensions of an instance in Virtual Machine + /// Scaleset. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -51,13 +45,14 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to get the VMSS VM extension. /// + /// + /// The operation to get the VMSS VM extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -85,13 +80,14 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to create or update the VMSS VM extension. /// + /// + /// The operation to create or update the VMSS VM extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -105,8 +101,7 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// The name of the virtual machine extension. /// /// - /// Parameters supplied to the Create Virtual Machine Extension - /// operation. + /// Parameters supplied to the Create Virtual Machine Extension operation. /// /// /// The headers that will be added to request. @@ -120,13 +115,14 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to update the VMSS VM extension. /// + /// + /// The operation to update the VMSS VM extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -140,8 +136,7 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// The name of the virtual machine extension. /// /// - /// Parameters supplied to the Update Virtual Machine Extension - /// operation. + /// Parameters supplied to the Update Virtual Machine Extension operation. /// /// /// The headers that will be added to request. @@ -155,13 +150,14 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to delete the VMSS VM extension. /// + /// + /// The operation to delete the VMSS VM extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -183,13 +179,14 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to create or update the VMSS VM extension. /// + /// + /// The operation to create or update the VMSS VM extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -203,8 +200,7 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// The name of the virtual machine extension. /// /// - /// Parameters supplied to the Create Virtual Machine Extension - /// operation. + /// Parameters supplied to the Create Virtual Machine Extension operation. /// /// /// The headers that will be added to request. @@ -218,13 +214,14 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to update the VMSS VM extension. /// + /// + /// The operation to update the VMSS VM extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -238,8 +235,7 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// The name of the virtual machine extension. /// /// - /// Parameters supplied to the Update Virtual Machine Extension - /// operation. + /// Parameters supplied to the Update Virtual Machine Extension operation. /// /// /// The headers that will be added to request. @@ -253,13 +249,14 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to delete the VMSS VM extension. /// + /// + /// The operation to delete the VMSS VM extension. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -281,9 +278,7 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetVMRunCommandsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetVMRunCommandsOperations.cs index 18aebbc142c1..60e5433eff5b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetVMRunCommandsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetVMRunCommandsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineScaleSetVMRunCommandsOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Compute public partial interface IVirtualMachineScaleSetVMRunCommandsOperations { /// - /// The operation to get all run commands of an instance in Virtual - /// Machine Scaleset. + /// The operation to get all run commands of an instance in Virtual Machine + /// Scaleset. /// + /// + /// The operation to get all run commands of an instance in Virtual Machine + /// Scaleset. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -51,13 +45,14 @@ public partial interface IVirtualMachineScaleSetVMRunCommandsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to get the VMSS VM run command. /// + /// + /// The operation to get the VMSS VM run command. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -85,13 +80,14 @@ public partial interface IVirtualMachineScaleSetVMRunCommandsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to create or update the VMSS VM run command. /// + /// + /// The operation to create or update the VMSS VM run command. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -105,8 +101,7 @@ public partial interface IVirtualMachineScaleSetVMRunCommandsOperations /// The name of the VirtualMachineRunCommand /// /// - /// Parameters supplied to the Create Virtual Machine RunCommand - /// operation. + /// Parameters supplied to the Create Virtual Machine RunCommand operation. /// /// /// The headers that will be added to request. @@ -120,13 +115,14 @@ public partial interface IVirtualMachineScaleSetVMRunCommandsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommand runCommand, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommand runCommand, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to update the VMSS VM run command. /// + /// + /// The operation to update the VMSS VM run command. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -154,13 +150,14 @@ public partial interface IVirtualMachineScaleSetVMRunCommandsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommandUpdate runCommand, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommandUpdate runCommand, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to delete the VMSS VM run command. /// + /// + /// The operation to delete the VMSS VM run command. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -182,13 +179,14 @@ public partial interface IVirtualMachineScaleSetVMRunCommandsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to create or update the VMSS VM run command. /// + /// + /// The operation to create or update the VMSS VM run command. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -202,8 +200,7 @@ public partial interface IVirtualMachineScaleSetVMRunCommandsOperations /// The name of the VirtualMachineRunCommand /// /// - /// Parameters supplied to the Create Virtual Machine RunCommand - /// operation. + /// Parameters supplied to the Create Virtual Machine RunCommand operation. /// /// /// The headers that will be added to request. @@ -217,13 +214,14 @@ public partial interface IVirtualMachineScaleSetVMRunCommandsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommand runCommand, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommand runCommand, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to update the VMSS VM run command. /// + /// + /// The operation to update the VMSS VM run command. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -251,13 +249,14 @@ public partial interface IVirtualMachineScaleSetVMRunCommandsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommandUpdate runCommand, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommandUpdate runCommand, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to delete the VMSS VM run command. /// + /// + /// The operation to delete the VMSS VM run command. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -279,14 +278,16 @@ public partial interface IVirtualMachineScaleSetVMRunCommandsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to get all run commands of an instance in Virtual - /// Machine Scaleset. + /// The operation to get all run commands of an instance in Virtual Machine + /// Scaleset. /// + /// + /// The operation to get all run commands of an instance in Virtual Machine + /// Scaleset. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -302,9 +303,7 @@ public partial interface IVirtualMachineScaleSetVMRunCommandsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetVMsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetVMsOperations.cs index 56c9791633e5..3310e5d07a9a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetVMsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetVMsOperations.cs @@ -1,31 +1,24 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// VirtualMachineScaleSetVMsOperations operations. + /// VirtualMachineScaleSetVMSOperations operations. /// - public partial interface IVirtualMachineScaleSetVMsOperations + public partial interface IVirtualMachineScaleSetVMSOperations { /// /// Gets a list of all virtual machines in a VM scale sets. /// + /// + /// Gets a list of all virtual machines in a VM scale sets. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -34,17 +27,17 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// /// The filter to apply to the operation. Allowed values are - /// 'startswith(instanceView/statuses/code, 'PowerState') eq true', - /// 'properties/latestModelApplied eq true', - /// 'properties/latestModelApplied eq false'. + /// 'startswith(instanceView/statuses/code, 'PowerState') eq true', + /// 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq + /// false'. /// /// - /// The list parameters. Allowed values are 'instanceView', - /// 'instanceView/statuses'. + /// The list parameters. Allowed values are 'instanceView', + /// 'instanceView/statuses'. /// /// /// The expand expression to apply to the operation. Allowed values are - /// 'instanceView'. + /// 'instanceView'. /// /// /// The headers that will be added to request. @@ -58,13 +51,14 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string filter = default(string), string select = default(string), string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string filter = default(string), string select = default(string), string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a virtual machine from a VM scale set. /// + /// + /// Gets a virtual machine from a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -75,10 +69,9 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// The instance ID of the virtual machine. /// /// - /// The expand expression to apply on the operation. 'InstanceView' - /// will retrieve the instance view of the virtual machine. 'UserData' - /// will retrieve the UserData of the virtual machine. Possible values - /// include: 'instanceView', 'userData', 'resiliencyView' + /// The expand expression to apply on the operation. 'InstanceView' will + /// retrieve the instance view of the virtual machine. 'UserData' will retrieve + /// the UserData of the virtual machine. /// /// /// The headers that will be added to request. @@ -92,13 +85,14 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VmssVMInstanceViewTypes? expand = default(VmssVMInstanceViewTypes?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VmssVMInstanceViewTypes? expand = default(VmssVMInstanceViewTypes?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a virtual machine of a VM scale set. /// + /// + /// Updates a virtual machine of a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -108,19 +102,18 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// The instance ID of the virtual machine. /// - /// - /// Parameters supplied to the Update Virtual Machine Scale Sets VM - /// operation. - /// /// - /// The ETag of the transformation. Omit this value to always overwrite - /// the current resource. Specify the last-seen ETag value to prevent - /// accidentally overwriting concurrent changes. + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent - /// updating an existing record set. Other values will result in error - /// from server as they are not supported. + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// Parameters supplied to the Update Virtual Machine Scale Sets VM operation. /// /// /// The headers that will be added to request. @@ -134,13 +127,14 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a virtual machine from a VM scale set. /// + /// + /// Deletes a virtual machine from a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -151,8 +145,8 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// The instance ID of the virtual machine. /// /// - /// Optional parameter to force delete a virtual machine from a VM - /// scale set. (Feature in Preview) + /// Optional parameter to force delete a virtual machine from a VM scale set. + /// (Feature in Preview) /// /// /// The headers that will be added to request. @@ -163,14 +157,16 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Approve upgrade on deferred rolling upgrade for OS disk on a VM - /// scale set instance. + /// Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set + /// instance. /// + /// + /// Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set + /// instance. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -189,14 +185,14 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> ApproveRollingUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ApproveRollingUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Attach and detach data disks to/from a virtual machine in a VM - /// scale set. + /// Attach and detach data disks to/from a virtual machine in a VM scale set. /// + /// + /// Attach and detach data disks to/from a virtual machine in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -207,8 +203,8 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// The instance ID of the virtual machine. /// /// - /// Parameters supplied to the attach and detach data disks operation - /// on a Virtual Machine Scale Sets VM. + /// Parameters supplied to the attach and detach data disks operation on a + /// Virtual Machine Scale Sets VM. /// /// /// The headers that will be added to request. @@ -222,16 +218,20 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> AttachDetachDataDisksWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, AttachDetachDataDisksRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> AttachDetachDataDisksWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, AttachDetachDataDisksRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deallocates a specific virtual machine in a VM scale set. Shuts - /// down the virtual machine and releases the compute resources it - /// uses. You are not billed for the compute resources of this virtual - /// machine once it is deallocated. - /// + /// Deallocates a specific virtual machine in a VM scale set. Shuts down the + /// virtual machine and releases the compute resources it uses. You are not + /// billed for the compute resources of this virtual machine once it is + /// deallocated. + /// + /// + /// Deallocates a specific virtual machine in a VM scale set. Shuts down the + /// virtual machine and releases the compute resources it uses. You are not + /// billed for the compute resources of this virtual machine once it is + /// deallocated. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -250,13 +250,14 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeallocateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeallocateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the status of a virtual machine from a VM scale set. /// + /// + /// Gets the status of a virtual machine from a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -278,13 +279,14 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetInstanceViewWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetInstanceViewWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Performs maintenance on a virtual machine in a VM scale set. /// + /// + /// Performs maintenance on a virtual machine in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -303,16 +305,18 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task PerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task PerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Power off (stop) a virtual machine in a VM scale set. Note that - /// resources are still attached and you are getting charged for the - /// resources. Instead, use deallocate to release resources and avoid - /// charges. + /// Power off (stop) a virtual machine in a VM scale set. Note that resources + /// are still attached and you are getting charged for the resources. Instead, + /// use deallocate to release resources and avoid charges. /// + /// + /// Power off (stop) a virtual machine in a VM scale set. Note that resources + /// are still attached and you are getting charged for the resources. Instead, + /// use deallocate to release resources and avoid charges. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -323,9 +327,9 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// The instance ID of the virtual machine. /// /// - /// The parameter to request non-graceful VM shutdown. True value for - /// this flag indicates non-graceful shutdown whereas false indicates - /// otherwise. Default value for this flag is false if not specified + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified /// /// /// The headers that will be added to request. @@ -336,14 +340,16 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Shuts down the virtual machine in the virtual machine scale set, - /// moves it to a new node, and powers it back on. + /// Shuts down the virtual machine in the virtual machine scale set, moves it + /// to a new node, and powers it back on. /// + /// + /// Shuts down the virtual machine in the virtual machine scale set, moves it + /// to a new node, and powers it back on. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -362,14 +368,16 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task RedeployWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task RedeployWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Reimages (upgrade the operating system) a specific virtual machine - /// in a VM scale set. + /// Reimages (upgrade the operating system) a specific virtual machine in a VM + /// scale set. /// + /// + /// Reimages (upgrade the operating system) a specific virtual machine in a VM + /// scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -391,15 +399,16 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ReimageWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ReimageWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Allows you to re-image all the disks ( including data disks ) in - /// the a VM scale set instance. This operation is only supported for - /// managed disks. + /// Allows you to re-image all the disks ( including data disks ) in the a VM + /// scale set instance. This operation is only supported for managed disks. /// + /// + /// Allows you to re-image all the disks ( including data disks ) in the a VM + /// scale set instance. This operation is only supported for managed disks. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -418,13 +427,14 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ReimageAllWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ReimageAllWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Restarts a virtual machine in a VM scale set. /// + /// + /// Restarts a virtual machine in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -443,14 +453,16 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task RestartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task RestartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to retrieve SAS URIs of boot diagnostic logs for a - /// virtual machine in a VM scale set. + /// The operation to retrieve SAS URIs of boot diagnostic logs for a virtual + /// machine in a VM scale set. /// + /// + /// The operation to retrieve SAS URIs of boot diagnostic logs for a virtual + /// machine in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -461,10 +473,9 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// The instance ID of the virtual machine. /// /// - /// Expiration duration in minutes for the SAS URIs with a value - /// between 1 to 1440 minutes. **Note:** If not specified, SAS URIs - /// will be generated with a default expiration duration of 120 - /// minutes. + /// Expiration duration in minutes for the SAS URIs with a value between 1 to + /// 1440 minutes. **Note:** If not specified, SAS URIs will be generated with a + /// default expiration duration of 120 minutes. /// /// /// The headers that will be added to request. @@ -478,13 +489,14 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> RetrieveBootDiagnosticsDataWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, int? sasUriExpirationTimeInMinutes = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> RetrieveBootDiagnosticsDataWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, int? sasUriExpirationTimeInMinutes = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Run command on a virtual machine in a VM scale set. /// + /// + /// Run command on a virtual machine in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -509,14 +521,16 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> RunCommandWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, RunCommandInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> RunCommandWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, RunCommandInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to simulate the eviction of spot virtual machine in a - /// VM scale set. + /// The operation to simulate the eviction of spot virtual machine in a VM + /// scale set. /// + /// + /// The operation to simulate the eviction of spot virtual machine in a VM + /// scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -535,13 +549,14 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task SimulateEvictionWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task SimulateEvictionWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Starts a virtual machine in a VM scale set. /// + /// + /// Starts a virtual machine in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -560,13 +575,14 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task StartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a virtual machine of a VM scale set. /// + /// + /// Updates a virtual machine of a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -576,19 +592,18 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// The instance ID of the virtual machine. /// - /// - /// Parameters supplied to the Update Virtual Machine Scale Sets VM - /// operation. - /// /// - /// The ETag of the transformation. Omit this value to always overwrite - /// the current resource. Specify the last-seen ETag value to prevent - /// accidentally overwriting concurrent changes. + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent - /// updating an existing record set. Other values will result in error - /// from server as they are not supported. + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// Parameters supplied to the Update Virtual Machine Scale Sets VM operation. /// /// /// The headers that will be added to request. @@ -602,13 +617,14 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a virtual machine from a VM scale set. /// + /// + /// Deletes a virtual machine from a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -619,8 +635,8 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// The instance ID of the virtual machine. /// /// - /// Optional parameter to force delete a virtual machine from a VM - /// scale set. (Feature in Preview) + /// Optional parameter to force delete a virtual machine from a VM scale set. + /// (Feature in Preview) /// /// /// The headers that will be added to request. @@ -631,14 +647,16 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Approve upgrade on deferred rolling upgrade for OS disk on a VM - /// scale set instance. + /// Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set + /// instance. /// + /// + /// Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set + /// instance. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -657,14 +675,14 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginApproveRollingUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginApproveRollingUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Attach and detach data disks to/from a virtual machine in a VM - /// scale set. + /// Attach and detach data disks to/from a virtual machine in a VM scale set. /// + /// + /// Attach and detach data disks to/from a virtual machine in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -675,8 +693,8 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// The instance ID of the virtual machine. /// /// - /// Parameters supplied to the attach and detach data disks operation - /// on a Virtual Machine Scale Sets VM. + /// Parameters supplied to the attach and detach data disks operation on a + /// Virtual Machine Scale Sets VM. /// /// /// The headers that will be added to request. @@ -690,16 +708,20 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginAttachDetachDataDisksWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, AttachDetachDataDisksRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginAttachDetachDataDisksWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, AttachDetachDataDisksRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deallocates a specific virtual machine in a VM scale set. Shuts - /// down the virtual machine and releases the compute resources it - /// uses. You are not billed for the compute resources of this virtual - /// machine once it is deallocated. - /// + /// Deallocates a specific virtual machine in a VM scale set. Shuts down the + /// virtual machine and releases the compute resources it uses. You are not + /// billed for the compute resources of this virtual machine once it is + /// deallocated. + /// + /// + /// Deallocates a specific virtual machine in a VM scale set. Shuts down the + /// virtual machine and releases the compute resources it uses. You are not + /// billed for the compute resources of this virtual machine once it is + /// deallocated. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -718,13 +740,14 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeallocateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeallocateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Performs maintenance on a virtual machine in a VM scale set. /// + /// + /// Performs maintenance on a virtual machine in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -743,16 +766,18 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginPerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginPerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Power off (stop) a virtual machine in a VM scale set. Note that - /// resources are still attached and you are getting charged for the - /// resources. Instead, use deallocate to release resources and avoid - /// charges. + /// Power off (stop) a virtual machine in a VM scale set. Note that resources + /// are still attached and you are getting charged for the resources. Instead, + /// use deallocate to release resources and avoid charges. /// + /// + /// Power off (stop) a virtual machine in a VM scale set. Note that resources + /// are still attached and you are getting charged for the resources. Instead, + /// use deallocate to release resources and avoid charges. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -763,9 +788,9 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// The instance ID of the virtual machine. /// /// - /// The parameter to request non-graceful VM shutdown. True value for - /// this flag indicates non-graceful shutdown whereas false indicates - /// otherwise. Default value for this flag is false if not specified + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified /// /// /// The headers that will be added to request. @@ -776,14 +801,16 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Shuts down the virtual machine in the virtual machine scale set, - /// moves it to a new node, and powers it back on. + /// Shuts down the virtual machine in the virtual machine scale set, moves it + /// to a new node, and powers it back on. /// + /// + /// Shuts down the virtual machine in the virtual machine scale set, moves it + /// to a new node, and powers it back on. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -802,14 +829,16 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRedeployWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginRedeployWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Reimages (upgrade the operating system) a specific virtual machine - /// in a VM scale set. + /// Reimages (upgrade the operating system) a specific virtual machine in a VM + /// scale set. /// + /// + /// Reimages (upgrade the operating system) a specific virtual machine in a VM + /// scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -831,15 +860,16 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginReimageWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginReimageWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Allows you to re-image all the disks ( including data disks ) in - /// the a VM scale set instance. This operation is only supported for - /// managed disks. + /// Allows you to re-image all the disks ( including data disks ) in the a VM + /// scale set instance. This operation is only supported for managed disks. /// + /// + /// Allows you to re-image all the disks ( including data disks ) in the a VM + /// scale set instance. This operation is only supported for managed disks. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -858,13 +888,14 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginReimageAllWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginReimageAllWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Restarts a virtual machine in a VM scale set. /// + /// + /// Restarts a virtual machine in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -883,13 +914,14 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Run command on a virtual machine in a VM scale set. /// + /// + /// Run command on a virtual machine in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -914,13 +946,14 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginRunCommandWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, RunCommandInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginRunCommandWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, RunCommandInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Starts a virtual machine in a VM scale set. /// + /// + /// Starts a virtual machine in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -939,13 +972,14 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a list of all virtual machines in a VM scale sets. /// + /// + /// Gets a list of all virtual machines in a VM scale sets. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -961,9 +995,7 @@ public partial interface IVirtualMachineScaleSetVMsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetsOperations.cs index 12ba14fe7843..ae2220e22df6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineScaleSetsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineScaleSetsOperations operations. @@ -27,6 +17,10 @@ public partial interface IVirtualMachineScaleSetsOperations /// Gets all the VM scale sets under the specified subscription for the /// specified location. /// + /// + /// Gets all the VM scale sets under the specified subscription for the + /// specified location. + /// /// /// The name of Azure region. /// @@ -42,16 +36,20 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByLocationWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByLocationWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets a list of all VM Scale Sets in the subscription, regardless of - /// the associated resource group. Use nextLink property in the - /// response to get the next page of VM Scale Sets. Do this till - /// nextLink is null to fetch all the VM Scale Sets. + /// Gets a list of all VM Scale Sets in the subscription, regardless of the + /// associated resource group. Use nextLink property in the response to get the + /// next page of VM Scale Sets. Do this till nextLink is null to fetch all the + /// VM Scale Sets. /// + /// + /// Gets a list of all VM Scale Sets in the subscription, regardless of the + /// associated resource group. Use nextLink property in the response to get the + /// next page of VM Scale Sets. Do this till nextLink is null to fetch all the + /// VM Scale Sets. + /// /// /// The headers that will be added to request. /// @@ -64,13 +62,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a list of all VM scale sets under a resource group. /// + /// + /// Gets a list of all VM scale sets under a resource group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -86,13 +85,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Display information about a virtual machine scale set. /// + /// + /// Display information about a virtual machine scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -100,10 +100,9 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// The expand expression to apply on the operation. 'UserData' - /// retrieves the UserData property of the VM scale set that was - /// provided by the user during the VM scale set Create/Update - /// operation. Possible values include: 'userData' + /// The expand expression to apply on the operation. 'UserData' retrieves the + /// UserData property of the VM scale set that was provided by the user during + /// the VM scale set Create/Update operation /// /// /// The headers that will be added to request. @@ -117,31 +116,32 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a VM scale set. /// + /// + /// Create or update a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the VM scale set. /// - /// - /// The scale set object. - /// /// - /// The ETag of the transformation. Omit this value to always overwrite - /// the current resource. Specify the last-seen ETag value to prevent - /// accidentally overwriting concurrent changes. + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent - /// updating an existing record set. Other values will result in error - /// from server as they are not supported. + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// The scale set object. /// /// /// The headers that will be added to request. @@ -155,31 +155,32 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSet parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSet parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a VM scale set. /// + /// + /// Update a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the VM scale set. /// - /// - /// The scale set object. - /// /// - /// The ETag of the transformation. Omit this value to always overwrite - /// the current resource. Specify the last-seen ETag value to prevent - /// accidentally overwriting concurrent changes. + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent - /// updating an existing record set. Other values will result in error - /// from server as they are not supported. + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// The scale set object. /// /// /// The headers that will be added to request. @@ -193,13 +194,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a VM scale set. /// + /// + /// Deletes a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -207,8 +209,7 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// Optional parameter to force delete a VM scale set. (Feature in - /// Preview) + /// Optional parameter to force delete a VM scale set. (Feature in Preview) /// /// /// The headers that will be added to request. @@ -219,14 +220,16 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Approve upgrade on deferred rolling upgrades for OS disks in the - /// virtual machines in a VM scale set. + /// Approve upgrade on deferred rolling upgrades for OS disks in the virtual + /// machines in a VM scale set. /// + /// + /// Approve upgrade on deferred rolling upgrades for OS disks in the virtual + /// machines in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -234,9 +237,9 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// The virtual machine scale set instance ids. Omitting the virtual - /// machine scale set instance ids will result in the operation being - /// performed on all virtual machines in the virtual machine scale set. + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. /// /// /// The headers that will be added to request. @@ -247,14 +250,16 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> ApproveRollingUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ApproveRollingUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Converts SinglePlacementGroup property to false for a existing - /// virtual machine scale set. + /// Converts SinglePlacementGroup property to false for a existing virtual + /// machine scale set. /// + /// + /// Converts SinglePlacementGroup property to false for a existing virtual + /// machine scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -263,10 +268,9 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// /// Id of the placement group in which you want future virtual machine - /// instances to be placed. To query placement group Id, please use - /// Virtual Machine Scale Set VMs - Get API. If not provided, the - /// platform will choose one with maximum number of virtual machine - /// instances. + /// instances to be placed. To query placement group Id, please use Virtual + /// Machine Scale Set VMs - Get API. If not provided, the platform will choose + /// one with maximum number of virtual machine instances. /// /// /// The headers that will be added to request. @@ -277,16 +281,18 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ConvertToSinglePlacementGroupWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string activePlacementGroupId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ConvertToSinglePlacementGroupWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string activePlacementGroupId = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deallocates specific virtual machines in a VM scale set. Shuts down - /// the virtual machines and releases the compute resources. You are - /// not billed for the compute resources that this virtual machine - /// scale set deallocates. + /// Deallocates specific virtual machines in a VM scale set. Shuts down the + /// virtual machines and releases the compute resources. You are not billed for + /// the compute resources that this virtual machine scale set deallocates. /// + /// + /// Deallocates specific virtual machines in a VM scale set. Shuts down the + /// virtual machines and releases the compute resources. You are not billed for + /// the compute resources that this virtual machine scale set deallocates. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -294,14 +300,13 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// Optional parameter to hibernate a virtual machine from the VM scale - /// set. (This feature is available for VMSS with Flexible - /// OrchestrationMode only) + /// Optional parameter to hibernate a virtual machine from the VM scale set. + /// (This feature is available for VMSS with Flexible OrchestrationMode only) /// /// - /// The virtual machine scale set instance ids. Omitting the virtual - /// machine scale set instance ids will result in the operation being - /// performed on all virtual machines in the virtual machine scale set. + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. /// /// /// The headers that will be added to request. @@ -312,26 +317,27 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeallocateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? hibernate = default(bool?), IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeallocateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), bool? hibernate = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes virtual machines in a VM scale set. /// + /// + /// Deletes virtual machines in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the VM scale set. /// + /// + /// Optional parameter to force delete virtual machines from the VM scale set. + /// (Feature in Preview) + /// /// /// The virtual machine scale set instance ids. /// - /// - /// Optional parameter to force delete virtual machines from the VM - /// scale set. (Feature in Preview) - /// /// /// The headers that will be added to request. /// @@ -341,14 +347,16 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds, bool? forceDeletion = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Manual platform update domain walk to update virtual machines in a - /// service fabric virtual machine scale set. + /// Manual platform update domain walk to update virtual machines in a service + /// fabric virtual machine scale set. /// + /// + /// Manual platform update domain walk to update virtual machines in a service + /// fabric virtual machine scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -356,16 +364,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// The platform update domain for which a manual recovery walk is - /// requested + /// The platform update domain for which a manual recovery walk is requested /// /// - /// The zone in which the manual recovery walk is requested for cross - /// zone virtual machine scale set + /// The zone in which the manual recovery walk is requested for cross zone + /// virtual machine scale set /// /// - /// The placement group id for which the manual recovery walk is - /// requested. + /// The placement group id for which the manual recovery walk is requested. /// /// /// The headers that will be added to request. @@ -379,13 +385,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ForceRecoveryServiceFabricPlatformUpdateDomainWalkWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, int platformUpdateDomain, string zone = default(string), string placementGroupId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ForceRecoveryServiceFabricPlatformUpdateDomainWalkWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, int platformUpdateDomain, string zone = default(string), string placementGroupId = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the status of a VM scale set instance. /// + /// + /// Gets the status of a VM scale set instance. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -404,14 +411,16 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetInstanceViewWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetInstanceViewWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Upgrades one or more virtual machines to the latest SKU set in the - /// VM scale set model. + /// Upgrades one or more virtual machines to the latest SKU set in the VM scale + /// set model. /// + /// + /// Upgrades one or more virtual machines to the latest SKU set in the VM scale + /// set model. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -430,13 +439,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task UpdateInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task UpdateInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets list of OS upgrades on a VM scale set instance. /// + /// + /// Gets list of OS upgrades on a VM scale set instance. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -455,17 +465,20 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetOSUpgradeHistoryWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> GetOSUpgradeHistoryWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Perform maintenance on one or more virtual machines in a VM scale - /// set. Operation on instances which are not eligible for perform - /// maintenance will be failed. Please refer to best practices for more - /// details: + /// Perform maintenance on one or more virtual machines in a VM scale set. + /// Operation on instances which are not eligible for perform maintenance will + /// be failed. Please refer to best practices for more details: /// https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications /// + /// + /// Perform maintenance on one or more virtual machines in a VM scale set. + /// Operation on instances which are not eligible for perform maintenance will + /// be failed. Please refer to best practices for more details: + /// https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -473,9 +486,9 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// The virtual machine scale set instance ids. Omitting the virtual - /// machine scale set instance ids will result in the operation being - /// performed on all virtual machines in the virtual machine scale set. + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. /// /// /// The headers that will be added to request. @@ -486,16 +499,18 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task PerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task PerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Power off (stop) one or more virtual machines in a VM scale set. - /// Note that resources are still attached and you are getting charged - /// for the resources. Instead, use deallocate to release resources and - /// avoid charges. + /// Power off (stop) one or more virtual machines in a VM scale set. Note that + /// resources are still attached and you are getting charged for the resources. + /// Instead, use deallocate to release resources and avoid charges. /// + /// + /// Power off (stop) one or more virtual machines in a VM scale set. Note that + /// resources are still attached and you are getting charged for the resources. + /// Instead, use deallocate to release resources and avoid charges. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -503,14 +518,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// The parameter to request non-graceful VM shutdown. True value for - /// this flag indicates non-graceful shutdown whereas false indicates - /// otherwise. Default value for this flag is false if not specified + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified /// /// - /// The virtual machine scale set instance ids. Omitting the virtual - /// machine scale set instance ids will result in the operation being - /// performed on all virtual machines in the virtual machine scale set. + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. /// /// /// The headers that will be added to request. @@ -521,14 +536,16 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? skipShutdown = default(bool?), IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), bool? skipShutdown = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Reapplies the Virtual Machine Scale Set Virtual Machine Profile to - /// the Virtual Machine Instances + /// Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the + /// Virtual Machine Instances /// + /// + /// Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the + /// Virtual Machine Instances + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -544,14 +561,16 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> ReapplyWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ReapplyWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Shuts down all the virtual machines in the virtual machine scale - /// set, moves them to a new node, and powers them back on. + /// Shuts down all the virtual machines in the virtual machine scale set, moves + /// them to a new node, and powers them back on. /// + /// + /// Shuts down all the virtual machines in the virtual machine scale set, moves + /// them to a new node, and powers them back on. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -559,9 +578,9 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// The virtual machine scale set instance ids. Omitting the virtual - /// machine scale set instance ids will result in the operation being - /// performed on all virtual machines in the virtual machine scale set. + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. /// /// /// The headers that will be added to request. @@ -572,16 +591,18 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task RedeployWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task RedeployWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Reimages (upgrade the operating system) one or more virtual - /// machines in a VM scale set which don't have a ephemeral OS disk, - /// for virtual machines who have a ephemeral OS disk the virtual - /// machine is reset to initial state. + /// Reimages (upgrade the operating system) one or more virtual machines in a + /// VM scale set which don't have a ephemeral OS disk, for virtual machines who + /// have a ephemeral OS disk the virtual machine is reset to initial state. /// + /// + /// Reimages (upgrade the operating system) one or more virtual machines in a + /// VM scale set which don't have a ephemeral OS disk, for virtual machines who + /// have a ephemeral OS disk the virtual machine is reset to initial state. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -600,15 +621,16 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ReimageWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = default(VirtualMachineScaleSetReimageParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ReimageWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = default(VirtualMachineScaleSetReimageParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Reimages all the disks ( including data disks ) in the virtual - /// machines in a VM scale set. This operation is only supported for - /// managed disks. + /// Reimages all the disks ( including data disks ) in the virtual machines in + /// a VM scale set. This operation is only supported for managed disks. /// + /// + /// Reimages all the disks ( including data disks ) in the virtual machines in + /// a VM scale set. This operation is only supported for managed disks. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -616,9 +638,9 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// The virtual machine scale set instance ids. Omitting the virtual - /// machine scale set instance ids will result in the operation being - /// performed on all virtual machines in the virtual machine scale set. + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. /// /// /// The headers that will be added to request. @@ -629,13 +651,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ReimageAllWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ReimageAllWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Restarts one or more virtual machines in a VM scale set. /// + /// + /// Restarts one or more virtual machines in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -643,9 +666,9 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// The virtual machine scale set instance ids. Omitting the virtual - /// machine scale set instance ids will result in the operation being - /// performed on all virtual machines in the virtual machine scale set. + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. /// /// /// The headers that will be added to request. @@ -656,13 +679,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task RestartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task RestartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Scales out one or more virtual machines in a VM scale set. /// + /// + /// Scales out one or more virtual machines in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -681,13 +705,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> ScaleOutWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VMScaleSetScaleOutInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ScaleOutWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VMScaleSetScaleOutInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Changes ServiceState property for a given service /// + /// + /// Changes ServiceState property for a given service + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -706,14 +731,16 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task SetOrchestrationServiceStateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, OrchestrationServiceStateInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task SetOrchestrationServiceStateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, OrchestrationServiceStateInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets a list of SKUs available for your VM scale set, including the - /// minimum and maximum VM instances allowed for each SKU. + /// Gets a list of SKUs available for your VM scale set, including the minimum + /// and maximum VM instances allowed for each SKU. /// + /// + /// Gets a list of SKUs available for your VM scale set, including the minimum + /// and maximum VM instances allowed for each SKU. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -732,13 +759,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListSkusWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListSkusWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Starts one or more virtual machines in a VM scale set. /// + /// + /// Starts one or more virtual machines in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -746,9 +774,9 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// The virtual machine scale set instance ids. Omitting the virtual - /// machine scale set instance ids will result in the operation being - /// performed on all virtual machines in the virtual machine scale set. + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. /// /// /// The headers that will be added to request. @@ -759,31 +787,32 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task StartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a VM scale set. /// + /// + /// Create or update a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the VM scale set. /// - /// - /// The scale set object. - /// /// - /// The ETag of the transformation. Omit this value to always overwrite - /// the current resource. Specify the last-seen ETag value to prevent - /// accidentally overwriting concurrent changes. + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent - /// updating an existing record set. Other values will result in error - /// from server as they are not supported. + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// The scale set object. /// /// /// The headers that will be added to request. @@ -797,31 +826,32 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSet parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSet parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a VM scale set. /// + /// + /// Update a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the VM scale set. /// - /// - /// The scale set object. - /// /// - /// The ETag of the transformation. Omit this value to always overwrite - /// the current resource. Specify the last-seen ETag value to prevent - /// accidentally overwriting concurrent changes. + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent - /// updating an existing record set. Other values will result in error - /// from server as they are not supported. + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// The scale set object. /// /// /// The headers that will be added to request. @@ -835,13 +865,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a VM scale set. /// + /// + /// Deletes a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -849,8 +880,7 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// Optional parameter to force delete a VM scale set. (Feature in - /// Preview) + /// Optional parameter to force delete a VM scale set. (Feature in Preview) /// /// /// The headers that will be added to request. @@ -861,14 +891,16 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Approve upgrade on deferred rolling upgrades for OS disks in the - /// virtual machines in a VM scale set. + /// Approve upgrade on deferred rolling upgrades for OS disks in the virtual + /// machines in a VM scale set. /// + /// + /// Approve upgrade on deferred rolling upgrades for OS disks in the virtual + /// machines in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -876,9 +908,9 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// The virtual machine scale set instance ids. Omitting the virtual - /// machine scale set instance ids will result in the operation being - /// performed on all virtual machines in the virtual machine scale set. + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. /// /// /// The headers that will be added to request. @@ -889,16 +921,18 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginApproveRollingUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginApproveRollingUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deallocates specific virtual machines in a VM scale set. Shuts down - /// the virtual machines and releases the compute resources. You are - /// not billed for the compute resources that this virtual machine - /// scale set deallocates. + /// Deallocates specific virtual machines in a VM scale set. Shuts down the + /// virtual machines and releases the compute resources. You are not billed for + /// the compute resources that this virtual machine scale set deallocates. /// + /// + /// Deallocates specific virtual machines in a VM scale set. Shuts down the + /// virtual machines and releases the compute resources. You are not billed for + /// the compute resources that this virtual machine scale set deallocates. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -906,14 +940,13 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// Optional parameter to hibernate a virtual machine from the VM scale - /// set. (This feature is available for VMSS with Flexible - /// OrchestrationMode only) + /// Optional parameter to hibernate a virtual machine from the VM scale set. + /// (This feature is available for VMSS with Flexible OrchestrationMode only) /// /// - /// The virtual machine scale set instance ids. Omitting the virtual - /// machine scale set instance ids will result in the operation being - /// performed on all virtual machines in the virtual machine scale set. + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. /// /// /// The headers that will be added to request. @@ -924,26 +957,27 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeallocateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? hibernate = default(bool?), IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeallocateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), bool? hibernate = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes virtual machines in a VM scale set. /// + /// + /// Deletes virtual machines in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the VM scale set. /// + /// + /// Optional parameter to force delete virtual machines from the VM scale set. + /// (Feature in Preview) + /// /// /// The virtual machine scale set instance ids. /// - /// - /// Optional parameter to force delete virtual machines from the VM - /// scale set. (Feature in Preview) - /// /// /// The headers that will be added to request. /// @@ -953,14 +987,16 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds, bool? forceDeletion = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Upgrades one or more virtual machines to the latest SKU set in the - /// VM scale set model. + /// Upgrades one or more virtual machines to the latest SKU set in the VM scale + /// set model. /// + /// + /// Upgrades one or more virtual machines to the latest SKU set in the VM scale + /// set model. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -979,17 +1015,20 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginUpdateInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginUpdateInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Perform maintenance on one or more virtual machines in a VM scale - /// set. Operation on instances which are not eligible for perform - /// maintenance will be failed. Please refer to best practices for more - /// details: + /// Perform maintenance on one or more virtual machines in a VM scale set. + /// Operation on instances which are not eligible for perform maintenance will + /// be failed. Please refer to best practices for more details: /// https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications /// + /// + /// Perform maintenance on one or more virtual machines in a VM scale set. + /// Operation on instances which are not eligible for perform maintenance will + /// be failed. Please refer to best practices for more details: + /// https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -997,9 +1036,9 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// The virtual machine scale set instance ids. Omitting the virtual - /// machine scale set instance ids will result in the operation being - /// performed on all virtual machines in the virtual machine scale set. + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. /// /// /// The headers that will be added to request. @@ -1010,16 +1049,18 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginPerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginPerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Power off (stop) one or more virtual machines in a VM scale set. - /// Note that resources are still attached and you are getting charged - /// for the resources. Instead, use deallocate to release resources and - /// avoid charges. + /// Power off (stop) one or more virtual machines in a VM scale set. Note that + /// resources are still attached and you are getting charged for the resources. + /// Instead, use deallocate to release resources and avoid charges. /// + /// + /// Power off (stop) one or more virtual machines in a VM scale set. Note that + /// resources are still attached and you are getting charged for the resources. + /// Instead, use deallocate to release resources and avoid charges. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1027,14 +1068,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// The parameter to request non-graceful VM shutdown. True value for - /// this flag indicates non-graceful shutdown whereas false indicates - /// otherwise. Default value for this flag is false if not specified + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified /// /// - /// The virtual machine scale set instance ids. Omitting the virtual - /// machine scale set instance ids will result in the operation being - /// performed on all virtual machines in the virtual machine scale set. + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. /// /// /// The headers that will be added to request. @@ -1045,14 +1086,16 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? skipShutdown = default(bool?), IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), bool? skipShutdown = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Reapplies the Virtual Machine Scale Set Virtual Machine Profile to - /// the Virtual Machine Instances + /// Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the + /// Virtual Machine Instances /// + /// + /// Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the + /// Virtual Machine Instances + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1068,14 +1111,16 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginReapplyWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginReapplyWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Shuts down all the virtual machines in the virtual machine scale - /// set, moves them to a new node, and powers them back on. + /// Shuts down all the virtual machines in the virtual machine scale set, moves + /// them to a new node, and powers them back on. /// + /// + /// Shuts down all the virtual machines in the virtual machine scale set, moves + /// them to a new node, and powers them back on. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1083,9 +1128,9 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// The virtual machine scale set instance ids. Omitting the virtual - /// machine scale set instance ids will result in the operation being - /// performed on all virtual machines in the virtual machine scale set. + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. /// /// /// The headers that will be added to request. @@ -1096,16 +1141,18 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRedeployWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginRedeployWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Reimages (upgrade the operating system) one or more virtual - /// machines in a VM scale set which don't have a ephemeral OS disk, - /// for virtual machines who have a ephemeral OS disk the virtual - /// machine is reset to initial state. + /// Reimages (upgrade the operating system) one or more virtual machines in a + /// VM scale set which don't have a ephemeral OS disk, for virtual machines who + /// have a ephemeral OS disk the virtual machine is reset to initial state. /// + /// + /// Reimages (upgrade the operating system) one or more virtual machines in a + /// VM scale set which don't have a ephemeral OS disk, for virtual machines who + /// have a ephemeral OS disk the virtual machine is reset to initial state. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1124,15 +1171,16 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginReimageWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = default(VirtualMachineScaleSetReimageParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginReimageWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = default(VirtualMachineScaleSetReimageParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Reimages all the disks ( including data disks ) in the virtual - /// machines in a VM scale set. This operation is only supported for - /// managed disks. + /// Reimages all the disks ( including data disks ) in the virtual machines in + /// a VM scale set. This operation is only supported for managed disks. /// + /// + /// Reimages all the disks ( including data disks ) in the virtual machines in + /// a VM scale set. This operation is only supported for managed disks. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1140,9 +1188,9 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// The virtual machine scale set instance ids. Omitting the virtual - /// machine scale set instance ids will result in the operation being - /// performed on all virtual machines in the virtual machine scale set. + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. /// /// /// The headers that will be added to request. @@ -1153,13 +1201,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginReimageAllWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginReimageAllWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Restarts one or more virtual machines in a VM scale set. /// + /// + /// Restarts one or more virtual machines in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1167,9 +1216,9 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// The virtual machine scale set instance ids. Omitting the virtual - /// machine scale set instance ids will result in the operation being - /// performed on all virtual machines in the virtual machine scale set. + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. /// /// /// The headers that will be added to request. @@ -1180,13 +1229,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Scales out one or more virtual machines in a VM scale set. /// + /// + /// Scales out one or more virtual machines in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1205,13 +1255,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginScaleOutWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VMScaleSetScaleOutInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginScaleOutWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VMScaleSetScaleOutInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Changes ServiceState property for a given service /// + /// + /// Changes ServiceState property for a given service + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1230,13 +1281,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginSetOrchestrationServiceStateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, OrchestrationServiceStateInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginSetOrchestrationServiceStateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, OrchestrationServiceStateInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Starts one or more virtual machines in a VM scale set. /// + /// + /// Starts one or more virtual machines in a VM scale set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1244,9 +1296,9 @@ public partial interface IVirtualMachineScaleSetsOperations /// The name of the VM scale set. /// /// - /// The virtual machine scale set instance ids. Omitting the virtual - /// machine scale set instance ids will result in the operation being - /// performed on all virtual machines in the virtual machine scale set. + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. /// /// /// The headers that will be added to request. @@ -1257,14 +1309,16 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets all the VM scale sets under the specified subscription for the /// specified location. /// + /// + /// Gets all the VM scale sets under the specified subscription for the + /// specified location. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1280,16 +1334,20 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByLocationNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets a list of all VM Scale Sets in the subscription, regardless of - /// the associated resource group. Use nextLink property in the - /// response to get the next page of VM Scale Sets. Do this till - /// nextLink is null to fetch all the VM Scale Sets. + /// Gets a list of all VM Scale Sets in the subscription, regardless of the + /// associated resource group. Use nextLink property in the response to get the + /// next page of VM Scale Sets. Do this till nextLink is null to fetch all the + /// VM Scale Sets. /// + /// + /// Gets a list of all VM Scale Sets in the subscription, regardless of the + /// associated resource group. Use nextLink property in the response to get the + /// next page of VM Scale Sets. Do this till nextLink is null to fetch all the + /// VM Scale Sets. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1305,13 +1363,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a list of all VM scale sets under a resource group. /// + /// + /// Gets a list of all VM scale sets under a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1327,13 +1386,14 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets list of OS upgrades on a VM scale set instance. /// + /// + /// Gets list of OS upgrades on a VM scale set instance. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1349,14 +1409,16 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetOSUpgradeHistoryNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> GetOSUpgradeHistoryNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets a list of SKUs available for your VM scale set, including the - /// minimum and maximum VM instances allowed for each SKU. + /// Gets a list of SKUs available for your VM scale set, including the minimum + /// and maximum VM instances allowed for each SKU. /// + /// + /// Gets a list of SKUs available for your VM scale set, including the minimum + /// and maximum VM instances allowed for each SKU. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1372,9 +1434,7 @@ public partial interface IVirtualMachineScaleSetsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListSkusNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListSkusNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineSizesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineSizesOperations.cs index e5a118c60ea2..8966da620b1a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineSizesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachineSizesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineSizesOperations operations. @@ -27,6 +17,10 @@ public partial interface IVirtualMachineSizesOperations /// This API is deprecated. Use [Resources /// Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) /// + /// + /// This API is deprecated. Use [Resources + /// Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + /// /// /// The name of Azure region. /// @@ -42,9 +36,7 @@ public partial interface IVirtualMachineSizesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachinesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachinesOperations.cs index 87568dae92e1..f4732de3c73c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachinesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/IVirtualMachinesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachinesOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.Compute public partial interface IVirtualMachinesOperations { /// - /// Gets all the virtual machines under the specified subscription for - /// the specified location. + /// Gets all the virtual machines under the specified subscription for the + /// specified location. /// + /// + /// Gets all the virtual machines under the specified subscription for the + /// specified location. + /// /// /// The name of Azure region. /// @@ -42,29 +36,29 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByLocationWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByLocationWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all of the virtual machines in the specified subscription. - /// Use the nextLink property in the response to get the next page of - /// virtual machines. + /// Lists all of the virtual machines in the specified subscription. Use the + /// nextLink property in the response to get the next page of virtual machines. /// + /// + /// Lists all of the virtual machines in the specified subscription. Use the + /// nextLink property in the response to get the next page of virtual machines. + /// /// - /// statusOnly=true enables fetching run time status of all Virtual - /// Machines in the subscription. + /// statusOnly=true enables fetching run time status of all Virtual Machines in + /// the subscription. /// /// - /// The system query option to filter VMs returned in the response. - /// Allowed value is 'virtualMachineScaleSet/id' eq - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' + /// The system query option to filter VMs returned in the response. Allowed + /// value is 'virtualMachineScaleSet/id' eq + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' /// /// - /// The expand expression to apply on operation. 'instanceView' enables + /// The expand expression to apply on operation. 'instanceView' enables /// fetching run time status of all Virtual Machines, this can only be - /// specified if a valid $filter option is specified. Possible values - /// include: 'instanceView' + /// specified if a valid $filter option is specified /// /// /// The headers that will be added to request. @@ -78,28 +72,28 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllWithHttpMessagesAsync(string statusOnly = default(string), string filter = default(string), string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(string statusOnly = default(string), string filter = default(string), string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all of the virtual machines in the specified resource group. - /// Use the nextLink property in the response to get the next page of - /// virtual machines. + /// Lists all of the virtual machines in the specified resource group. Use the + /// nextLink property in the response to get the next page of virtual machines. /// + /// + /// Lists all of the virtual machines in the specified resource group. Use the + /// nextLink property in the response to get the next page of virtual machines. + /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The system query option to filter VMs returned in the response. - /// Allowed value is 'virtualMachineScaleSet/id' eq - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' + /// The system query option to filter VMs returned in the response. Allowed + /// value is 'virtualMachineScaleSet/id' eq + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' /// /// - /// The expand expression to apply on operation. 'instanceView' enables + /// The expand expression to apply on operation. 'instanceView' enables /// fetching run time status of all Virtual Machines, this can only be - /// specified if a valid $filter option is specified. Possible values - /// include: 'instanceView' + /// specified if a valid $filter option is specified /// /// /// The headers that will be added to request. @@ -113,14 +107,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string filter = default(string), string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string filter = default(string), string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves information about the model view or the instance view of - /// a virtual machine. + /// Retrieves information about the model view or the instance view of a + /// virtual machine. /// + /// + /// Retrieves information about the model view or the instance view of a + /// virtual machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -128,13 +124,11 @@ public partial interface IVirtualMachinesOperations /// The name of the virtual machine. /// /// - /// The expand expression to apply on the operation. 'InstanceView' - /// retrieves a snapshot of the runtime properties of the virtual - /// machine that is managed by the platform and can change outside of - /// control plane operations. 'UserData' retrieves the UserData - /// property as part of the VM model view that was provided by the user - /// during the VM Create/Update operation. Possible values include: - /// 'instanceView', 'userData', 'resiliencyView' + /// The expand expression to apply on the operation. 'InstanceView' retrieves a + /// snapshot of the runtime properties of the virtual machine that is managed + /// by the platform and can change outside of control plane operations. + /// 'UserData' retrieves the UserData property as part of the VM model view + /// that was provided by the user during the VM Create/Update operation. /// /// /// The headers that will be added to request. @@ -148,32 +142,34 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmName, InstanceViewTypes? expand = default(InstanceViewTypes?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmName, InstanceViewTypes? expand = default(InstanceViewTypes?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to create or update a virtual machine. Please note - /// some properties can be set only during virtual machine creation. + /// The operation to create or update a virtual machine. Please note some + /// properties can be set only during virtual machine creation. /// + /// + /// The operation to create or update a virtual machine. Please note some + /// properties can be set only during virtual machine creation. + /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the virtual machine. /// - /// - /// Parameters supplied to the Create Virtual Machine operation. - /// /// - /// The ETag of the transformation. Omit this value to always overwrite - /// the current resource. Specify the last-seen ETag value to prevent - /// accidentally overwriting concurrent changes. + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent - /// updating an existing record set. Other values will result in error - /// from server as they are not supported. + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// Parameters supplied to the Create Virtual Machine operation. /// /// /// The headers that will be added to request. @@ -187,31 +183,32 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachine parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachine parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to update a virtual machine. /// + /// + /// The operation to update a virtual machine. + /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the virtual machine. /// - /// - /// Parameters supplied to the Update Virtual Machine operation. - /// /// - /// The ETag of the transformation. Omit this value to always overwrite - /// the current resource. Specify the last-seen ETag value to prevent - /// accidentally overwriting concurrent changes. + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent - /// updating an existing record set. Other values will result in error - /// from server as they are not supported. + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// Parameters supplied to the Update Virtual Machine operation. /// /// /// The headers that will be added to request. @@ -225,13 +222,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to delete a virtual machine. /// + /// + /// The operation to delete a virtual machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -250,13 +248,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Assess patches on the VM. /// + /// + /// Assess patches on the VM. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -275,13 +274,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> AssessPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> AssessPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Attach and detach data disks to/from the virtual machine. /// + /// + /// Attach and detach data disks to/from the virtual machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -289,8 +289,8 @@ public partial interface IVirtualMachinesOperations /// The name of the virtual machine. /// /// - /// Parameters supplied to the attach and detach data disks operation - /// on the virtual machine. + /// Parameters supplied to the attach and detach data disks operation on the + /// virtual machine. /// /// /// The headers that will be added to request. @@ -304,14 +304,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> AttachDetachDataDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, AttachDetachDataDisksRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> AttachDetachDataDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, AttachDetachDataDisksRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Captures the VM by copying virtual hard disks of the VM and outputs - /// a template that can be used to create similar VMs. + /// Captures the VM by copying virtual hard disks of the VM and outputs a + /// template that can be used to create similar VMs. /// + /// + /// Captures the VM by copying virtual hard disks of the VM and outputs a + /// template that can be used to create similar VMs. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -333,15 +335,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CaptureWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CaptureWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Converts virtual machine disks from blob-based to managed disks. - /// Virtual machine must be stop-deallocated before invoking this - /// operation. + /// Converts virtual machine disks from blob-based to managed disks. Virtual + /// machine must be stop-deallocated before invoking this operation. /// + /// + /// Converts virtual machine disks from blob-based to managed disks. Virtual + /// machine must be stop-deallocated before invoking this operation. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -357,15 +360,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ConvertToManagedDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ConvertToManagedDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Shuts down the virtual machine and releases the compute resources. - /// You are not billed for the compute resources that this virtual - /// machine uses. + /// Shuts down the virtual machine and releases the compute resources. You are + /// not billed for the compute resources that this virtual machine uses. /// + /// + /// Shuts down the virtual machine and releases the compute resources. You are + /// not billed for the compute resources that this virtual machine uses. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -384,20 +388,24 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeallocateWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? hibernate = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeallocateWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? hibernate = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Sets the OS state of the virtual machine to generalized. It is - /// recommended to sysprep the virtual machine before performing this - /// operation. For Windows, please refer to [Create a managed image of - /// a generalized VM in + /// Sets the OS state of the virtual machine to generalized. It is recommended + /// to sysprep the virtual machine before performing this operation. For + /// Windows, please refer to [Create a managed image of a generalized VM in /// Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). - /// For Linux, please refer to [How to create an image of a virtual - /// machine or + /// For Linux, please refer to [How to create an image of a virtual machine or /// VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). /// + /// + /// Sets the OS state of the virtual machine to generalized. It is recommended + /// to sysprep the virtual machine before performing this operation. For + /// Windows, please refer to [Create a managed image of a generalized VM in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). + /// For Linux, please refer to [How to create an image of a virtual machine or + /// VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -413,13 +421,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task GeneralizeWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task GeneralizeWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Installs patches on the VM. /// + /// + /// Installs patches on the VM. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -441,14 +450,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> InstallPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> InstallPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Retrieves information about the run-time state of a virtual - /// machine. + /// Retrieves information about the run-time state of a virtual machine. /// + /// + /// Retrieves information about the run-time state of a virtual machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -467,14 +476,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> InstanceViewWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> InstanceViewWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Migrate a virtual machine from availability set to Flexible Virtual - /// Machine Scale Set. + /// Migrate a virtual machine from availability set to Flexible Virtual Machine + /// Scale Set. /// + /// + /// Migrate a virtual machine from availability set to Flexible Virtual Machine + /// Scale Set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -493,13 +504,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task MigrateToVMScaleSetWithHttpMessagesAsync(string resourceGroupName, string vmName, MigrateVMToVirtualMachineScaleSetInput parameters = default(MigrateVMToVirtualMachineScaleSetInput), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task MigrateToVMScaleSetWithHttpMessagesAsync(string resourceGroupName, string vmName, MigrateVMToVirtualMachineScaleSetInput parameters = default(MigrateVMToVirtualMachineScaleSetInput), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to perform maintenance on a virtual machine. /// + /// + /// The operation to perform maintenance on a virtual machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -515,15 +527,18 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task PerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task PerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to power off (stop) a virtual machine. The virtual - /// machine can be restarted with the same provisioned resources. You - /// are still charged for this virtual machine. + /// The operation to power off (stop) a virtual machine. The virtual machine + /// can be restarted with the same provisioned resources. You are still charged + /// for this virtual machine. /// + /// + /// The operation to power off (stop) a virtual machine. The virtual machine + /// can be restarted with the same provisioned resources. You are still charged + /// for this virtual machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -531,9 +546,9 @@ public partial interface IVirtualMachinesOperations /// The name of the virtual machine. /// /// - /// The parameter to request non-graceful VM shutdown. True value for - /// this flag indicates non-graceful shutdown whereas false indicates - /// otherwise. Default value for this flag is false if not specified + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified /// /// /// The headers that will be added to request. @@ -544,13 +559,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? skipShutdown = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? skipShutdown = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to reapply a virtual machine's state. + /// The operation to reapply a virtual machine's state. /// + /// + /// The operation to reapply a virtual machine's state. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -566,14 +582,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ReapplyWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ReapplyWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Shuts down the virtual machine, moves it to a new node, and powers - /// it back on. + /// Shuts down the virtual machine, moves it to a new node, and powers it back + /// on. /// + /// + /// Shuts down the virtual machine, moves it to a new node, and powers it back + /// on. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -589,20 +607,26 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task RedeployWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task RedeployWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Reimages (upgrade the operating system) a virtual machine which - /// don't have a ephemeral OS disk, for virtual machines who have a - /// ephemeral OS disk the virtual machine is reset to initial state. - /// NOTE: The retaining of old OS disk depends on the value of - /// deleteOption of OS disk. If deleteOption is detach, the old OS disk - /// will be preserved after reimage. If deleteOption is delete, the old - /// OS disk will be deleted after reimage. The deleteOption of the OS - /// disk should be updated accordingly before performing the reimage. + /// Reimages (upgrade the operating system) a virtual machine which don't have + /// a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the + /// virtual machine is reset to initial state. NOTE: The retaining of old OS + /// disk depends on the value of deleteOption of OS disk. If deleteOption is + /// detach, the old OS disk will be preserved after reimage. If deleteOption is + /// delete, the old OS disk will be deleted after reimage. The deleteOption of + /// the OS disk should be updated accordingly before performing the reimage. /// + /// + /// Reimages (upgrade the operating system) a virtual machine which don't have + /// a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the + /// virtual machine is reset to initial state. NOTE: The retaining of old OS + /// disk depends on the value of deleteOption of OS disk. If deleteOption is + /// detach, the old OS disk will be preserved after reimage. If deleteOption is + /// delete, the old OS disk will be deleted after reimage. The deleteOption of + /// the OS disk should be updated accordingly before performing the reimage. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -621,13 +645,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ReimageWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ReimageWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to restart a virtual machine. /// + /// + /// The operation to restart a virtual machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -643,14 +668,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task RestartWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task RestartWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to retrieve SAS URIs for a virtual machine's boot - /// diagnostic logs. + /// The operation to retrieve SAS URIs for a virtual machine's boot diagnostic + /// logs. /// + /// + /// The operation to retrieve SAS URIs for a virtual machine's boot diagnostic + /// logs. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -658,10 +685,9 @@ public partial interface IVirtualMachinesOperations /// The name of the virtual machine. /// /// - /// Expiration duration in minutes for the SAS URIs with a value - /// between 1 to 1440 minutes. **Note:** If not specified, SAS URIs - /// will be generated with a default expiration duration of 120 - /// minutes. + /// Expiration duration in minutes for the SAS URIs with a value between 1 to + /// 1440 minutes. **Note:** If not specified, SAS URIs will be generated with a + /// default expiration duration of 120 minutes. /// /// /// The headers that will be added to request. @@ -675,13 +701,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> RetrieveBootDiagnosticsDataWithHttpMessagesAsync(string resourceGroupName, string vmName, int? sasUriExpirationTimeInMinutes = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> RetrieveBootDiagnosticsDataWithHttpMessagesAsync(string resourceGroupName, string vmName, int? sasUriExpirationTimeInMinutes = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Run command on the VM. /// + /// + /// Run command on the VM. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -703,13 +730,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> RunCommandWithHttpMessagesAsync(string resourceGroupName, string vmName, RunCommandInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> RunCommandWithHttpMessagesAsync(string resourceGroupName, string vmName, RunCommandInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to simulate the eviction of spot virtual machine. /// + /// + /// The operation to simulate the eviction of spot virtual machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -725,13 +753,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task SimulateEvictionWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task SimulateEvictionWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to start a virtual machine. /// + /// + /// The operation to start a virtual machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -747,14 +776,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task StartWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all available virtual machine sizes to which the specified - /// virtual machine can be resized. + /// Lists all available virtual machine sizes to which the specified virtual + /// machine can be resized. /// + /// + /// Lists all available virtual machine sizes to which the specified virtual + /// machine can be resized. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -773,32 +804,34 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAvailableSizesWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAvailableSizesWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to create or update a virtual machine. Please note - /// some properties can be set only during virtual machine creation. + /// The operation to create or update a virtual machine. Please note some + /// properties can be set only during virtual machine creation. /// + /// + /// The operation to create or update a virtual machine. Please note some + /// properties can be set only during virtual machine creation. + /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the virtual machine. /// - /// - /// Parameters supplied to the Create Virtual Machine operation. - /// /// - /// The ETag of the transformation. Omit this value to always overwrite - /// the current resource. Specify the last-seen ETag value to prevent - /// accidentally overwriting concurrent changes. + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent - /// updating an existing record set. Other values will result in error - /// from server as they are not supported. + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// Parameters supplied to the Create Virtual Machine operation. /// /// /// The headers that will be added to request. @@ -812,31 +845,32 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachine parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachine parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to update a virtual machine. /// + /// + /// The operation to update a virtual machine. + /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the virtual machine. /// - /// - /// Parameters supplied to the Update Virtual Machine operation. - /// /// - /// The ETag of the transformation. Omit this value to always overwrite - /// the current resource. Specify the last-seen ETag value to prevent - /// accidentally overwriting concurrent changes. + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent - /// updating an existing record set. Other values will result in error - /// from server as they are not supported. + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// Parameters supplied to the Update Virtual Machine operation. /// /// /// The headers that will be added to request. @@ -850,13 +884,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to delete a virtual machine. /// + /// + /// The operation to delete a virtual machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -875,13 +910,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Assess patches on the VM. /// + /// + /// Assess patches on the VM. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -900,13 +936,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginAssessPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginAssessPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Attach and detach data disks to/from the virtual machine. /// + /// + /// Attach and detach data disks to/from the virtual machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -914,8 +951,8 @@ public partial interface IVirtualMachinesOperations /// The name of the virtual machine. /// /// - /// Parameters supplied to the attach and detach data disks operation - /// on the virtual machine. + /// Parameters supplied to the attach and detach data disks operation on the + /// virtual machine. /// /// /// The headers that will be added to request. @@ -929,14 +966,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginAttachDetachDataDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, AttachDetachDataDisksRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginAttachDetachDataDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, AttachDetachDataDisksRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Captures the VM by copying virtual hard disks of the VM and outputs - /// a template that can be used to create similar VMs. + /// Captures the VM by copying virtual hard disks of the VM and outputs a + /// template that can be used to create similar VMs. /// + /// + /// Captures the VM by copying virtual hard disks of the VM and outputs a + /// template that can be used to create similar VMs. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -958,15 +997,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCaptureWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCaptureWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Converts virtual machine disks from blob-based to managed disks. - /// Virtual machine must be stop-deallocated before invoking this - /// operation. + /// Converts virtual machine disks from blob-based to managed disks. Virtual + /// machine must be stop-deallocated before invoking this operation. /// + /// + /// Converts virtual machine disks from blob-based to managed disks. Virtual + /// machine must be stop-deallocated before invoking this operation. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -982,15 +1022,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginConvertToManagedDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginConvertToManagedDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Shuts down the virtual machine and releases the compute resources. - /// You are not billed for the compute resources that this virtual - /// machine uses. + /// Shuts down the virtual machine and releases the compute resources. You are + /// not billed for the compute resources that this virtual machine uses. /// + /// + /// Shuts down the virtual machine and releases the compute resources. You are + /// not billed for the compute resources that this virtual machine uses. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1009,13 +1050,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeallocateWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? hibernate = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeallocateWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? hibernate = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Installs patches on the VM. /// + /// + /// Installs patches on the VM. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1037,14 +1079,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginInstallPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginInstallPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Migrate a virtual machine from availability set to Flexible Virtual - /// Machine Scale Set. + /// Migrate a virtual machine from availability set to Flexible Virtual Machine + /// Scale Set. /// + /// + /// Migrate a virtual machine from availability set to Flexible Virtual Machine + /// Scale Set. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1063,13 +1107,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginMigrateToVMScaleSetWithHttpMessagesAsync(string resourceGroupName, string vmName, MigrateVMToVirtualMachineScaleSetInput parameters = default(MigrateVMToVirtualMachineScaleSetInput), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginMigrateToVMScaleSetWithHttpMessagesAsync(string resourceGroupName, string vmName, MigrateVMToVirtualMachineScaleSetInput parameters = default(MigrateVMToVirtualMachineScaleSetInput), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to perform maintenance on a virtual machine. /// + /// + /// The operation to perform maintenance on a virtual machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1085,15 +1130,18 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginPerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginPerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to power off (stop) a virtual machine. The virtual - /// machine can be restarted with the same provisioned resources. You - /// are still charged for this virtual machine. + /// The operation to power off (stop) a virtual machine. The virtual machine + /// can be restarted with the same provisioned resources. You are still charged + /// for this virtual machine. /// + /// + /// The operation to power off (stop) a virtual machine. The virtual machine + /// can be restarted with the same provisioned resources. You are still charged + /// for this virtual machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1101,9 +1149,9 @@ public partial interface IVirtualMachinesOperations /// The name of the virtual machine. /// /// - /// The parameter to request non-graceful VM shutdown. True value for - /// this flag indicates non-graceful shutdown whereas false indicates - /// otherwise. Default value for this flag is false if not specified + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified /// /// /// The headers that will be added to request. @@ -1114,13 +1162,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? skipShutdown = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? skipShutdown = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// The operation to reapply a virtual machine's state. + /// The operation to reapply a virtual machine's state. /// + /// + /// The operation to reapply a virtual machine's state. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1136,14 +1185,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginReapplyWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginReapplyWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Shuts down the virtual machine, moves it to a new node, and powers - /// it back on. + /// Shuts down the virtual machine, moves it to a new node, and powers it back + /// on. /// + /// + /// Shuts down the virtual machine, moves it to a new node, and powers it back + /// on. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1159,20 +1210,26 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRedeployWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginRedeployWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Reimages (upgrade the operating system) a virtual machine which - /// don't have a ephemeral OS disk, for virtual machines who have a - /// ephemeral OS disk the virtual machine is reset to initial state. - /// NOTE: The retaining of old OS disk depends on the value of - /// deleteOption of OS disk. If deleteOption is detach, the old OS disk - /// will be preserved after reimage. If deleteOption is delete, the old - /// OS disk will be deleted after reimage. The deleteOption of the OS - /// disk should be updated accordingly before performing the reimage. + /// Reimages (upgrade the operating system) a virtual machine which don't have + /// a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the + /// virtual machine is reset to initial state. NOTE: The retaining of old OS + /// disk depends on the value of deleteOption of OS disk. If deleteOption is + /// detach, the old OS disk will be preserved after reimage. If deleteOption is + /// delete, the old OS disk will be deleted after reimage. The deleteOption of + /// the OS disk should be updated accordingly before performing the reimage. /// + /// + /// Reimages (upgrade the operating system) a virtual machine which don't have + /// a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the + /// virtual machine is reset to initial state. NOTE: The retaining of old OS + /// disk depends on the value of deleteOption of OS disk. If deleteOption is + /// detach, the old OS disk will be preserved after reimage. If deleteOption is + /// delete, the old OS disk will be deleted after reimage. The deleteOption of + /// the OS disk should be updated accordingly before performing the reimage. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1191,13 +1248,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginReimageWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginReimageWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to restart a virtual machine. /// + /// + /// The operation to restart a virtual machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1213,13 +1271,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Run command on the VM. /// + /// + /// Run command on the VM. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1241,13 +1300,14 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginRunCommandWithHttpMessagesAsync(string resourceGroupName, string vmName, RunCommandInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginRunCommandWithHttpMessagesAsync(string resourceGroupName, string vmName, RunCommandInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// The operation to start a virtual machine. /// + /// + /// The operation to start a virtual machine. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1263,14 +1323,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all the virtual machines under the specified subscription for - /// the specified location. + /// Gets all the virtual machines under the specified subscription for the + /// specified location. /// + /// + /// Gets all the virtual machines under the specified subscription for the + /// specified location. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1286,15 +1348,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByLocationNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all of the virtual machines in the specified subscription. - /// Use the nextLink property in the response to get the next page of - /// virtual machines. + /// Lists all of the virtual machines in the specified subscription. Use the + /// nextLink property in the response to get the next page of virtual machines. /// + /// + /// Lists all of the virtual machines in the specified subscription. Use the + /// nextLink property in the response to get the next page of virtual machines. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1310,15 +1373,16 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all of the virtual machines in the specified resource group. - /// Use the nextLink property in the response to get the next page of - /// virtual machines. + /// Lists all of the virtual machines in the specified resource group. Use the + /// nextLink property in the response to get the next page of virtual machines. /// + /// + /// Lists all of the virtual machines in the specified resource group. Use the + /// nextLink property in the response to get the next page of virtual machines. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1334,9 +1398,7 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/ImagesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ImagesOperations.cs index 3371180f4f65..3ae5497d9384 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ImagesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ImagesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ImagesOperations operations. /// - internal partial class ImagesOperations : IServiceOperations, IImagesOperations + internal partial class ImagesOperations : Microsoft.Rest.IServiceOperations, IImagesOperations { /// /// Initializes a new instance of the ImagesOperations class. @@ -36,13 +24,13 @@ internal partial class ImagesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ImagesOperations(ComputeManagementClient client) + internal ImagesOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -61,13 +49,13 @@ internal ImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -76,29 +64,38 @@ internal ImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/images").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -108,25 +105,24 @@ internal ImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -138,55 +134,56 @@ internal ImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -196,9 +193,10 @@ internal ImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -209,25 +207,29 @@ internal ImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the list of images under a resource group. Use nextLink property in /// the response to get the next page of Images. Do this till nextLink is null @@ -242,13 +244,13 @@ internal ImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -257,46 +259,55 @@ internal ImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -306,25 +317,24 @@ internal ImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -336,55 +346,56 @@ internal ImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -394,9 +405,10 @@ internal ImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -407,25 +419,29 @@ internal ImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets an image. /// @@ -444,13 +460,13 @@ internal ImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -459,53 +475,64 @@ internal ImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string imageName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string imageName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (imageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "imageName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "imageName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("imageName", imageName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{imageName}", System.Uri.EscapeDataString(imageName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -519,25 +546,24 @@ internal ImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -549,55 +575,56 @@ internal ImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -607,9 +634,10 @@ internal ImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -620,25 +648,29 @@ internal ImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update an image. /// @@ -652,16 +684,16 @@ internal ImagesOperations(ComputeManagementClient client) /// Parameters supplied to the Create Image operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string imageName, Image parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string imageName, Image parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, imageName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, imageName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -677,16 +709,16 @@ internal ImagesOperations(ComputeManagementClient client) /// Parameters supplied to the Update Image operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string imageName, ImageUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string imageName, ImageUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, imageName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, imageName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -699,16 +731,16 @@ internal ImagesOperations(ComputeManagementClient client) /// The name of the image. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string imageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string imageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, imageName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, imageName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -729,13 +761,13 @@ internal ImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -744,61 +776,71 @@ internal ImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string imageName, Image parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string imageName, Image parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (imageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "imageName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "imageName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("imageName", imageName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{imageName}", System.Uri.EscapeDataString(imageName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -808,25 +850,24 @@ internal ImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -838,61 +879,62 @@ internal ImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -902,9 +944,10 @@ internal ImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -915,16 +958,16 @@ internal ImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -933,38 +976,42 @@ internal ImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update an image. /// @@ -983,13 +1030,13 @@ internal ImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -998,57 +1045,67 @@ internal ImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string imageName, ImageUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string imageName, ImageUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (imageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "imageName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "imageName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("imageName", imageName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{imageName}", System.Uri.EscapeDataString(imageName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1058,25 +1115,24 @@ internal ImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1088,61 +1144,62 @@ internal ImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1152,9 +1209,10 @@ internal ImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1165,16 +1223,16 @@ internal ImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1183,38 +1241,42 @@ internal ImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes an Image. /// @@ -1230,10 +1292,10 @@ internal ImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1242,52 +1304,62 @@ internal ImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string imageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string imageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (imageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "imageName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "imageName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("imageName", imageName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{imageName}", System.Uri.EscapeDataString(imageName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1297,25 +1369,24 @@ internal ImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1327,55 +1398,56 @@ internal ImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1385,20 +1457,25 @@ internal ImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the list of Images in the subscription. Use nextLink property in the /// response to get the next page of Images. Do this till nextLink is null to @@ -1413,13 +1490,13 @@ internal ImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1428,51 +1505,54 @@ internal ImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1484,55 +1564,56 @@ internal ImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1542,9 +1623,10 @@ internal ImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1555,25 +1637,29 @@ internal ImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the list of images under a resource group. Use nextLink property in /// the response to get the next page of Images. Do this till nextLink is null @@ -1588,13 +1674,13 @@ internal ImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1603,51 +1689,54 @@ internal ImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1659,55 +1748,56 @@ internal ImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1717,9 +1807,10 @@ internal ImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1730,24 +1821,28 @@ internal ImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/ImagesOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/ImagesOperationsExtensions.cs index 4d431d36a9c2..a23ac42a230a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ImagesOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ImagesOperationsExtensions.cs @@ -1,475 +1,431 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ImagesOperations. + /// Extension methods for ImagesOperations /// public static partial class ImagesOperationsExtensions { - /// - /// Gets the list of Images in the subscription. Use nextLink property in the - /// response to get the next page of Images. Do this till nextLink is null to - /// fetch all the Images. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IImagesOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets the list of Images in the subscription. Use nextLink property in the - /// response to get the next page of Images. Do this till nextLink is null to - /// fetch all the Images. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IImagesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the list of images under a resource group. Use nextLink property in - /// the response to get the next page of Images. Do this till nextLink is null - /// to fetch all the Images. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage ListByResourceGroup(this IImagesOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets the list of images under a resource group. Use nextLink property in - /// the response to get the next page of Images. Do this till nextLink is null - /// to fetch all the Images. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IImagesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the image. - /// - /// - /// The expand expression to apply on the operation. - /// - public static Image Get(this IImagesOperations operations, string resourceGroupName, string imageName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, imageName, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the image. - /// - /// - /// The expand expression to apply on the operation. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IImagesOperations operations, string resourceGroupName, string imageName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, imageName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the image. - /// - /// - /// Parameters supplied to the Create Image operation. - /// - public static Image CreateOrUpdate(this IImagesOperations operations, string resourceGroupName, string imageName, Image parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, imageName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create or update an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the image. - /// - /// - /// Parameters supplied to the Create Image operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IImagesOperations operations, string resourceGroupName, string imageName, Image parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, imageName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Gets the list of Images in the subscription. Use nextLink property in the + /// response to get the next page of Images. Do this till nextLink is null to + /// fetch all the Images. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IImagesOperations operations) + { + return ((IImagesOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Update an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the image. - /// - /// - /// Parameters supplied to the Update Image operation. - /// - public static Image Update(this IImagesOperations operations, string resourceGroupName, string imageName, ImageUpdate parameters) + /// + /// Gets the list of Images in the subscription. Use nextLink property in the + /// response to get the next page of Images. Do this till nextLink is null to + /// fetch all the Images. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IImagesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(resourceGroupName, imageName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets the list of images under a resource group. Use nextLink property in + /// the response to get the next page of Images. Do this till nextLink is null + /// to fetch all the Images. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IImagesOperations operations, string resourceGroupName) + { + return ((IImagesOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Update an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the image. - /// - /// - /// Parameters supplied to the Update Image operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IImagesOperations operations, string resourceGroupName, string imageName, ImageUpdate parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the list of images under a resource group. Use nextLink property in + /// the response to get the next page of Images. Do this till nextLink is null + /// to fetch all the Images. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IImagesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, imageName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the image. + /// + /// + /// The expand expression to apply on the operation. + /// + public static Image Get(this IImagesOperations operations, string resourceGroupName, string imageName, string expand = default(string)) + { + return ((IImagesOperations)operations).GetAsync(resourceGroupName, imageName, expand).GetAwaiter().GetResult(); + } - /// - /// Deletes an Image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the image. - /// - public static void Delete(this IImagesOperations operations, string resourceGroupName, string imageName) + /// + /// Gets an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the image. + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IImagesOperations operations, string resourceGroupName, string imageName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, imageName, expand, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, imageName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or update an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the image. + /// + public static Image CreateOrUpdate(this IImagesOperations operations, string resourceGroupName, string imageName, Image parameters) + { + return ((IImagesOperations)operations).CreateOrUpdateAsync(resourceGroupName, imageName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes an Image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the image. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IImagesOperations operations, string resourceGroupName, string imageName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or update an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the image. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IImagesOperations operations, string resourceGroupName, string imageName, Image parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, imageName, parameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, imageName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Update an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the image. + /// + public static Image Update(this IImagesOperations operations, string resourceGroupName, string imageName, ImageUpdate parameters) + { + return ((IImagesOperations)operations).UpdateAsync(resourceGroupName, imageName, parameters).GetAwaiter().GetResult(); + } - /// - /// Create or update an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the image. - /// - /// - /// Parameters supplied to the Create Image operation. - /// - public static Image BeginCreateOrUpdate(this IImagesOperations operations, string resourceGroupName, string imageName, Image parameters) + /// + /// Update an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the image. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IImagesOperations operations, string resourceGroupName, string imageName, ImageUpdate parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, imageName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, imageName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes an Image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the image. + /// + public static void Delete(this IImagesOperations operations, string resourceGroupName, string imageName) + { + ((IImagesOperations)operations).DeleteAsync(resourceGroupName, imageName).GetAwaiter().GetResult(); + } - /// - /// Create or update an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the image. - /// - /// - /// Parameters supplied to the Create Image operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IImagesOperations operations, string resourceGroupName, string imageName, Image parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, imageName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes an Image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the image. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IImagesOperations operations, string resourceGroupName, string imageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, imageName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create or update an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the image. + /// + public static Image BeginCreateOrUpdate(this IImagesOperations operations, string resourceGroupName, string imageName, Image parameters) + { + return ((IImagesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, imageName, parameters).GetAwaiter().GetResult(); + } - /// - /// Update an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the image. - /// - /// - /// Parameters supplied to the Update Image operation. - /// - public static Image BeginUpdate(this IImagesOperations operations, string resourceGroupName, string imageName, ImageUpdate parameters) + /// + /// Create or update an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the image. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IImagesOperations operations, string resourceGroupName, string imageName, Image parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, imageName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginUpdateAsync(resourceGroupName, imageName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the image. + /// + public static Image BeginUpdate(this IImagesOperations operations, string resourceGroupName, string imageName, ImageUpdate parameters) + { + return ((IImagesOperations)operations).BeginUpdateAsync(resourceGroupName, imageName, parameters).GetAwaiter().GetResult(); + } - /// - /// Update an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the image. - /// - /// - /// Parameters supplied to the Update Image operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IImagesOperations operations, string resourceGroupName, string imageName, ImageUpdate parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the image. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IImagesOperations operations, string resourceGroupName, string imageName, ImageUpdate parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, imageName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, imageName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Deletes an Image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the image. + /// + public static void BeginDelete(this IImagesOperations operations, string resourceGroupName, string imageName) + { + ((IImagesOperations)operations).BeginDeleteAsync(resourceGroupName, imageName).GetAwaiter().GetResult(); + } - /// - /// Deletes an Image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the image. - /// - public static void BeginDelete(this IImagesOperations operations, string resourceGroupName, string imageName) - { - operations.BeginDeleteAsync(resourceGroupName, imageName).GetAwaiter().GetResult(); - } + /// + /// Deletes an Image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the image. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IImagesOperations operations, string resourceGroupName, string imageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, imageName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the list of Images in the subscription. Use nextLink property in the + /// response to get the next page of Images. Do this till nextLink is null to + /// fetch all the Images. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IImagesOperations operations, string nextPageLink) + { + return ((IImagesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Deletes an Image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the image. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IImagesOperations operations, string resourceGroupName, string imageName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the list of Images in the subscription. Use nextLink property in the + /// response to get the next page of Images. Do this till nextLink is null to + /// fetch all the Images. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IImagesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, imageName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Gets the list of images under a resource group. Use nextLink property in + /// the response to get the next page of Images. Do this till nextLink is null + /// to fetch all the Images. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IImagesOperations operations, string nextPageLink) + { + return ((IImagesOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets the list of Images in the subscription. Use nextLink property in the - /// response to get the next page of Images. Do this till nextLink is null to - /// fetch all the Images. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IImagesOperations operations, string nextPageLink) + /// + /// Gets the list of images under a resource group. Use nextLink property in + /// the response to get the next page of Images. Do this till nextLink is null + /// to fetch all the Images. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IImagesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets the list of Images in the subscription. Use nextLink property in the - /// response to get the next page of Images. Do this till nextLink is null to - /// fetch all the Images. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IImagesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the list of images under a resource group. Use nextLink property in - /// the response to get the next page of Images. Do this till nextLink is null - /// to fetch all the Images. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IImagesOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the list of images under a resource group. Use nextLink property in - /// the response to get the next page of Images. Do this till nextLink is null - /// to fetch all the Images. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IImagesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/LogAnalyticsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/LogAnalyticsOperations.cs index 0a8211b2b6a5..41aaac4838ab 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/LogAnalyticsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/LogAnalyticsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// LogAnalyticsOperations operations. /// - internal partial class LogAnalyticsOperations : IServiceOperations, ILogAnalyticsOperations + internal partial class LogAnalyticsOperations : Microsoft.Rest.IServiceOperations, ILogAnalyticsOperations { /// /// Initializes a new instance of the LogAnalyticsOperations class. @@ -36,13 +24,13 @@ internal partial class LogAnalyticsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal LogAnalyticsOperations(ComputeManagementClient client) + internal LogAnalyticsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -61,16 +49,16 @@ internal LogAnalyticsOperations(ComputeManagementClient client) /// Parameters supplied to the LogAnalytics getRequestRateByInterval Api. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ExportRequestRateByIntervalWithHttpMessagesAsync(string location, RequestRateByIntervalInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ExportRequestRateByIntervalWithHttpMessagesAsync(string location, RequestRateByIntervalInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginExportRequestRateByIntervalWithHttpMessagesAsync(location, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginExportRequestRateByIntervalWithHttpMessagesAsync(location, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -84,16 +72,16 @@ internal LogAnalyticsOperations(ComputeManagementClient client) /// The request body /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ExportThrottledRequestsWithHttpMessagesAsync(string location, ThrottledRequestsInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ExportThrottledRequestsWithHttpMessagesAsync(string location, ThrottledRequestsInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginExportThrottledRequestsWithHttpMessagesAsync(location, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginExportThrottledRequestsWithHttpMessagesAsync(location, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -112,13 +100,13 @@ internal LogAnalyticsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -127,51 +115,60 @@ internal LogAnalyticsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginExportRequestRateByIntervalWithHttpMessagesAsync(string location, RequestRateByIntervalInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginExportRequestRateByIntervalWithHttpMessagesAsync(string location, RequestRateByIntervalInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginExportRequestRateByInterval", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginExportRequestRateByInterval", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -181,25 +178,24 @@ internal LogAnalyticsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -211,61 +207,62 @@ internal LogAnalyticsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -275,9 +272,10 @@ internal LogAnalyticsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -288,25 +286,29 @@ internal LogAnalyticsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Export logs that show total throttled Api requests for this subscription in /// the given time window. @@ -323,13 +325,13 @@ internal LogAnalyticsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -338,51 +340,60 @@ internal LogAnalyticsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginExportThrottledRequestsWithHttpMessagesAsync(string location, ThrottledRequestsInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginExportThrottledRequestsWithHttpMessagesAsync(string location, ThrottledRequestsInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginExportThrottledRequests", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginExportThrottledRequests", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -392,25 +403,24 @@ internal LogAnalyticsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -422,61 +432,62 @@ internal LogAnalyticsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -486,9 +497,10 @@ internal LogAnalyticsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -499,24 +511,28 @@ internal LogAnalyticsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/LogAnalyticsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/LogAnalyticsOperationsExtensions.cs index 426c8d810d29..0a10d4df81fc 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/LogAnalyticsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/LogAnalyticsOperationsExtensions.cs @@ -1,193 +1,156 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for LogAnalyticsOperations. + /// Extension methods for LogAnalyticsOperations /// public static partial class LogAnalyticsOperationsExtensions { - /// - /// Export logs that show Api requests made by this subscription in the given - /// time window to show throttling activities. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - /// - public static LogAnalyticsOperationResult ExportRequestRateByInterval(this ILogAnalyticsOperations operations, string location, RequestRateByIntervalInput parameters) - { - return operations.ExportRequestRateByIntervalAsync(location, parameters).GetAwaiter().GetResult(); - } + /// + /// Export logs that show Api requests made by this subscription in the given + /// time window to show throttling activities. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + public static LogAnalyticsOperationResult ExportRequestRateByInterval(this ILogAnalyticsOperations operations, string location, RequestRateByIntervalInput parameters) + { + return ((ILogAnalyticsOperations)operations).ExportRequestRateByIntervalAsync(location, parameters).GetAwaiter().GetResult(); + } - /// - /// Export logs that show Api requests made by this subscription in the given - /// time window to show throttling activities. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - /// - /// - /// The cancellation token. - /// - public static async Task ExportRequestRateByIntervalAsync(this ILogAnalyticsOperations operations, string location, RequestRateByIntervalInput parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Export logs that show Api requests made by this subscription in the given + /// time window to show throttling activities. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ExportRequestRateByIntervalAsync(this ILogAnalyticsOperations operations, string location, RequestRateByIntervalInput parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ExportRequestRateByIntervalWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ExportRequestRateByIntervalWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Export logs that show total throttled Api requests for this subscription in + /// the given time window. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + public static LogAnalyticsOperationResult ExportThrottledRequests(this ILogAnalyticsOperations operations, string location, ThrottledRequestsInput parameters) + { + return ((ILogAnalyticsOperations)operations).ExportThrottledRequestsAsync(location, parameters).GetAwaiter().GetResult(); + } - /// - /// Export logs that show total throttled Api requests for this subscription in - /// the given time window. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The request body - /// - public static LogAnalyticsOperationResult ExportThrottledRequests(this ILogAnalyticsOperations operations, string location, ThrottledRequestsInput parameters) + /// + /// Export logs that show total throttled Api requests for this subscription in + /// the given time window. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ExportThrottledRequestsAsync(this ILogAnalyticsOperations operations, string location, ThrottledRequestsInput parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ExportThrottledRequestsWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ExportThrottledRequestsAsync(location, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Export logs that show Api requests made by this subscription in the given + /// time window to show throttling activities. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + public static LogAnalyticsOperationResult BeginExportRequestRateByInterval(this ILogAnalyticsOperations operations, string location, RequestRateByIntervalInput parameters) + { + return ((ILogAnalyticsOperations)operations).BeginExportRequestRateByIntervalAsync(location, parameters).GetAwaiter().GetResult(); + } - /// - /// Export logs that show total throttled Api requests for this subscription in - /// the given time window. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The request body - /// - /// - /// The cancellation token. - /// - public static async Task ExportThrottledRequestsAsync(this ILogAnalyticsOperations operations, string location, ThrottledRequestsInput parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Export logs that show Api requests made by this subscription in the given + /// time window to show throttling activities. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginExportRequestRateByIntervalAsync(this ILogAnalyticsOperations operations, string location, RequestRateByIntervalInput parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginExportRequestRateByIntervalWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ExportThrottledRequestsWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Export logs that show total throttled Api requests for this subscription in + /// the given time window. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + public static LogAnalyticsOperationResult BeginExportThrottledRequests(this ILogAnalyticsOperations operations, string location, ThrottledRequestsInput parameters) + { + return ((ILogAnalyticsOperations)operations).BeginExportThrottledRequestsAsync(location, parameters).GetAwaiter().GetResult(); + } - /// - /// Export logs that show Api requests made by this subscription in the given - /// time window to show throttling activities. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - /// - public static LogAnalyticsOperationResult BeginExportRequestRateByInterval(this ILogAnalyticsOperations operations, string location, RequestRateByIntervalInput parameters) + /// + /// Export logs that show total throttled Api requests for this subscription in + /// the given time window. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginExportThrottledRequestsAsync(this ILogAnalyticsOperations operations, string location, ThrottledRequestsInput parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginExportThrottledRequestsWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginExportRequestRateByIntervalAsync(location, parameters).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Export logs that show Api requests made by this subscription in the given - /// time window to show throttling activities. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - /// - /// - /// The cancellation token. - /// - public static async Task BeginExportRequestRateByIntervalAsync(this ILogAnalyticsOperations operations, string location, RequestRateByIntervalInput parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginExportRequestRateByIntervalWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Export logs that show total throttled Api requests for this subscription in - /// the given time window. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The request body - /// - public static LogAnalyticsOperationResult BeginExportThrottledRequests(this ILogAnalyticsOperations operations, string location, ThrottledRequestsInput parameters) - { - return operations.BeginExportThrottledRequestsAsync(location, parameters).GetAwaiter().GetResult(); - } - - /// - /// Export logs that show total throttled Api requests for this subscription in - /// the given time window. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The request body - /// - /// - /// The cancellation token. - /// - public static async Task BeginExportThrottledRequestsAsync(this ILogAnalyticsOperations operations, string location, ThrottledRequestsInput parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginExportThrottledRequestsWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRules.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRules.cs index 9f46cd045c90..9c5503aed016 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRules.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRules.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,16 +24,25 @@ public AccessControlRules() /// /// Initializes a new instance of the AccessControlRules class. /// - /// A list of privileges. - /// A list of roles. - /// A list of identities. - /// A list of role assignments. - public AccessControlRules(IList privileges = default(IList), IList roles = default(IList), IList identities = default(IList), IList roleAssignments = default(IList)) + + /// A list of privileges. + /// + + /// A list of roles. + /// + + /// A list of identities. + /// + + /// A list of role assignments. + /// + public AccessControlRules(System.Collections.Generic.IList privileges = default(System.Collections.Generic.IList), System.Collections.Generic.IList roles = default(System.Collections.Generic.IList), System.Collections.Generic.IList identities = default(System.Collections.Generic.IList), System.Collections.Generic.IList roleAssignments = default(System.Collections.Generic.IList)) + { - Privileges = privileges; - Roles = roles; - Identities = identities; - RoleAssignments = roleAssignments; + this.Privileges = privileges; + this.Roles = roles; + this.Identities = identities; + this.RoleAssignments = roleAssignments; CustomInit(); } @@ -50,29 +51,29 @@ public AccessControlRules() /// partial void CustomInit(); + /// /// Gets or sets a list of privileges. /// - [JsonProperty(PropertyName = "privileges")] - public IList Privileges { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "privileges")] + public System.Collections.Generic.IList Privileges {get; set; } /// /// Gets or sets a list of roles. /// - [JsonProperty(PropertyName = "roles")] - public IList Roles { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "roles")] + public System.Collections.Generic.IList Roles {get; set; } /// /// Gets or sets a list of identities. /// - [JsonProperty(PropertyName = "identities")] - public IList Identities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identities")] + public System.Collections.Generic.IList Identities {get; set; } /// /// Gets or sets a list of role assignments. /// - [JsonProperty(PropertyName = "roleAssignments")] - public IList RoleAssignments { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "roleAssignments")] + public System.Collections.Generic.IList RoleAssignments {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesIdentity.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesIdentity.cs index 01551d5604d3..d7b526ca8b57 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesIdentity.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesIdentity.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,21 +23,29 @@ public AccessControlRulesIdentity() /// /// Initializes a new instance of the AccessControlRulesIdentity class. /// - /// The name of the identity. - /// The username corresponding to this - /// identity. - /// The groupName corresponding to this - /// identity. - /// The path to the executable. - /// The process name of the - /// executable. + + /// The name of the identity. + /// + + /// The username corresponding to this identity. + /// + + /// The groupName corresponding to this identity. + /// + + /// The path to the executable. + /// + + /// The process name of the executable. + /// public AccessControlRulesIdentity(string name, string userName = default(string), string groupName = default(string), string exePath = default(string), string processName = default(string)) + { - Name = name; - UserName = userName; - GroupName = groupName; - ExePath = exePath; - ProcessName = processName; + this.Name = name; + this.UserName = userName; + this.GroupName = groupName; + this.ExePath = exePath; + this.ProcessName = processName; CustomInit(); } @@ -53,48 +54,53 @@ public AccessControlRulesIdentity() /// partial void CustomInit(); + /// /// Gets or sets the name of the identity. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the username corresponding to this identity. /// - [JsonProperty(PropertyName = "userName")] - public string UserName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "userName")] + public string UserName {get; set; } /// /// Gets or sets the groupName corresponding to this identity. /// - [JsonProperty(PropertyName = "groupName")] - public string GroupName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "groupName")] + public string GroupName {get; set; } /// /// Gets or sets the path to the executable. /// - [JsonProperty(PropertyName = "exePath")] - public string ExePath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "exePath")] + public string ExePath {get; set; } /// /// Gets or sets the process name of the executable. /// - [JsonProperty(PropertyName = "processName")] - public string ProcessName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "processName")] + public string ProcessName {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesMode.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesMode.cs index 7e99baa50e9c..f1dd742827c3 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesMode.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for AccessControlRulesMode. /// + + public static class AccessControlRulesMode { public const string Audit = "Audit"; public const string Enforce = "Enforce"; public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesPrivilege.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesPrivilege.cs index 6f695cd360c5..1397bba64f0f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesPrivilege.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesPrivilege.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class AccessControlRulesPrivilege { /// - /// Initializes a new instance of the AccessControlRulesPrivilege - /// class. + /// Initializes a new instance of the AccessControlRulesPrivilege class. /// public AccessControlRulesPrivilege() { @@ -31,19 +21,23 @@ public AccessControlRulesPrivilege() } /// - /// Initializes a new instance of the AccessControlRulesPrivilege - /// class. + /// Initializes a new instance of the AccessControlRulesPrivilege class. /// - /// The name of the privilege. - /// The HTTP path corresponding to the - /// privilege. - /// The query parameters to match in the - /// path. - public AccessControlRulesPrivilege(string name, string path, IDictionary queryParameters = default(IDictionary)) + + /// The name of the privilege. + /// + + /// The HTTP path corresponding to the privilege. + /// + + /// The query parameters to match in the path. + /// + public AccessControlRulesPrivilege(string name, string path, System.Collections.Generic.IDictionary queryParameters = default(System.Collections.Generic.IDictionary)) + { - Name = name; - Path = path; - QueryParameters = queryParameters; + this.Name = name; + this.Path = path; + this.QueryParameters = queryParameters; CustomInit(); } @@ -52,40 +46,43 @@ public AccessControlRulesPrivilege() /// partial void CustomInit(); + /// /// Gets or sets the name of the privilege. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the HTTP path corresponding to the privilege. /// - [JsonProperty(PropertyName = "path")] - public string Path { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "path")] + public string Path {get; set; } /// /// Gets or sets the query parameters to match in the path. /// - [JsonProperty(PropertyName = "queryParameters")] - public IDictionary QueryParameters { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "queryParameters")] + public System.Collections.Generic.IDictionary QueryParameters {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (Path == null) + if (this.Path == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Path"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Path"); } + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesRole.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesRole.cs index 98de0923adf7..81cb1a67a70d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesRole.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesRole.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,13 +23,17 @@ public AccessControlRulesRole() /// /// Initializes a new instance of the AccessControlRulesRole class. /// - /// The name of the role. - /// A list of privileges needed by this - /// role. - public AccessControlRulesRole(string name, IList privileges) + + /// The name of the role. + /// + + /// A list of privileges needed by this role. + /// + public AccessControlRulesRole(string name, System.Collections.Generic.IList privileges) + { - Name = name; - Privileges = privileges; + this.Name = name; + this.Privileges = privileges; CustomInit(); } @@ -47,34 +42,36 @@ public AccessControlRulesRole(string name, IList privileges) /// partial void CustomInit(); + /// /// Gets or sets the name of the role. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets a list of privileges needed by this role. /// - [JsonProperty(PropertyName = "privileges")] - public IList Privileges { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "privileges")] + public System.Collections.Generic.IList Privileges {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (Privileges == null) + if (this.Privileges == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Privileges"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Privileges"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesRoleAssignment.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesRoleAssignment.cs index e689af996134..f5599e685d1c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesRoleAssignment.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessControlRulesRoleAssignment.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class AccessControlRulesRoleAssignment { /// - /// Initializes a new instance of the AccessControlRulesRoleAssignment - /// class. + /// Initializes a new instance of the AccessControlRulesRoleAssignment class. /// public AccessControlRulesRoleAssignment() { @@ -31,16 +21,19 @@ public AccessControlRulesRoleAssignment() } /// - /// Initializes a new instance of the AccessControlRulesRoleAssignment - /// class. + /// Initializes a new instance of the AccessControlRulesRoleAssignment class. /// - /// The name of the role. - /// A list of identities that can access the - /// privileges defined by the role. - public AccessControlRulesRoleAssignment(string role, IList identities) + + /// The name of the role. + /// + + /// A list of identities that can access the privileges defined by the role. + /// + public AccessControlRulesRoleAssignment(string role, System.Collections.Generic.IList identities) + { - Role = role; - Identities = identities; + this.Role = role; + this.Identities = identities; CustomInit(); } @@ -49,35 +42,37 @@ public AccessControlRulesRoleAssignment(string role, IList identities) /// partial void CustomInit(); + /// /// Gets or sets the name of the role. /// - [JsonProperty(PropertyName = "role")] - public string Role { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "role")] + public string Role {get; set; } /// - /// Gets or sets a list of identities that can access the privileges - /// defined by the role. + /// Gets or sets a list of identities that can access the privileges defined by + /// the role. /// - [JsonProperty(PropertyName = "identities")] - public IList Identities { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "identities")] + public System.Collections.Generic.IList Identities {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Role == null) + if (this.Role == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Role"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Role"); } - if (Identities == null) + if (this.Identities == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Identities"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Identities"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessLevel.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessLevel.cs index b23ace763aa6..c80f73090a6d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessLevel.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessLevel.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for AccessLevel. /// + + public static class AccessLevel { public const string None = "None"; public const string Read = "Read"; public const string Write = "Write"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessUri.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessUri.cs index 66610d618fe2..88488d2ec19e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AccessUri.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AccessUri.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,16 +23,21 @@ public AccessUri() /// /// Initializes a new instance of the AccessUri class. /// - /// A SAS uri for accessing a disk. - /// A SAS uri for accessing a VM - /// guest state. - /// A SAS uri for accessing a - /// VM metadata. - public AccessUri(string accessSAS = default(string), string securityDataAccessSAS = default(string), string securityMetadataAccessSAS = default(string)) + + /// A SAS uri for accessing a disk. + /// + + /// A SAS uri for accessing a VM guest state. + /// + + /// A SAS uri for accessing a VM metadata. + /// + public AccessUri(string accessSas = default(string), string securityDataAccessSas = default(string), string securityMetadataAccessSas = default(string)) + { - AccessSAS = accessSAS; - SecurityDataAccessSAS = securityDataAccessSAS; - SecurityMetadataAccessSAS = securityMetadataAccessSAS; + this.AccessSas = accessSas; + this.SecurityDataAccessSas = securityDataAccessSas; + this.SecurityMetadataAccessSas = securityMetadataAccessSas; CustomInit(); } @@ -47,23 +46,23 @@ public AccessUri() /// partial void CustomInit(); + /// /// Gets a SAS uri for accessing a disk. /// - [JsonProperty(PropertyName = "accessSAS")] - public string AccessSAS { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "accessSAS")] + public string AccessSas {get; private set; } /// /// Gets a SAS uri for accessing a VM guest state. /// - [JsonProperty(PropertyName = "securityDataAccessSAS")] - public string SecurityDataAccessSAS { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "securityDataAccessSAS")] + public string SecurityDataAccessSas {get; private set; } /// /// Gets a SAS uri for accessing a VM metadata. /// - [JsonProperty(PropertyName = "securityMetadataAccessSAS")] - public string SecurityMetadataAccessSAS { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "securityMetadataAccessSAS")] + public string SecurityMetadataAccessSas {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AdditionalCapabilities.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AdditionalCapabilities.cs index 18f8541b7633..fafc7841b657 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AdditionalCapabilities.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AdditionalCapabilities.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Enables or disables a capability on the virtual machine or virtual - /// machine scale set. + /// Enables or disables a capability on the virtual machine or virtual machine + /// scale set. /// public partial class AdditionalCapabilities { @@ -30,17 +24,21 @@ public AdditionalCapabilities() /// /// Initializes a new instance of the AdditionalCapabilities class. /// - /// The flag that enables or disables a - /// capability to have one or more managed data disks with UltraSSD_LRS - /// storage account type on the VM or VMSS. Managed disks with storage - /// account type UltraSSD_LRS can be added to a virtual machine or - /// virtual machine scale set only if this property is enabled. - /// The flag that enables or disables - /// hibernation capability on the VM. - public AdditionalCapabilities(bool? ultraSSDEnabled = default(bool?), bool? hibernationEnabled = default(bool?)) + + /// The flag that enables or disables a capability to have one or more managed + /// data disks with UltraSSD_LRS storage account type on the VM or VMSS. + /// Managed disks with storage account type UltraSSD_LRS can be added to a + /// virtual machine or virtual machine scale set only if this property is + /// enabled. + /// + + /// The flag that enables or disables hibernation capability on the VM. + /// + public AdditionalCapabilities(bool? ultraSsdEnabled = default(bool?), bool? hibernationEnabled = default(bool?)) + { - UltraSSDEnabled = ultraSSDEnabled; - HibernationEnabled = hibernationEnabled; + this.UltraSSDEnabled = ultraSsdEnabled; + this.HibernationEnabled = hibernationEnabled; CustomInit(); } @@ -49,22 +47,22 @@ public AdditionalCapabilities() /// partial void CustomInit(); + /// - /// Gets or sets the flag that enables or disables a capability to have - /// one or more managed data disks with UltraSSD_LRS storage account - /// type on the VM or VMSS. Managed disks with storage account type - /// UltraSSD_LRS can be added to a virtual machine or virtual machine - /// scale set only if this property is enabled. + /// Gets or sets the flag that enables or disables a capability to have one or + /// more managed data disks with UltraSSD_LRS storage account type on the VM or + /// VMSS. Managed disks with storage account type UltraSSD_LRS can be added to + /// a virtual machine or virtual machine scale set only if this property is + /// enabled. /// - [JsonProperty(PropertyName = "ultraSSDEnabled")] - public bool? UltraSSDEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ultraSSDEnabled")] + public bool? UltraSSDEnabled {get; set; } /// - /// Gets or sets the flag that enables or disables hibernation - /// capability on the VM. + /// Gets or sets the flag that enables or disables hibernation capability on + /// the VM. /// - [JsonProperty(PropertyName = "hibernationEnabled")] - public bool? HibernationEnabled { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "hibernationEnabled")] + public bool? HibernationEnabled {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AdditionalReplicaSet.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AdditionalReplicaSet.cs index 7a30e10ee5d8..d1b344a19eeb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AdditionalReplicaSet.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AdditionalReplicaSet.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,20 @@ public AdditionalReplicaSet() /// /// Initializes a new instance of the AdditionalReplicaSet class. /// - /// Specifies the storage account type - /// to be used to create the direct drive replicas. Possible values - /// include: 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS', - /// 'PremiumV2_LRS' - /// The number of direct drive - /// replicas of the Image Version to be created.This Property is - /// updatable + + /// Specifies the storage account type to be used to create the direct drive + /// replicas + /// Possible values include: 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS', + /// 'PremiumV2_LRS' + + /// The number of direct drive replicas of the Image Version to be created.This + /// Property is updatable + /// public AdditionalReplicaSet(string storageAccountType = default(string), int? regionalReplicaCount = default(int?)) + { - StorageAccountType = storageAccountType; - RegionalReplicaCount = regionalReplicaCount; + this.StorageAccountType = storageAccountType; + this.RegionalReplicaCount = regionalReplicaCount; CustomInit(); } @@ -48,20 +45,19 @@ public AdditionalReplicaSet() /// partial void CustomInit(); + /// - /// Gets or sets specifies the storage account type to be used to - /// create the direct drive replicas. Possible values include: - /// 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS', 'PremiumV2_LRS' + /// Gets or sets specifies the storage account type to be used to create the + /// direct drive replicas Possible values include: 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS', 'PremiumV2_LRS' /// - [JsonProperty(PropertyName = "storageAccountType")] - public string StorageAccountType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountType")] + public string StorageAccountType {get; set; } /// - /// Gets or sets the number of direct drive replicas of the Image - /// Version to be created.This Property is updatable + /// Gets or sets the number of direct drive replicas of the Image Version to be + /// created.This Property is updatable /// - [JsonProperty(PropertyName = "regionalReplicaCount")] - public int? RegionalReplicaCount { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "regionalReplicaCount")] + public int? RegionalReplicaCount {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AdditionalUnattendContent.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AdditionalUnattendContent.cs index b7aac7275880..de2a663e9c51 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AdditionalUnattendContent.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AdditionalUnattendContent.cs @@ -1,23 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Specifies additional XML formatted information that can be included in - /// the Unattend.xml file, which is used by Windows Setup. Contents are - /// defined by setting name, component name, and the pass in which the - /// content is applied. + /// Specifies additional XML formatted information that can be included in the + /// Unattend.xml file, which is used by Windows Setup. Contents are defined by + /// setting name, component name, and the pass in which the content is applied. /// public partial class AdditionalUnattendContent { @@ -32,25 +25,30 @@ public AdditionalUnattendContent() /// /// Initializes a new instance of the AdditionalUnattendContent class. /// - /// The pass name. Currently, the only allowable - /// value is OobeSystem. Possible values include: 'OobeSystem' - /// The component name. Currently, the only - /// allowable value is Microsoft-Windows-Shell-Setup. Possible values - /// include: 'Microsoft-Windows-Shell-Setup' - /// Specifies the name of the setting to - /// which the content applies. Possible values are: FirstLogonCommands - /// and AutoLogon. Possible values include: 'AutoLogon', - /// 'FirstLogonCommands' - /// Specifies the XML formatted content that is - /// added to the unattend.xml file for the specified path and - /// component. The XML must be less than 4KB and must include the root - /// element for the setting or feature that is being inserted. + + /// The pass name. Currently, the only allowable value is OobeSystem. + /// Possible values include: 'OobeSystem' + + /// The component name. Currently, the only allowable value is + /// Microsoft-Windows-Shell-Setup. + /// Possible values include: 'Microsoft-Windows-Shell-Setup' + + /// Specifies the name of the setting to which the content applies. Possible + /// values are: FirstLogonCommands and AutoLogon. + /// Possible values include: 'AutoLogon', 'FirstLogonCommands' + + /// Specifies the XML formatted content that is added to the unattend.xml file + /// for the specified path and component. The XML must be less than 4KB and + /// must include the root element for the setting or feature that is being + /// inserted. + /// public AdditionalUnattendContent(PassNames? passName = default(PassNames?), ComponentNames? componentName = default(ComponentNames?), SettingNames? settingName = default(SettingNames?), string content = default(string)) + { - PassName = passName; - ComponentName = componentName; - SettingName = settingName; - Content = content; + this.PassName = passName; + this.ComponentName = componentName; + this.SettingName = settingName; + this.Content = content; CustomInit(); } @@ -59,37 +57,35 @@ public AdditionalUnattendContent() /// partial void CustomInit(); + /// /// Gets or sets the pass name. Currently, the only allowable value is - /// OobeSystem. Possible values include: 'OobeSystem' + /// OobeSystem. Possible values include: 'OobeSystem' /// - [JsonProperty(PropertyName = "passName")] - public PassNames? PassName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "passName")] + public PassNames? PassName {get; set; } /// - /// Gets or sets the component name. Currently, the only allowable - /// value is Microsoft-Windows-Shell-Setup. Possible values include: - /// 'Microsoft-Windows-Shell-Setup' + /// Gets or sets the component name. Currently, the only allowable value is + /// Microsoft-Windows-Shell-Setup. Possible values include: 'Microsoft-Windows-Shell-Setup' /// - [JsonProperty(PropertyName = "componentName")] - public ComponentNames? ComponentName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "componentName")] + public ComponentNames? ComponentName {get; set; } /// /// Gets or sets specifies the name of the setting to which the content - /// applies. Possible values are: FirstLogonCommands and AutoLogon. - /// Possible values include: 'AutoLogon', 'FirstLogonCommands' + /// applies. Possible values are: FirstLogonCommands and AutoLogon. Possible values include: 'AutoLogon', 'FirstLogonCommands' /// - [JsonProperty(PropertyName = "settingName")] - public SettingNames? SettingName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "settingName")] + public SettingNames? SettingName {get; set; } /// - /// Gets or sets specifies the XML formatted content that is added to - /// the unattend.xml file for the specified path and component. The XML - /// must be less than 4KB and must include the root element for the - /// setting or feature that is being inserted. + /// Gets or sets specifies the XML formatted content that is added to the + /// unattend.xml file for the specified path and component. The XML must be + /// less than 4KB and must include the root element for the setting or feature + /// that is being inserted. /// - [JsonProperty(PropertyName = "content")] - public string Content { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "content")] + public string Content {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AggregatedReplicationState.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AggregatedReplicationState.cs index b3a4f61130c9..08f2469c49be 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AggregatedReplicationState.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AggregatedReplicationState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for AggregatedReplicationState. /// + + public static class AggregatedReplicationState { public const string Unknown = "Unknown"; @@ -21,4 +18,4 @@ public static class AggregatedReplicationState public const string Completed = "Completed"; public const string Failed = "Failed"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AllInstancesDown.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AllInstancesDown.cs index 9686e2d36118..8b9d4259caaa 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AllInstancesDown.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AllInstancesDown.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Specifies if Scheduled Events should be auto-approved when all - /// instances are down. + /// Specifies if Scheduled Events should be auto-approved when all instances + /// are down. /// public partial class AllInstancesDown { @@ -30,12 +24,15 @@ public AllInstancesDown() /// /// Initializes a new instance of the AllInstancesDown class. /// - /// Specifies if Scheduled Events - /// should be auto-approved when all instances are down. - /// its default value is true + + /// Specifies if Scheduled Events should be auto-approved when all instances + /// are down. + /// its default value is true + /// public AllInstancesDown(bool? automaticallyApprove = default(bool?)) + { - AutomaticallyApprove = automaticallyApprove; + this.AutomaticallyApprove = automaticallyApprove; CustomInit(); } @@ -44,13 +41,13 @@ public AllInstancesDown() /// partial void CustomInit(); + /// - /// Gets or sets specifies if Scheduled Events should be auto-approved - /// when all instances are down. + /// Gets or sets specifies if Scheduled Events should be auto-approved when all + /// instances are down. /// its default value is true /// - [JsonProperty(PropertyName = "automaticallyApprove")] - public bool? AutomaticallyApprove { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "automaticallyApprove")] + public bool? AutomaticallyApprove {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AllocationStrategy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AllocationStrategy.cs index 74a7388ae14b..7492692e7cb1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AllocationStrategy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AllocationStrategy.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for AllocationStrategy. /// + + public static class AllocationStrategy { public const string LowestPrice = "LowestPrice"; public const string CapacityOptimized = "CapacityOptimized"; public const string Prioritized = "Prioritized"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AlternativeOption.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AlternativeOption.cs index 0c1db05e4858..0328d34163dd 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AlternativeOption.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AlternativeOption.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Describes the alternative option specified by the Publisher for this - /// image when this image is deprecated. + /// Describes the alternative option specified by the Publisher for this image + /// when this image is deprecated. /// public partial class AlternativeOption { @@ -30,15 +24,19 @@ public AlternativeOption() /// /// Initializes a new instance of the AlternativeOption class. /// + /// Describes the type of the alternative option. - /// Possible values include: 'None', 'Offer', 'Plan' - /// Indicates the alternative option value - /// specified by the Publisher. This is the Offer name when the type is - /// Offer or the Plan name when the type is Plan. + /// Possible values include: 'None', 'Offer', 'Plan' + + /// Indicates the alternative option value specified by the Publisher. This is + /// the Offer name when the type is Offer or the Plan name when the type is + /// Plan. + /// public AlternativeOption(string type = default(string), string value = default(string)) + { - Type = type; - Value = value; + this.Type = type; + this.Value = value; CustomInit(); } @@ -47,20 +45,19 @@ public AlternativeOption() /// partial void CustomInit(); + /// - /// Gets or sets describes the type of the alternative option. Possible - /// values include: 'None', 'Offer', 'Plan' + /// Gets or sets describes the type of the alternative option. Possible values include: 'None', 'Offer', 'Plan' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// - /// Gets or sets indicates the alternative option value specified by - /// the Publisher. This is the Offer name when the type is Offer or the - /// Plan name when the type is Plan. + /// Gets or sets indicates the alternative option value specified by the + /// Publisher. This is the Offer name when the type is Offer or the Plan name + /// when the type is Plan. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AlternativeType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AlternativeType.cs index ad49f56a5139..83ebf09f23a3 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AlternativeType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AlternativeType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for AlternativeType. /// + + public static class AlternativeType { public const string None = "None"; public const string Offer = "Offer"; public const string Plan = "Plan"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ApiEntityReference.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ApiEntityReference.cs index 85ecc19c8859..152f1fee373b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ApiEntityReference.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ApiEntityReference.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,14 @@ public ApiEntityReference() /// /// Initializes a new instance of the ApiEntityReference class. /// + /// The ARM resource id in the form of - /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + /// public ApiEntityReference(string id = default(string)) + { - Id = id; + this.Id = id; CustomInit(); } @@ -42,12 +39,12 @@ public ApiEntityReference() /// partial void CustomInit(); + /// /// Gets or sets the ARM resource id in the form of /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ApiError.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ApiError.cs index f29314dc30a0..0b11ac5e84c0 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ApiError.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ApiError.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,18 +23,29 @@ public ApiError() /// /// Initializes a new instance of the ApiError class. /// - /// The Api error details - /// The Api inner error - /// The error code. - /// The target of the particular error. - /// The error message. - public ApiError(IList details = default(IList), InnerError innererror = default(InnerError), string code = default(string), string target = default(string), string message = default(string)) + + /// The Api error details + /// + + /// The Api inner error + /// + + /// The error code. + /// + + /// The target of the particular error. + /// + + /// The error message. + /// + public ApiError(System.Collections.Generic.IList details = default(System.Collections.Generic.IList), InnerError innererror = default(InnerError), string code = default(string), string target = default(string), string message = default(string)) + { - Details = details; - Innererror = innererror; - Code = code; - Target = target; - Message = message; + this.Details = details; + this.Innererror = innererror; + this.Code = code; + this.Target = target; + this.Message = message; CustomInit(); } @@ -51,35 +54,35 @@ public ApiError() /// partial void CustomInit(); + /// /// Gets or sets the Api error details /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details {get; set; } /// /// Gets or sets the Api inner error /// - [JsonProperty(PropertyName = "innererror")] - public InnerError Innererror { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "innererror")] + public InnerError Innererror {get; set; } /// /// Gets or sets the error code. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } /// /// Gets or sets the target of the particular error. /// - [JsonProperty(PropertyName = "target")] - public string Target { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; set; } /// /// Gets or sets the error message. /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ApiErrorBase.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ApiErrorBase.cs index 11cb3c5701e3..4ea5f05ac018 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ApiErrorBase.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ApiErrorBase.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,21 @@ public ApiErrorBase() /// /// Initializes a new instance of the ApiErrorBase class. /// - /// The error code. - /// The target of the particular error. - /// The error message. + + /// The error code. + /// + + /// The target of the particular error. + /// + + /// The error message. + /// public ApiErrorBase(string code = default(string), string target = default(string), string message = default(string)) + { - Code = code; - Target = target; - Message = message; + this.Code = code; + this.Target = target; + this.Message = message; CustomInit(); } @@ -45,23 +46,23 @@ public ApiErrorBase() /// partial void CustomInit(); + /// /// Gets or sets the error code. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } /// /// Gets or sets the target of the particular error. /// - [JsonProperty(PropertyName = "target")] - public string Target { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; set; } /// /// Gets or sets the error message. /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ApplicationProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ApplicationProfile.cs index 4b7ed0d431ce..baf848905e6b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ApplicationProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ApplicationProfile.cs @@ -1,23 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Contains the list of gallery applications that should be made available - /// to the VM/VMSS + /// Contains the list of gallery applications that should be made available to + /// the VM/VMSS /// public partial class ApplicationProfile { @@ -32,11 +24,14 @@ public ApplicationProfile() /// /// Initializes a new instance of the ApplicationProfile class. /// - /// Specifies the gallery - /// applications that should be made available to the VM/VMSS - public ApplicationProfile(IList galleryApplications = default(IList)) + + /// Specifies the gallery applications that should be made available to the + /// VM/VMSS + /// + public ApplicationProfile(System.Collections.Generic.IList galleryApplications = default(System.Collections.Generic.IList)) + { - GalleryApplications = galleryApplications; + this.GalleryApplications = galleryApplications; CustomInit(); } @@ -45,12 +40,12 @@ public ApplicationProfile() /// partial void CustomInit(); + /// /// Gets or sets specifies the gallery applications that should be made /// available to the VM/VMSS /// - [JsonProperty(PropertyName = "galleryApplications")] - public IList GalleryApplications { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "galleryApplications")] + public System.Collections.Generic.IList GalleryApplications {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Architecture.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Architecture.cs index 592633e05740..8d0096c7c2df 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Architecture.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/Architecture.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for Architecture. /// + + public static class Architecture { public const string X64 = "x64"; public const string Arm64 = "Arm64"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ArchitectureTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ArchitectureTypes.cs index 954bb0b2e37e..31f3e6c2cc75 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ArchitectureTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ArchitectureTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ArchitectureTypes. /// + + public static class ArchitectureTypes { public const string X64 = "x64"; public const string Arm64 = "Arm64"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AttachDetachDataDisksRequest.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AttachDetachDataDisksRequest.cs index ea0f71861dc9..a18e0814e9f4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AttachDetachDataDisksRequest.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AttachDetachDataDisksRequest.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -23,8 +14,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class AttachDetachDataDisksRequest { /// - /// Initializes a new instance of the AttachDetachDataDisksRequest - /// class. + /// Initializes a new instance of the AttachDetachDataDisksRequest class. /// public AttachDetachDataDisksRequest() { @@ -32,17 +22,19 @@ public AttachDetachDataDisksRequest() } /// - /// Initializes a new instance of the AttachDetachDataDisksRequest - /// class. + /// Initializes a new instance of the AttachDetachDataDisksRequest class. /// - /// The list of managed data disks to - /// be attached. - /// The list of managed data disks to - /// be detached. - public AttachDetachDataDisksRequest(IList dataDisksToAttach = default(IList), IList dataDisksToDetach = default(IList)) + + /// The list of managed data disks to be attached. + /// + + /// The list of managed data disks to be detached. + /// + public AttachDetachDataDisksRequest(System.Collections.Generic.IList dataDisksToAttach = default(System.Collections.Generic.IList), System.Collections.Generic.IList dataDisksToDetach = default(System.Collections.Generic.IList)) + { - DataDisksToAttach = dataDisksToAttach; - DataDisksToDetach = dataDisksToDetach; + this.DataDisksToAttach = dataDisksToAttach; + this.DataDisksToDetach = dataDisksToDetach; CustomInit(); } @@ -51,33 +43,33 @@ public AttachDetachDataDisksRequest() /// partial void CustomInit(); + /// /// Gets or sets the list of managed data disks to be attached. /// - [JsonProperty(PropertyName = "dataDisksToAttach")] - public IList DataDisksToAttach { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDisksToAttach")] + public System.Collections.Generic.IList DataDisksToAttach {get; set; } /// /// Gets or sets the list of managed data disks to be detached. /// - [JsonProperty(PropertyName = "dataDisksToDetach")] - public IList DataDisksToDetach { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDisksToDetach")] + public System.Collections.Generic.IList DataDisksToDetach {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (DataDisksToAttach != null) + if (this.DataDisksToAttach != null) { - if (DataDisksToAttach.Count < 1) + if (this.DataDisksToAttach.Count < 1) { - throw new ValidationException(ValidationRules.MinItems, "DataDisksToAttach", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinItems, "DataDisksToAttach", 1); } - foreach (var element in DataDisksToAttach) + foreach (var element in this.DataDisksToAttach) { if (element != null) { @@ -85,20 +77,20 @@ public virtual void Validate() } } } - if (DataDisksToDetach != null) + if (this.DataDisksToDetach != null) { - if (DataDisksToDetach.Count < 1) + if (this.DataDisksToDetach.Count < 1) { - throw new ValidationException(ValidationRules.MinItems, "DataDisksToDetach", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinItems, "DataDisksToDetach", 1); } - foreach (var element1 in DataDisksToDetach) + foreach (var element in this.DataDisksToDetach) { - if (element1 != null) + if (element != null) { - element1.Validate(); + element.Validate(); } } } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AutomaticOSUpgradePolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AutomaticOSUpgradePolicy.cs index d548bdc03c4b..7823bc9f9290 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AutomaticOSUpgradePolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AutomaticOSUpgradePolicy.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,31 +23,37 @@ public AutomaticOSUpgradePolicy() /// /// Initializes a new instance of the AutomaticOSUpgradePolicy class. /// - /// Indicates whether OS - /// upgrades should automatically be applied to scale set instances in - /// a rolling fashion when a newer version of the OS image becomes - /// available. Default value is false. If this is set to true for - /// Windows based scale sets, + + /// Indicates whether OS upgrades should automatically be applied to scale set + /// instances in a rolling fashion when a newer version of the OS image becomes + /// available. Default value is false. If this is set to true for Windows based + /// scale sets, /// [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) - /// is automatically set to false and cannot be set to true. - /// Whether OS image rollback - /// feature should be disabled. Default value is false. - /// Indicates whether rolling - /// upgrade policy should be used during Auto OS Upgrade. Default value - /// is false. Auto OS Upgrade will fallback to the default policy if no - /// policy is defined on the VMSS. - /// Indicates whether Auto OS - /// Upgrade should undergo deferral. Deferred OS upgrades will send - /// advanced notifications on a per-VM basis that an OS upgrade from - /// rolling upgrades is incoming, via the IMDS tag - /// 'Platform.PendingOSUpgrade'. The upgrade then defers until the - /// upgrade is approved via an ApproveRollingUpgrade call. + /// is automatically set to false and cannot be set to true. + /// + + /// Whether OS image rollback feature should be disabled. Default value is + /// false. + /// + + /// Indicates whether rolling upgrade policy should be used during Auto OS + /// Upgrade. Default value is false. Auto OS Upgrade will fallback to the + /// default policy if no policy is defined on the VMSS. + /// + + /// Indicates whether Auto OS Upgrade should undergo deferral. Deferred OS + /// upgrades will send advanced notifications on a per-VM basis that an OS + /// upgrade from rolling upgrades is incoming, via the IMDS tag + /// 'Platform.PendingOSUpgrade'. The upgrade then defers until the upgrade is + /// approved via an ApproveRollingUpgrade call. + /// public AutomaticOSUpgradePolicy(bool? enableAutomaticOSUpgrade = default(bool?), bool? disableAutomaticRollback = default(bool?), bool? useRollingUpgradePolicy = default(bool?), bool? osRollingUpgradeDeferral = default(bool?)) + { - EnableAutomaticOSUpgrade = enableAutomaticOSUpgrade; - DisableAutomaticRollback = disableAutomaticRollback; - UseRollingUpgradePolicy = useRollingUpgradePolicy; - OsRollingUpgradeDeferral = osRollingUpgradeDeferral; + this.EnableAutomaticOSUpgrade = enableAutomaticOSUpgrade; + this.DisableAutomaticRollback = disableAutomaticRollback; + this.UseRollingUpgradePolicy = useRollingUpgradePolicy; + this.OsRollingUpgradeDeferral = osRollingUpgradeDeferral; CustomInit(); } @@ -62,43 +62,41 @@ public AutomaticOSUpgradePolicy() /// partial void CustomInit(); + /// - /// Gets or sets indicates whether OS upgrades should automatically be - /// applied to scale set instances in a rolling fashion when a newer - /// version of the OS image becomes available. Default value is false. - /// If this is set to true for Windows based scale sets, + /// Gets or sets indicates whether OS upgrades should automatically be applied + /// to scale set instances in a rolling fashion when a newer version of the OS + /// image becomes available. Default value is false. If this is set to true for + /// Windows based scale sets, /// [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) /// is automatically set to false and cannot be set to true. /// - [JsonProperty(PropertyName = "enableAutomaticOSUpgrade")] - public bool? EnableAutomaticOSUpgrade { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enableAutomaticOSUpgrade")] + public bool? EnableAutomaticOSUpgrade {get; set; } /// - /// Gets or sets whether OS image rollback feature should be disabled. - /// Default value is false. + /// Gets or sets whether OS image rollback feature should be disabled. Default + /// value is false. /// - [JsonProperty(PropertyName = "disableAutomaticRollback")] - public bool? DisableAutomaticRollback { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "disableAutomaticRollback")] + public bool? DisableAutomaticRollback {get; set; } /// - /// Gets or sets indicates whether rolling upgrade policy should be - /// used during Auto OS Upgrade. Default value is false. Auto OS - /// Upgrade will fallback to the default policy if no policy is defined - /// on the VMSS. + /// Gets or sets indicates whether rolling upgrade policy should be used during + /// Auto OS Upgrade. Default value is false. Auto OS Upgrade will fallback to + /// the default policy if no policy is defined on the VMSS. /// - [JsonProperty(PropertyName = "useRollingUpgradePolicy")] - public bool? UseRollingUpgradePolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "useRollingUpgradePolicy")] + public bool? UseRollingUpgradePolicy {get; set; } /// - /// Gets or sets indicates whether Auto OS Upgrade should undergo - /// deferral. Deferred OS upgrades will send advanced notifications on - /// a per-VM basis that an OS upgrade from rolling upgrades is - /// incoming, via the IMDS tag 'Platform.PendingOSUpgrade'. The upgrade - /// then defers until the upgrade is approved via an - /// ApproveRollingUpgrade call. + /// Gets or sets indicates whether Auto OS Upgrade should undergo deferral. + /// Deferred OS upgrades will send advanced notifications on a per-VM basis + /// that an OS upgrade from rolling upgrades is incoming, via the IMDS tag + /// 'Platform.PendingOSUpgrade'. The upgrade then defers until the upgrade is + /// approved via an ApproveRollingUpgrade call. /// - [JsonProperty(PropertyName = "osRollingUpgradeDeferral")] - public bool? OsRollingUpgradeDeferral { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "osRollingUpgradeDeferral")] + public bool? OsRollingUpgradeDeferral {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AutomaticOSUpgradeProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AutomaticOSUpgradeProperties.cs index 2b459e236be1..3794a2adb0af 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AutomaticOSUpgradeProperties.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AutomaticOSUpgradeProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class AutomaticOSUpgradeProperties { /// - /// Initializes a new instance of the AutomaticOSUpgradeProperties - /// class. + /// Initializes a new instance of the AutomaticOSUpgradeProperties class. /// public AutomaticOSUpgradeProperties() { @@ -28,14 +21,15 @@ public AutomaticOSUpgradeProperties() } /// - /// Initializes a new instance of the AutomaticOSUpgradeProperties - /// class. + /// Initializes a new instance of the AutomaticOSUpgradeProperties class. /// - /// Specifies whether - /// automatic OS upgrade is supported on the image. + + /// Specifies whether automatic OS upgrade is supported on the image. + /// public AutomaticOSUpgradeProperties(bool automaticOSUpgradeSupported) + { - AutomaticOSUpgradeSupported = automaticOSUpgradeSupported; + this.AutomaticOSUpgradeSupported = automaticOSUpgradeSupported; CustomInit(); } @@ -44,17 +38,17 @@ public AutomaticOSUpgradeProperties(bool automaticOSUpgradeSupported) /// partial void CustomInit(); + /// - /// Gets or sets specifies whether automatic OS upgrade is supported on - /// the image. + /// Gets or sets specifies whether automatic OS upgrade is supported on the + /// image. /// - [JsonProperty(PropertyName = "automaticOSUpgradeSupported")] - public bool AutomaticOSUpgradeSupported { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "automaticOSUpgradeSupported")] + public bool AutomaticOSUpgradeSupported {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() @@ -62,4 +56,4 @@ public virtual void Validate() //Nothing to validate } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AutomaticRepairsPolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AutomaticRepairsPolicy.cs index 77069f584cc0..15c6d54cd344 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AutomaticRepairsPolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AutomaticRepairsPolicy.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Specifies the configuration parameters for automatic repairs on the - /// virtual machine scale set. + /// Specifies the configuration parameters for automatic repairs on the virtual + /// machine scale set. /// public partial class AutomaticRepairsPolicy { @@ -30,25 +24,29 @@ public AutomaticRepairsPolicy() /// /// Initializes a new instance of the AutomaticRepairsPolicy class. /// - /// Specifies whether automatic repairs should be - /// enabled on the virtual machine scale set. The default value is - /// false. - /// The amount of time for which automatic - /// repairs are suspended due to a state change on VM. The grace time - /// starts after the state change has completed. This helps avoid - /// premature or accidental repairs. The time duration should be - /// specified in ISO 8601 format. The minimum allowed grace period is - /// 10 minutes (PT10M), which is also the default value. The maximum - /// allowed grace period is 90 minutes (PT90M). - /// Type of repair action (replace, restart, - /// reimage) that will be used for repairing unhealthy virtual machines - /// in the scale set. Default value is replace. Possible values - /// include: 'Replace', 'Restart', 'Reimage' + + /// Specifies whether automatic repairs should be enabled on the virtual + /// machine scale set. The default value is false. + /// + + /// The amount of time for which automatic repairs are suspended due to a state + /// change on VM. The grace time starts after the state change has completed. + /// This helps avoid premature or accidental repairs. The time duration should + /// be specified in ISO 8601 format. The minimum allowed grace period is 10 + /// minutes (PT10M), which is also the default value. The maximum allowed grace + /// period is 90 minutes (PT90M). + /// + + /// Type of repair action (replace, restart, reimage) that will be used for + /// repairing unhealthy virtual machines in the scale set. Default value is + /// replace. + /// Possible values include: 'Replace', 'Restart', 'Reimage' public AutomaticRepairsPolicy(bool? enabled = default(bool?), string gracePeriod = default(string), string repairAction = default(string)) + { - Enabled = enabled; - GracePeriod = gracePeriod; - RepairAction = repairAction; + this.Enabled = enabled; + this.GracePeriod = gracePeriod; + this.RepairAction = repairAction; CustomInit(); } @@ -57,33 +55,31 @@ public AutomaticRepairsPolicy() /// partial void CustomInit(); + /// - /// Gets or sets specifies whether automatic repairs should be enabled - /// on the virtual machine scale set. The default value is false. + /// Gets or sets specifies whether automatic repairs should be enabled on the + /// virtual machine scale set. The default value is false. /// - [JsonProperty(PropertyName = "enabled")] - public bool? Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } /// - /// Gets or sets the amount of time for which automatic repairs are - /// suspended due to a state change on VM. The grace time starts after - /// the state change has completed. This helps avoid premature or - /// accidental repairs. The time duration should be specified in ISO - /// 8601 format. The minimum allowed grace period is 10 minutes - /// (PT10M), which is also the default value. The maximum allowed grace - /// period is 90 minutes (PT90M). + /// Gets or sets the amount of time for which automatic repairs are suspended + /// due to a state change on VM. The grace time starts after the state change + /// has completed. This helps avoid premature or accidental repairs. The time + /// duration should be specified in ISO 8601 format. The minimum allowed grace + /// period is 10 minutes (PT10M), which is also the default value. The maximum + /// allowed grace period is 90 minutes (PT90M). /// - [JsonProperty(PropertyName = "gracePeriod")] - public string GracePeriod { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "gracePeriod")] + public string GracePeriod {get; set; } /// - /// Gets or sets type of repair action (replace, restart, reimage) that - /// will be used for repairing unhealthy virtual machines in the scale - /// set. Default value is replace. Possible values include: 'Replace', - /// 'Restart', 'Reimage' + /// Gets or sets type of repair action (replace, restart, reimage) that will be + /// used for repairing unhealthy virtual machines in the scale set. Default + /// value is replace. Possible values include: 'Replace', 'Restart', 'Reimage' /// - [JsonProperty(PropertyName = "repairAction")] - public string RepairAction { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "repairAction")] + public string RepairAction {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AutomaticZoneRebalancingPolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AutomaticZoneRebalancingPolicy.cs index f7602d4b56e9..1d8c07ef0647 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AutomaticZoneRebalancingPolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AutomaticZoneRebalancingPolicy.cs @@ -1,27 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// The configuration parameters used while performing automatic AZ - /// balancing. + /// The configuration parameters used while performing automatic AZ balancing. /// public partial class AutomaticZoneRebalancingPolicy { /// - /// Initializes a new instance of the AutomaticZoneRebalancingPolicy - /// class. + /// Initializes a new instance of the AutomaticZoneRebalancingPolicy class. /// public AutomaticZoneRebalancingPolicy() { @@ -29,26 +21,28 @@ public AutomaticZoneRebalancingPolicy() } /// - /// Initializes a new instance of the AutomaticZoneRebalancingPolicy - /// class. + /// Initializes a new instance of the AutomaticZoneRebalancingPolicy class. /// - /// Specifies whether Automatic AZ Balancing - /// should be enabled on the virtual machine scale set. The default - /// value is false. - /// Type of rebalance strategy that - /// will be used for rebalancing virtual machines in the scale set - /// across availability zones. Default and only supported value for now - /// is Recreate. Possible values include: 'Recreate' - /// Type of rebalance behavior that - /// will be used for recreating virtual machines in the scale set - /// across availability zones. Default and only supported value for now - /// is CreateBeforeDelete. Possible values include: - /// 'CreateBeforeDelete' + + /// Specifies whether Automatic AZ Balancing should be enabled on the virtual + /// machine scale set. The default value is false. + /// + + /// Type of rebalance strategy that will be used for rebalancing virtual + /// machines in the scale set across availability zones. Default and only + /// supported value for now is Recreate. + /// Possible values include: 'Recreate' + + /// Type of rebalance behavior that will be used for recreating virtual + /// machines in the scale set across availability zones. Default and only + /// supported value for now is CreateBeforeDelete. + /// Possible values include: 'CreateBeforeDelete' public AutomaticZoneRebalancingPolicy(bool? enabled = default(bool?), string rebalanceStrategy = default(string), string rebalanceBehavior = default(string)) + { - Enabled = enabled; - RebalanceStrategy = rebalanceStrategy; - RebalanceBehavior = rebalanceBehavior; + this.Enabled = enabled; + this.RebalanceStrategy = rebalanceStrategy; + this.RebalanceBehavior = rebalanceBehavior; CustomInit(); } @@ -57,31 +51,28 @@ public AutomaticZoneRebalancingPolicy() /// partial void CustomInit(); + /// - /// Gets or sets specifies whether Automatic AZ Balancing should be - /// enabled on the virtual machine scale set. The default value is - /// false. + /// Gets or sets specifies whether Automatic AZ Balancing should be enabled on + /// the virtual machine scale set. The default value is false. /// - [JsonProperty(PropertyName = "enabled")] - public bool? Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } /// - /// Gets or sets type of rebalance strategy that will be used for - /// rebalancing virtual machines in the scale set across availability - /// zones. Default and only supported value for now is Recreate. - /// Possible values include: 'Recreate' + /// Gets or sets type of rebalance strategy that will be used for rebalancing + /// virtual machines in the scale set across availability zones. Default and + /// only supported value for now is Recreate. Possible values include: 'Recreate' /// - [JsonProperty(PropertyName = "rebalanceStrategy")] - public string RebalanceStrategy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "rebalanceStrategy")] + public string RebalanceStrategy {get; set; } /// - /// Gets or sets type of rebalance behavior that will be used for - /// recreating virtual machines in the scale set across availability - /// zones. Default and only supported value for now is - /// CreateBeforeDelete. Possible values include: 'CreateBeforeDelete' + /// Gets or sets type of rebalance behavior that will be used for recreating + /// virtual machines in the scale set across availability zones. Default and + /// only supported value for now is CreateBeforeDelete. Possible values include: 'CreateBeforeDelete' /// - [JsonProperty(PropertyName = "rebalanceBehavior")] - public string RebalanceBehavior { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "rebalanceBehavior")] + public string RebalanceBehavior {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilityPolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilityPolicy.cs index 24b267cad5a8..ec46d8ea3c09 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilityPolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilityPolicy.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// In the case of an availability or connectivity issue with the data - /// disk, specify the behavior of your VM + /// In the case of an availability or connectivity issue with the data disk, + /// specify the behavior of your VM /// public partial class AvailabilityPolicy { @@ -30,12 +24,13 @@ public AvailabilityPolicy() /// /// Initializes a new instance of the AvailabilityPolicy class. /// - /// Determines on how to handle disks - /// with slow I/O. Possible values include: 'None', - /// 'AutomaticReattach' + + /// Determines on how to handle disks with slow I/O. + /// Possible values include: 'None', 'AutomaticReattach' public AvailabilityPolicy(string actionOnDiskDelay = default(string)) + { - ActionOnDiskDelay = actionOnDiskDelay; + this.ActionOnDiskDelay = actionOnDiskDelay; CustomInit(); } @@ -44,12 +39,11 @@ public AvailabilityPolicy() /// partial void CustomInit(); + /// - /// Gets or sets determines on how to handle disks with slow I/O. - /// Possible values include: 'None', 'AutomaticReattach' + /// Gets or sets determines on how to handle disks with slow I/O. Possible values include: 'None', 'AutomaticReattach' /// - [JsonProperty(PropertyName = "actionOnDiskDelay")] - public string ActionOnDiskDelay { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "actionOnDiskDelay")] + public string ActionOnDiskDelay {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilityPolicyDiskDelay.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilityPolicyDiskDelay.cs index 7bba456136fe..3041e865589d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilityPolicyDiskDelay.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilityPolicyDiskDelay.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,17 +9,19 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for AvailabilityPolicyDiskDelay. /// + + public static class AvailabilityPolicyDiskDelay { /// - /// Defaults to behavior without av policy specified, which is VM - /// restart upon slow disk io. + /// Defaults to behavior without av policy specified, which is VM restart upon + /// slow disk io. /// public const string None = "None"; /// - /// Upon a disk io failure or slow response, try detaching then - /// reattaching the disk. + /// Upon a disk io failure or slow response, try detaching then reattaching the + /// disk. /// public const string AutomaticReattach = "AutomaticReattach"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilitySet.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilitySet.cs index 796404d064fc..1572c55e2ba9 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilitySet.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilitySet.cs @@ -1,37 +1,26 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Specifies information about the availability set that the virtual - /// machine should be assigned to. Virtual machines specified in the same - /// availability set are allocated to different nodes to maximize - /// availability. For more information about availability sets, see - /// [Availability sets + /// Specifies information about the availability set that the virtual machine + /// should be assigned to. Virtual machines specified in the same availability + /// set are allocated to different nodes to maximize availability. For more + /// information about availability sets, see [Availability sets /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). /// For more information on Azure planned maintenance, see [Maintenance and /// updates for Virtual Machines in /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). - /// Currently, a VM can only be added to an availability set at creation - /// time. An existing VM cannot be added to an availability set. + /// Currently, a VM can only be added to an availability set at creation time. + /// An existing VM cannot be added to an availability set. /// - [Rest.Serialization.JsonTransformation] - public partial class AvailabilitySet : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class AvailabilitySet : TrackedResource { /// /// Initializes a new instance of the AvailabilitySet class. @@ -44,41 +33,62 @@ public AvailabilitySet() /// /// Initializes a new instance of the AvailabilitySet class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// Update Domain - /// count. - /// Fault Domain count. - /// A list of references to all virtual - /// machines in the availability set. - /// Specifies information about - /// the proximity placement group that the availability set should be - /// assigned to. Minimum api-version: 2018-04-01. - /// The resource status information. - /// Specifies Redeploy, Reboot and - /// ScheduledEventsAdditionalPublishingTargets Scheduled Event related - /// configurations for the availability set. - /// Describes the - /// migration properties on the Availability Set. - /// Sku of the availability set, only name is - /// required to be set. See AvailabilitySetSkuTypes for possible set of - /// values. Use 'Aligned' for virtual machines with managed disks and - /// 'Classic' for virtual machines with unmanaged disks. Default value - /// is 'Classic'. - public AvailabilitySet(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), int? platformUpdateDomainCount = default(int?), int? platformFaultDomainCount = default(int?), IList virtualMachines = default(IList), SubResource proximityPlacementGroup = default(SubResource), IList statuses = default(IList), ScheduledEventsPolicy scheduledEventsPolicy = default(ScheduledEventsPolicy), VirtualMachineScaleSetMigrationInfo virtualMachineScaleSetMigrationInfo = default(VirtualMachineScaleSetMigrationInfo), Sku sku = default(Sku)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// Sku of the availability set, only name is required to be set. See + /// AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for + /// virtual machines with managed disks and 'Classic' for virtual machines with + /// unmanaged disks. Default value is 'Classic'. + /// + + /// Update Domain count. + /// + + /// Fault Domain count. + /// + + /// A list of references to all virtual machines in the availability set. + /// + + /// Specifies information about the proximity placement group that the + /// availability set should be assigned to. Minimum api-version: 2018-04-01. + /// + + /// The resource status information. + /// + + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets + /// Scheduled Event related configurations for the availability set. + /// + + /// Describes the migration properties on the Availability Set. + /// + public AvailabilitySet(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), Sku sku = default(Sku), int? platformUpdateDomainCount = default(int?), int? platformFaultDomainCount = default(int?), System.Collections.Generic.IList virtualMachines = default(System.Collections.Generic.IList), SubResource proximityPlacementGroup = default(SubResource), System.Collections.Generic.IList statuses = default(System.Collections.Generic.IList), ScheduledEventsPolicy scheduledEventsPolicy = default(ScheduledEventsPolicy), VirtualMachineScaleSetMigrationInfo virtualMachineScaleSetMigrationInfo = default(VirtualMachineScaleSetMigrationInfo)) + + : base(location, id, name, type, tags) { - PlatformUpdateDomainCount = platformUpdateDomainCount; - PlatformFaultDomainCount = platformFaultDomainCount; - VirtualMachines = virtualMachines; - ProximityPlacementGroup = proximityPlacementGroup; - Statuses = statuses; - ScheduledEventsPolicy = scheduledEventsPolicy; - VirtualMachineScaleSetMigrationInfo = virtualMachineScaleSetMigrationInfo; - Sku = sku; + this.Sku = sku; + this.PlatformUpdateDomainCount = platformUpdateDomainCount; + this.PlatformFaultDomainCount = platformFaultDomainCount; + this.VirtualMachines = virtualMachines; + this.ProximityPlacementGroup = proximityPlacementGroup; + this.Statuses = statuses; + this.ScheduledEventsPolicy = scheduledEventsPolicy; + this.VirtualMachineScaleSetMigrationInfo = virtualMachineScaleSetMigrationInfo; CustomInit(); } @@ -87,71 +97,77 @@ public AvailabilitySet() /// partial void CustomInit(); + + /// + /// Gets or sets sku of the availability set, only name is required to be set. + /// See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for + /// virtual machines with managed disks and 'Classic' for virtual machines with + /// unmanaged disks. Default value is 'Classic'. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public Sku Sku {get; set; } + /// /// Gets or sets update Domain count. /// - [JsonProperty(PropertyName = "properties.platformUpdateDomainCount")] - public int? PlatformUpdateDomainCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.platformUpdateDomainCount")] + public int? PlatformUpdateDomainCount {get; set; } /// /// Gets or sets fault Domain count. /// - [JsonProperty(PropertyName = "properties.platformFaultDomainCount")] - public int? PlatformFaultDomainCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.platformFaultDomainCount")] + public int? PlatformFaultDomainCount {get; set; } /// /// Gets or sets a list of references to all virtual machines in the /// availability set. /// - [JsonProperty(PropertyName = "properties.virtualMachines")] - public IList VirtualMachines { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachines")] + public System.Collections.Generic.IList VirtualMachines {get; set; } /// - /// Gets or sets specifies information about the proximity placement - /// group that the availability set should be assigned to. Minimum - /// api-version: 2018-04-01. + /// Gets or sets specifies information about the proximity placement group that + /// the availability set should be assigned to. Minimum api-version: + /// 2018-04-01. /// - [JsonProperty(PropertyName = "properties.proximityPlacementGroup")] - public SubResource ProximityPlacementGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.proximityPlacementGroup")] + public SubResource ProximityPlacementGroup {get; set; } /// /// Gets the resource status information. /// - [JsonProperty(PropertyName = "properties.statuses")] - public IList Statuses { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.statuses")] + public System.Collections.Generic.IList Statuses {get; private set; } /// /// Gets or sets specifies Redeploy, Reboot and /// ScheduledEventsAdditionalPublishingTargets Scheduled Event related /// configurations for the availability set. /// - [JsonProperty(PropertyName = "properties.scheduledEventsPolicy")] - public ScheduledEventsPolicy ScheduledEventsPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scheduledEventsPolicy")] + public ScheduledEventsPolicy ScheduledEventsPolicy {get; set; } /// /// Gets describes the migration properties on the Availability Set. /// - [JsonProperty(PropertyName = "properties.virtualMachineScaleSetMigrationInfo")] - public VirtualMachineScaleSetMigrationInfo VirtualMachineScaleSetMigrationInfo { get; private set; } - - /// - /// Gets or sets sku of the availability set, only name is required to - /// be set. See AvailabilitySetSkuTypes for possible set of values. Use - /// 'Aligned' for virtual machines with managed disks and 'Classic' for - /// virtual machines with unmanaged disks. Default value is 'Classic'. - /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachineScaleSetMigrationInfo")] + public VirtualMachineScaleSetMigrationInfo VirtualMachineScaleSetMigrationInfo {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilitySetProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilitySetProperties.cs new file mode 100644 index 000000000000..615ade612c89 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilitySetProperties.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// The instance view of a resource. + /// + public partial class AvailabilitySetProperties + { + /// + /// Initializes a new instance of the AvailabilitySetProperties class. + /// + public AvailabilitySetProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AvailabilitySetProperties class. + /// + + /// Update Domain count. + /// + + /// Fault Domain count. + /// + + /// A list of references to all virtual machines in the availability set. + /// + + /// Specifies information about the proximity placement group that the + /// availability set should be assigned to. Minimum api-version: 2018-04-01. + /// + + /// The resource status information. + /// + + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets + /// Scheduled Event related configurations for the availability set. + /// + + /// Describes the migration properties on the Availability Set. + /// + public AvailabilitySetProperties(int? platformUpdateDomainCount = default(int?), int? platformFaultDomainCount = default(int?), System.Collections.Generic.IList virtualMachines = default(System.Collections.Generic.IList), SubResource proximityPlacementGroup = default(SubResource), System.Collections.Generic.IList statuses = default(System.Collections.Generic.IList), ScheduledEventsPolicy scheduledEventsPolicy = default(ScheduledEventsPolicy), VirtualMachineScaleSetMigrationInfo virtualMachineScaleSetMigrationInfo = default(VirtualMachineScaleSetMigrationInfo)) + + { + this.PlatformUpdateDomainCount = platformUpdateDomainCount; + this.PlatformFaultDomainCount = platformFaultDomainCount; + this.VirtualMachines = virtualMachines; + this.ProximityPlacementGroup = proximityPlacementGroup; + this.Statuses = statuses; + this.ScheduledEventsPolicy = scheduledEventsPolicy; + this.VirtualMachineScaleSetMigrationInfo = virtualMachineScaleSetMigrationInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets update Domain count. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "platformUpdateDomainCount")] + public int? PlatformUpdateDomainCount {get; set; } + + /// + /// Gets or sets fault Domain count. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "platformFaultDomainCount")] + public int? PlatformFaultDomainCount {get; set; } + + /// + /// Gets or sets a list of references to all virtual machines in the + /// availability set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachines")] + public System.Collections.Generic.IList VirtualMachines {get; set; } + + /// + /// Gets or sets specifies information about the proximity placement group that + /// the availability set should be assigned to. Minimum api-version: + /// 2018-04-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "proximityPlacementGroup")] + public SubResource ProximityPlacementGroup {get; set; } + + /// + /// Gets the resource status information. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "statuses")] + public System.Collections.Generic.IList Statuses {get; private set; } + + /// + /// Gets or sets specifies Redeploy, Reboot and + /// ScheduledEventsAdditionalPublishingTargets Scheduled Event related + /// configurations for the availability set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scheduledEventsPolicy")] + public ScheduledEventsPolicy ScheduledEventsPolicy {get; set; } + + /// + /// Gets describes the migration properties on the Availability Set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachineScaleSetMigrationInfo")] + public VirtualMachineScaleSetMigrationInfo VirtualMachineScaleSetMigrationInfo {get; private set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilitySetSkuTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilitySetSkuTypes.cs index 489413a557c2..4fad54085e14 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilitySetSkuTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilitySetSkuTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for AvailabilitySetSkuTypes. /// + + public static class AvailabilitySetSkuTypes { public const string Classic = "Classic"; public const string Aligned = "Aligned"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilitySetUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilitySetUpdate.cs index d3dca9b59d28..e51504298137 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilitySetUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilitySetUpdate.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Specifies information about the availability set that the virtual - /// machine should be assigned to. Only tags may be updated. + /// Specifies information about the availability set that the virtual machine + /// should be assigned to. Only tags may be updated. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class AvailabilitySetUpdate : UpdateResource { /// @@ -35,33 +25,47 @@ public AvailabilitySetUpdate() /// /// Initializes a new instance of the AvailabilitySetUpdate class. /// - /// Resource tags - /// Update Domain - /// count. - /// Fault Domain count. - /// A list of references to all virtual - /// machines in the availability set. - /// Specifies information about - /// the proximity placement group that the availability set should be - /// assigned to. Minimum api-version: 2018-04-01. - /// The resource status information. - /// Specifies Redeploy, Reboot and - /// ScheduledEventsAdditionalPublishingTargets Scheduled Event related - /// configurations for the availability set. - /// Describes the - /// migration properties on the Availability Set. - /// Sku of the availability set - public AvailabilitySetUpdate(IDictionary tags = default(IDictionary), int? platformUpdateDomainCount = default(int?), int? platformFaultDomainCount = default(int?), IList virtualMachines = default(IList), SubResource proximityPlacementGroup = default(SubResource), IList statuses = default(IList), ScheduledEventsPolicy scheduledEventsPolicy = default(ScheduledEventsPolicy), VirtualMachineScaleSetMigrationInfo virtualMachineScaleSetMigrationInfo = default(VirtualMachineScaleSetMigrationInfo), Sku sku = default(Sku)) - : base(tags) + + /// Resource tags + /// + + /// Sku of the availability set + /// + + /// Update Domain count. + /// + + /// Fault Domain count. + /// + + /// A list of references to all virtual machines in the availability set. + /// + + /// Specifies information about the proximity placement group that the + /// availability set should be assigned to. Minimum api-version: 2018-04-01. + /// + + /// The resource status information. + /// + + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets + /// Scheduled Event related configurations for the availability set. + /// + + /// Describes the migration properties on the Availability Set. + /// + public AvailabilitySetUpdate(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), Sku sku = default(Sku), int? platformUpdateDomainCount = default(int?), int? platformFaultDomainCount = default(int?), System.Collections.Generic.IList virtualMachines = default(System.Collections.Generic.IList), SubResource proximityPlacementGroup = default(SubResource), System.Collections.Generic.IList statuses = default(System.Collections.Generic.IList), ScheduledEventsPolicy scheduledEventsPolicy = default(ScheduledEventsPolicy), VirtualMachineScaleSetMigrationInfo virtualMachineScaleSetMigrationInfo = default(VirtualMachineScaleSetMigrationInfo)) + + : base(tags) { - PlatformUpdateDomainCount = platformUpdateDomainCount; - PlatformFaultDomainCount = platformFaultDomainCount; - VirtualMachines = virtualMachines; - ProximityPlacementGroup = proximityPlacementGroup; - Statuses = statuses; - ScheduledEventsPolicy = scheduledEventsPolicy; - VirtualMachineScaleSetMigrationInfo = virtualMachineScaleSetMigrationInfo; - Sku = sku; + this.Sku = sku; + this.PlatformUpdateDomainCount = platformUpdateDomainCount; + this.PlatformFaultDomainCount = platformFaultDomainCount; + this.VirtualMachines = virtualMachines; + this.ProximityPlacementGroup = proximityPlacementGroup; + this.Statuses = statuses; + this.ScheduledEventsPolicy = scheduledEventsPolicy; + this.VirtualMachineScaleSetMigrationInfo = virtualMachineScaleSetMigrationInfo; CustomInit(); } @@ -70,58 +74,58 @@ public AvailabilitySetUpdate() /// partial void CustomInit(); + + /// + /// Gets or sets sku of the availability set + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public Sku Sku {get; set; } + /// /// Gets or sets update Domain count. /// - [JsonProperty(PropertyName = "properties.platformUpdateDomainCount")] - public int? PlatformUpdateDomainCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.platformUpdateDomainCount")] + public int? PlatformUpdateDomainCount {get; set; } /// /// Gets or sets fault Domain count. /// - [JsonProperty(PropertyName = "properties.platformFaultDomainCount")] - public int? PlatformFaultDomainCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.platformFaultDomainCount")] + public int? PlatformFaultDomainCount {get; set; } /// /// Gets or sets a list of references to all virtual machines in the /// availability set. /// - [JsonProperty(PropertyName = "properties.virtualMachines")] - public IList VirtualMachines { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachines")] + public System.Collections.Generic.IList VirtualMachines {get; set; } /// - /// Gets or sets specifies information about the proximity placement - /// group that the availability set should be assigned to. Minimum - /// api-version: 2018-04-01. + /// Gets or sets specifies information about the proximity placement group that + /// the availability set should be assigned to. Minimum api-version: + /// 2018-04-01. /// - [JsonProperty(PropertyName = "properties.proximityPlacementGroup")] - public SubResource ProximityPlacementGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.proximityPlacementGroup")] + public SubResource ProximityPlacementGroup {get; set; } /// /// Gets the resource status information. /// - [JsonProperty(PropertyName = "properties.statuses")] - public IList Statuses { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.statuses")] + public System.Collections.Generic.IList Statuses {get; private set; } /// /// Gets or sets specifies Redeploy, Reboot and /// ScheduledEventsAdditionalPublishingTargets Scheduled Event related /// configurations for the availability set. /// - [JsonProperty(PropertyName = "properties.scheduledEventsPolicy")] - public ScheduledEventsPolicy ScheduledEventsPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scheduledEventsPolicy")] + public ScheduledEventsPolicy ScheduledEventsPolicy {get; set; } /// /// Gets describes the migration properties on the Availability Set. /// - [JsonProperty(PropertyName = "properties.virtualMachineScaleSetMigrationInfo")] - public VirtualMachineScaleSetMigrationInfo VirtualMachineScaleSetMigrationInfo { get; private set; } - - /// - /// Gets or sets sku of the availability set - /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachineScaleSetMigrationInfo")] + public VirtualMachineScaleSetMigrationInfo VirtualMachineScaleSetMigrationInfo {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AvailablePatchSummary.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AvailablePatchSummary.cs index 322c7909b592..e9c3b7a01d70 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AvailablePatchSummary.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AvailablePatchSummary.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Describes the properties of an virtual machine instance view for - /// available patch summary. + /// Describes the properties of an virtual machine instance view for available + /// patch summary. /// public partial class AvailablePatchSummary { @@ -30,40 +24,49 @@ public AvailablePatchSummary() /// /// Initializes a new instance of the AvailablePatchSummary class. /// - /// The overall success or failure status of the - /// operation. It remains "InProgress" until the operation completes. - /// At that point it will become "Unknown", "Failed", "Succeeded", or - /// "CompletedWithWarnings.". Possible values include: 'Unknown', - /// 'InProgress', 'Failed', 'Succeeded', - /// 'CompletedWithWarnings' - /// The activity ID of the operation - /// that produced this result. It is used to correlate across CRP and - /// extension logs. - /// The overall reboot status of the VM. It - /// will be true when partially installed patches require a reboot to - /// complete installation but the reboot has not yet occurred. - /// The number of critical - /// or security patches that have been detected as available and not - /// yet installed. - /// The number of all available patches - /// excluding critical and security. - /// The UTC timestamp when the operation - /// began. - /// The UTC timestamp when the operation - /// began. - /// The errors that were encountered during - /// execution of the operation. The details array contains the list of - /// them. + + /// The overall success or failure status of the operation. It remains + /// "InProgress" until the operation completes. At that point it will become + /// "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." + /// Possible values include: 'Unknown', 'InProgress', 'Failed', 'Succeeded', + /// 'CompletedWithWarnings' + + /// The activity ID of the operation that produced this result. It is used to + /// correlate across CRP and extension logs. + /// + + /// The overall reboot status of the VM. It will be true when partially + /// installed patches require a reboot to complete installation but the reboot + /// has not yet occurred. + /// + + /// The number of critical or security patches that have been detected as + /// available and not yet installed. + /// + + /// The number of all available patches excluding critical and security. + /// + + /// The UTC timestamp when the operation began. + /// + + /// The UTC timestamp when the operation began. + /// + + /// The errors that were encountered during execution of the operation. The + /// details array contains the list of them. + /// public AvailablePatchSummary(string status = default(string), string assessmentActivityId = default(string), bool? rebootPending = default(bool?), int? criticalAndSecurityPatchCount = default(int?), int? otherPatchCount = default(int?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), ApiError error = default(ApiError)) + { - Status = status; - AssessmentActivityId = assessmentActivityId; - RebootPending = rebootPending; - CriticalAndSecurityPatchCount = criticalAndSecurityPatchCount; - OtherPatchCount = otherPatchCount; - StartTime = startTime; - LastModifiedTime = lastModifiedTime; - Error = error; + this.Status = status; + this.AssessmentActivityId = assessmentActivityId; + this.RebootPending = rebootPending; + this.CriticalAndSecurityPatchCount = criticalAndSecurityPatchCount; + this.OtherPatchCount = otherPatchCount; + this.StartTime = startTime; + this.LastModifiedTime = lastModifiedTime; + this.Error = error; CustomInit(); } @@ -72,63 +75,60 @@ public AvailablePatchSummary() /// partial void CustomInit(); + /// - /// Gets the overall success or failure status of the operation. It - /// remains "InProgress" until the operation completes. At that point - /// it will become "Unknown", "Failed", "Succeeded", or - /// "CompletedWithWarnings.". Possible values include: 'Unknown', - /// 'InProgress', 'Failed', 'Succeeded', 'CompletedWithWarnings' + /// Gets the overall success or failure status of the operation. It remains + /// "InProgress" until the operation completes. At that point it will become + /// "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." Possible values include: 'Unknown', 'InProgress', 'Failed', 'Succeeded', 'CompletedWithWarnings' /// - [JsonProperty(PropertyName = "status")] - public string Status { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; private set; } /// - /// Gets the activity ID of the operation that produced this result. It - /// is used to correlate across CRP and extension logs. + /// Gets the activity ID of the operation that produced this result. It is used + /// to correlate across CRP and extension logs. /// - [JsonProperty(PropertyName = "assessmentActivityId")] - public string AssessmentActivityId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "assessmentActivityId")] + public string AssessmentActivityId {get; private set; } /// - /// Gets the overall reboot status of the VM. It will be true when - /// partially installed patches require a reboot to complete - /// installation but the reboot has not yet occurred. + /// Gets the overall reboot status of the VM. It will be true when partially + /// installed patches require a reboot to complete installation but the reboot + /// has not yet occurred. /// - [JsonProperty(PropertyName = "rebootPending")] - public bool? RebootPending { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "rebootPending")] + public bool? RebootPending {get; private set; } /// - /// Gets the number of critical or security patches that have been - /// detected as available and not yet installed. + /// Gets the number of critical or security patches that have been detected as + /// available and not yet installed. /// - [JsonProperty(PropertyName = "criticalAndSecurityPatchCount")] - public int? CriticalAndSecurityPatchCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "criticalAndSecurityPatchCount")] + public int? CriticalAndSecurityPatchCount {get; private set; } /// - /// Gets the number of all available patches excluding critical and - /// security. + /// Gets the number of all available patches excluding critical and security. /// - [JsonProperty(PropertyName = "otherPatchCount")] - public int? OtherPatchCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "otherPatchCount")] + public int? OtherPatchCount {get; private set; } /// /// Gets the UTC timestamp when the operation began. /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime {get; private set; } /// /// Gets the UTC timestamp when the operation began. /// - [JsonProperty(PropertyName = "lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedTime")] + public System.DateTime? LastModifiedTime {get; private set; } /// - /// Gets the errors that were encountered during execution of the - /// operation. The details array contains the list of them. + /// Gets the errors that were encountered during execution of the operation. + /// The details array contains the list of them. /// - [JsonProperty(PropertyName = "error")] - public ApiError Error { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ApiError Error {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/AzureEntityResource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/AzureEntityResource.cs index cf6fcf922afc..b1d8679826e5 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/AzureEntityResource.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/AzureEntityResource.cs @@ -1,26 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Entity Resource + /// The resource model definition for an Azure Resource Manager resource with + /// an etag. /// /// - /// The resource model definition for an Azure Resource Manager resource - /// with an etag. + /// The resource model definition for an Azure Resource Manager resource with + /// an etag. /// public partial class AzureEntityResource : ResourceOriginal { @@ -35,16 +28,29 @@ public AzureEntityResource() /// /// Initializes a new instance of the AzureEntityResource class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags. - /// Resource Etag. - public AzureEntityResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string etag = default(string)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags. + /// + + /// Resource Etag. + /// + public AzureEntityResource(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string)) + + : base(location, id, name, type, tags) { - Etag = etag; + this.Etag = etag; CustomInit(); } @@ -53,21 +59,22 @@ public AzureEntityResource() /// partial void CustomInit(); + /// /// Gets resource Etag. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/BillingProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/BillingProfile.cs index edb2595ca073..a8fc6440d4b5 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/BillingProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/BillingProfile.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Specifies the billing related details of a Azure Spot VM or VMSS. - /// Minimum api-version: 2019-03-01. + /// Specifies the billing related details of a Azure Spot VM or VMSS. Minimum + /// api-version: 2019-03-01. /// public partial class BillingProfile { @@ -30,26 +24,25 @@ public BillingProfile() /// /// Initializes a new instance of the BillingProfile class. /// - /// Specifies the maximum price you are willing - /// to pay for a Azure Spot VM/VMSS. This price is in US Dollars. - /// <br><br> This price will be compared with the current - /// Azure Spot price for the VM size. Also, the prices are compared at - /// the time of create/update of Azure Spot VM/VMSS and the operation - /// will only succeed if the maxPrice is greater than the current - /// Azure Spot price. <br><br> The maxPrice will also be - /// used for evicting a Azure Spot VM/VMSS if the current Azure Spot - /// price goes beyond the maxPrice after creation of VM/VMSS. - /// <br><br> Possible values are: <br><br> - - /// Any decimal value greater than zero. Example: 0.01538 - /// <br><br> -1 – indicates default price to be up-to - /// on-demand. <br><br> You can set the maxPrice to -1 to - /// indicate that the Azure Spot VM/VMSS should not be evicted for - /// price reasons. Also, the default max price is -1 if it is not - /// provided by you. <br><br>Minimum api-version: - /// 2019-03-01. + + /// Specifies the maximum price you are willing to pay for a Azure Spot + /// VM/VMSS. This price is in US Dollars. <br><br> This price will be compared + /// with the current Azure Spot price for the VM size. Also, the prices are + /// compared at the time of create/update of Azure Spot VM/VMSS and the + /// operation will only succeed if the maxPrice is greater than the current + /// Azure Spot price. <br><br> The maxPrice will also be used for evicting a + /// Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice + /// after creation of VM/VMSS. <br><br> Possible values are: <br><br> - Any + /// decimal value greater than zero. Example: 0.01538 <br><br> -1 – indicates + /// default price to be up-to on-demand. <br><br> You can set the maxPrice to + /// -1 to indicate that the Azure Spot VM/VMSS should not be evicted for price + /// reasons. Also, the default max price is -1 if it is not provided by you. + /// <br><br>Minimum api-version: 2019-03-01. + /// public BillingProfile(double? maxPrice = default(double?)) + { - MaxPrice = maxPrice; + this.MaxPrice = maxPrice; CustomInit(); } @@ -58,29 +51,23 @@ public BillingProfile() /// partial void CustomInit(); + /// - /// Gets or sets specifies the maximum price you are willing to pay for - /// a Azure Spot VM/VMSS. This price is in US Dollars. - /// &lt;br&gt;&lt;br&gt; This price will be compared - /// with the current Azure Spot price for the VM size. Also, the prices - /// are compared at the time of create/update of Azure Spot VM/VMSS and - /// the operation will only succeed if the maxPrice is greater than - /// the current Azure Spot price. &lt;br&gt;&lt;br&gt; - /// The maxPrice will also be used for evicting a Azure Spot VM/VMSS if - /// the current Azure Spot price goes beyond the maxPrice after - /// creation of VM/VMSS. &lt;br&gt;&lt;br&gt; Possible - /// values are: &lt;br&gt;&lt;br&gt; - Any decimal - /// value greater than zero. Example: 0.01538 - /// &lt;br&gt;&lt;br&gt; -1 – indicates default price - /// to be up-to on-demand. &lt;br&gt;&lt;br&gt; You can - /// set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS - /// should not be evicted for price reasons. Also, the default max - /// price is -1 if it is not provided by you. - /// &lt;br&gt;&lt;br&gt;Minimum api-version: - /// 2019-03-01. + /// Gets or sets specifies the maximum price you are willing to pay for a Azure + /// Spot VM/VMSS. This price is in US Dollars. <br><br> This price will be + /// compared with the current Azure Spot price for the VM size. Also, the + /// prices are compared at the time of create/update of Azure Spot VM/VMSS and + /// the operation will only succeed if the maxPrice is greater than the + /// current Azure Spot price. <br><br> The maxPrice will also be used for + /// evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond + /// the maxPrice after creation of VM/VMSS. <br><br> Possible values are: + /// <br><br> - Any decimal value greater than zero. Example: 0.01538 <br><br> + /// -1 – indicates default price to be up-to on-demand. <br><br> You can set + /// the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be + /// evicted for price reasons. Also, the default max price is -1 if it is not + /// provided by you. <br><br>Minimum api-version: 2019-03-01. /// - [JsonProperty(PropertyName = "maxPrice")] - public double? MaxPrice { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "maxPrice")] + public double? MaxPrice {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/BootDiagnostics.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/BootDiagnostics.cs index 20f7d09178a6..82332b06a77f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/BootDiagnostics.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/BootDiagnostics.cs @@ -1,23 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Boot Diagnostics is a debugging feature which allows you to view - /// Console Output and Screenshot to diagnose VM status. You can easily - /// view the output of your console log. Azure also enables you to see a - /// screenshot of the VM from the hypervisor. + /// Boot Diagnostics is a debugging feature which allows you to view Console + /// Output and Screenshot to diagnose VM status. You can easily view the output + /// of your console log. Azure also enables you to see a screenshot of the VM + /// from the hypervisor. /// public partial class BootDiagnostics { @@ -32,16 +26,19 @@ public BootDiagnostics() /// /// Initializes a new instance of the BootDiagnostics class. /// - /// Whether boot diagnostics should be enabled on - /// the Virtual Machine. - /// Uri of the storage account to use for - /// placing the console output and screenshot. If storageUri is not - /// specified while enabling boot diagnostics, managed storage will be - /// used. + + /// Whether boot diagnostics should be enabled on the Virtual Machine. + /// + + /// Uri of the storage account to use for placing the console output and + /// screenshot. If storageUri is not specified while enabling boot diagnostics, + /// managed storage will be used. + /// public BootDiagnostics(bool? enabled = default(bool?), string storageUri = default(string)) + { - Enabled = enabled; - StorageUri = storageUri; + this.Enabled = enabled; + this.StorageUri = storageUri; CustomInit(); } @@ -50,20 +47,20 @@ public BootDiagnostics() /// partial void CustomInit(); + /// - /// Gets or sets whether boot diagnostics should be enabled on the - /// Virtual Machine. + /// Gets or sets whether boot diagnostics should be enabled on the Virtual + /// Machine. /// - [JsonProperty(PropertyName = "enabled")] - public bool? Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } /// - /// Gets or sets uri of the storage account to use for placing the - /// console output and screenshot. If storageUri is not specified while - /// enabling boot diagnostics, managed storage will be used. + /// Gets or sets uri of the storage account to use for placing the console + /// output and screenshot. If storageUri is not specified while enabling boot + /// diagnostics, managed storage will be used. /// - [JsonProperty(PropertyName = "storageUri")] - public string StorageUri { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "storageUri")] + public string StorageUri {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/BootDiagnosticsInstanceView.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/BootDiagnosticsInstanceView.cs index f94dbe864dc7..a5d29420ee0a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/BootDiagnosticsInstanceView.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/BootDiagnosticsInstanceView.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class BootDiagnosticsInstanceView { /// - /// Initializes a new instance of the BootDiagnosticsInstanceView - /// class. + /// Initializes a new instance of the BootDiagnosticsInstanceView class. /// public BootDiagnosticsInstanceView() { @@ -28,23 +21,26 @@ public BootDiagnosticsInstanceView() } /// - /// Initializes a new instance of the BootDiagnosticsInstanceView - /// class. + /// Initializes a new instance of the BootDiagnosticsInstanceView class. /// - /// The console screenshot blob - /// URI. **Note:** This will **not** be set if boot diagnostics is - /// currently enabled with managed storage. - /// The serial console log blob - /// Uri. **Note:** This will **not** be set if boot diagnostics is - /// currently enabled with managed storage. - /// The boot diagnostics status information for - /// the VM. **Note:** It will be set only if there are errors - /// encountered in enabling boot diagnostics. + + /// The console screenshot blob URI. **Note:** This will **not** be set if boot + /// diagnostics is currently enabled with managed storage. + /// + + /// The serial console log blob Uri. **Note:** This will **not** be set if boot + /// diagnostics is currently enabled with managed storage. + /// + + /// The boot diagnostics status information for the VM. **Note:** It will be + /// set only if there are errors encountered in enabling boot diagnostics. + /// public BootDiagnosticsInstanceView(string consoleScreenshotBlobUri = default(string), string serialConsoleLogBlobUri = default(string), InstanceViewStatus status = default(InstanceViewStatus)) + { - ConsoleScreenshotBlobUri = consoleScreenshotBlobUri; - SerialConsoleLogBlobUri = serialConsoleLogBlobUri; - Status = status; + this.ConsoleScreenshotBlobUri = consoleScreenshotBlobUri; + this.SerialConsoleLogBlobUri = serialConsoleLogBlobUri; + this.Status = status; CustomInit(); } @@ -53,29 +49,26 @@ public BootDiagnosticsInstanceView() /// partial void CustomInit(); + /// - /// Gets the console screenshot blob URI. **Note:** This will **not** - /// be set if boot diagnostics is currently enabled with managed - /// storage. + /// Gets the console screenshot blob URI. **Note:** This will **not** be set if + /// boot diagnostics is currently enabled with managed storage. /// - [JsonProperty(PropertyName = "consoleScreenshotBlobUri")] - public string ConsoleScreenshotBlobUri { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "consoleScreenshotBlobUri")] + public string ConsoleScreenshotBlobUri {get; private set; } /// - /// Gets the serial console log blob Uri. **Note:** This will **not** - /// be set if boot diagnostics is currently enabled with managed - /// storage. + /// Gets the serial console log blob Uri. **Note:** This will **not** be set if + /// boot diagnostics is currently enabled with managed storage. /// - [JsonProperty(PropertyName = "serialConsoleLogBlobUri")] - public string SerialConsoleLogBlobUri { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "serialConsoleLogBlobUri")] + public string SerialConsoleLogBlobUri {get; private set; } /// - /// Gets the boot diagnostics status information for the VM. **Note:** - /// It will be set only if there are errors encountered in enabling - /// boot diagnostics. + /// Gets the boot diagnostics status information for the VM. **Note:** It will + /// be set only if there are errors encountered in enabling boot diagnostics. /// - [JsonProperty(PropertyName = "status")] - public InstanceViewStatus Status { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public InstanceViewStatus Status {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CachingTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CachingTypes.cs index c902e8e5286a..e5791d73a621 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CachingTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CachingTypes.cs @@ -1,31 +1,24 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for CachingTypes. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum CachingTypes { - [EnumMember(Value = "None")] + [System.Runtime.Serialization.EnumMember(Value = "None")] None, - [EnumMember(Value = "ReadOnly")] + [System.Runtime.Serialization.EnumMember(Value = "ReadOnly")] ReadOnly, - [EnumMember(Value = "ReadWrite")] + [System.Runtime.Serialization.EnumMember(Value = "ReadWrite")] ReadWrite } internal static class CachingTypesEnumExtension @@ -34,7 +27,6 @@ internal static string ToSerializedValue(this CachingTypes? value) { return value == null ? null : ((CachingTypes)value).ToSerializedValue(); } - internal static string ToSerializedValue(this CachingTypes value) { switch( value ) @@ -48,7 +40,6 @@ internal static string ToSerializedValue(this CachingTypes value) } return null; } - internal static CachingTypes? ParseCachingTypes(this string value) { switch( value ) @@ -63,4 +54,4 @@ internal static string ToSerializedValue(this CachingTypes value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservation.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservation.cs index d3bbcb85cc6a..c696473d6440 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservation.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservation.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specifies information about the capacity reservation. /// - [Rest.Serialization.JsonTransformation] - public partial class CapacityReservation : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class CapacityReservation : TrackedResource { /// /// Initializes a new instance of the CapacityReservation class. @@ -34,65 +24,87 @@ public CapacityReservation() /// /// Initializes a new instance of the CapacityReservation class. /// - /// Resource location - /// SKU of the resource for which capacity needs be - /// reserved. The SKU name and capacity is required to be set. For - /// Block capacity reservations, sku.capacity can only accept values 1, - /// 2, 4, 8, 16, 32, 64. Currently VM Skus with the capability called - /// 'CapacityReservationSupported' set to true are supported. When - /// 'CapacityReservationSupported' is true, the SKU capability also - /// specifies the 'SupportedCapacityReservationTypes', which lists the - /// types of capacity reservations (such as Targeted or Block) that the - /// SKU supports. Refer to List Microsoft.Compute SKUs in a region + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// SKU of the resource for which capacity needs be reserved. The SKU name and + /// capacity is required to be set. For Block capacity reservations, + /// sku.capacity can only accept values 1, 2, 4, 8, 16, 32, 64. Currently VM + /// Skus with the capability called 'CapacityReservationSupported' set to true + /// are supported. When 'CapacityReservationSupported' is true, the SKU + /// capability also specifies the 'SupportedCapacityReservationTypes', which + /// lists the types of capacity reservations (such as Targeted or Block) that + /// the SKU supports. Refer to List Microsoft.Compute SKUs in a region /// (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for - /// supported values. - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// A unique id generated and assigned to - /// the capacity reservation by the platform which does not change - /// throughout the lifetime of the resource. - /// Specifies the value of fault - /// domain count that Capacity Reservation supports for requested VM - /// size. **Note:** The fault domain count specified for a resource - /// (like virtual machines scale set) must be less than or equal to - /// this value if it deploys using capacity reservation. Minimum - /// api-version: 2022-08-01. - /// A list of all virtual - /// machine resource ids that are associated with the capacity - /// reservation. - /// The date time when the capacity - /// reservation was last updated. - /// The provisioning state, which only - /// appears in the response. - /// The Capacity reservation instance - /// view. - /// Specifies the time at which the Capacity - /// Reservation resource was created. Minimum api-version: - /// 2021-11-01. - /// Defines the schedule for Block-type - /// capacity reservations. Specifies the schedule during which capacity - /// reservation is active and VM or VMSS resource can be allocated - /// using reservation. This property is required and only supported - /// when the capacity reservation group type is 'Block'. The - /// scheduleProfile, start, and end fields are immutable after - /// creation. Minimum API version: 2025-04-01. Please refer to - /// https://aka.ms/blockcapacityreservation for more details. - /// The availability zones. - public CapacityReservation(string location, Sku sku, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string reservationId = default(string), int? platformFaultDomainCount = default(int?), IList virtualMachinesAssociated = default(IList), System.DateTime? provisioningTime = default(System.DateTime?), string provisioningState = default(string), CapacityReservationInstanceView instanceView = default(CapacityReservationInstanceView), System.DateTime? timeCreated = default(System.DateTime?), ScheduleProfile scheduleProfile = default(ScheduleProfile), IList zones = default(IList)) - : base(location, id, name, type, tags) + /// supported values. + /// + + /// The availability zones. + /// + + /// Defines the schedule for Block-type capacity reservations. Specifies the + /// schedule during which capacity reservation is active and VM or VMSS + /// resource can be allocated using reservation. This property is required and + /// only supported when the capacity reservation group type is 'Block'. The + /// scheduleProfile, start, and end fields are immutable after creation. + /// Minimum API version: 2025-04-01. Please refer to + /// https://aka.ms/blockcapacityreservation for more details. + /// + + /// A unique id generated and assigned to the capacity reservation by the + /// platform which does not change throughout the lifetime of the resource. + /// + + /// Specifies the value of fault domain count that Capacity Reservation + /// supports for requested VM size. **Note:** The fault domain count specified + /// for a resource (like virtual machines scale set) must be less than or equal + /// to this value if it deploys using capacity reservation. Minimum + /// api-version: 2022-08-01. + /// + + /// A list of all virtual machine resource ids that are associated with the + /// capacity reservation. + /// + + /// The date time when the capacity reservation was last updated. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// The Capacity reservation instance view. + /// + + /// Specifies the time at which the Capacity Reservation resource was created. + /// Minimum api-version: 2021-11-01. + /// + public CapacityReservation(string location, Sku sku, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), ScheduleProfile scheduleProfile = default(ScheduleProfile), string reservationId = default(string), int? platformFaultDomainCount = default(int?), System.Collections.Generic.IList virtualMachinesAssociated = default(System.Collections.Generic.IList), System.DateTime? provisioningTime = default(System.DateTime?), string provisioningState = default(string), CapacityReservationInstanceView instanceView = default(CapacityReservationInstanceView), System.DateTime? timeCreated = default(System.DateTime?)) + + : base(location, id, name, type, tags) { - ReservationId = reservationId; - PlatformFaultDomainCount = platformFaultDomainCount; - VirtualMachinesAssociated = virtualMachinesAssociated; - ProvisioningTime = provisioningTime; - ProvisioningState = provisioningState; - InstanceView = instanceView; - TimeCreated = timeCreated; - ScheduleProfile = scheduleProfile; - Sku = sku; - Zones = zones; + this.Sku = sku; + this.Zones = zones; + this.ScheduleProfile = scheduleProfile; + this.ReservationId = reservationId; + this.PlatformFaultDomainCount = platformFaultDomainCount; + this.VirtualMachinesAssociated = virtualMachinesAssociated; + this.ProvisioningTime = provisioningTime; + this.ProvisioningState = provisioningState; + this.InstanceView = instanceView; + this.TimeCreated = timeCreated; CustomInit(); } @@ -101,104 +113,108 @@ public CapacityReservation() /// partial void CustomInit(); + /// - /// Gets a unique id generated and assigned to the capacity reservation - /// by the platform which does not change throughout the lifetime of - /// the resource. + /// Gets or sets sKU of the resource for which capacity needs be reserved. The + /// SKU name and capacity is required to be set. For Block capacity + /// reservations, sku.capacity can only accept values 1, 2, 4, 8, 16, 32, 64. + /// Currently VM Skus with the capability called 'CapacityReservationSupported' + /// set to true are supported. When 'CapacityReservationSupported' is true, the + /// SKU capability also specifies the 'SupportedCapacityReservationTypes', + /// which lists the types of capacity reservations (such as Targeted or Block) + /// that the SKU supports. Refer to List Microsoft.Compute SKUs in a region + /// (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for + /// supported values. /// - [JsonProperty(PropertyName = "properties.reservationId")] - public string ReservationId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public Sku Sku {get; set; } /// - /// Gets specifies the value of fault domain count that Capacity - /// Reservation supports for requested VM size. **Note:** The fault - /// domain count specified for a resource (like virtual machines scale - /// set) must be less than or equal to this value if it deploys using - /// capacity reservation. Minimum api-version: 2022-08-01. + /// Gets or sets the availability zones. /// - [JsonProperty(PropertyName = "properties.platformFaultDomainCount")] - public int? PlatformFaultDomainCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } /// - /// Gets a list of all virtual machine resource ids that are associated - /// with the capacity reservation. + /// Gets or sets defines the schedule for Block-type capacity reservations. + /// Specifies the schedule during which capacity reservation is active and VM + /// or VMSS resource can be allocated using reservation. This property is + /// required and only supported when the capacity reservation group type is + /// 'Block'. The scheduleProfile, start, and end fields are immutable after + /// creation. Minimum API version: 2025-04-01. Please refer to + /// https://aka.ms/blockcapacityreservation for more details. /// - [JsonProperty(PropertyName = "properties.virtualMachinesAssociated")] - public IList VirtualMachinesAssociated { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scheduleProfile")] + public ScheduleProfile ScheduleProfile {get; set; } /// - /// Gets the date time when the capacity reservation was last updated. + /// Gets a unique id generated and assigned to the capacity reservation by the + /// platform which does not change throughout the lifetime of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningTime")] - public System.DateTime? ProvisioningTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.reservationId")] + public string ReservationId {get; private set; } /// - /// Gets the provisioning state, which only appears in the response. + /// Gets specifies the value of fault domain count that Capacity Reservation + /// supports for requested VM size. **Note:** The fault domain count specified + /// for a resource (like virtual machines scale set) must be less than or equal + /// to this value if it deploys using capacity reservation. Minimum + /// api-version: 2022-08-01. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.platformFaultDomainCount")] + public int? PlatformFaultDomainCount {get; private set; } /// - /// Gets the Capacity reservation instance view. + /// Gets a list of all virtual machine resource ids that are associated with + /// the capacity reservation. /// - [JsonProperty(PropertyName = "properties.instanceView")] - public CapacityReservationInstanceView InstanceView { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachinesAssociated")] + public System.Collections.Generic.IList VirtualMachinesAssociated {get; private set; } /// - /// Gets specifies the time at which the Capacity Reservation resource - /// was created. Minimum api-version: 2021-11-01. + /// Gets the date time when the capacity reservation was last updated. /// - [JsonProperty(PropertyName = "properties.timeCreated")] - public System.DateTime? TimeCreated { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningTime")] + public System.DateTime? ProvisioningTime {get; private set; } /// - /// Gets or sets defines the schedule for Block-type capacity - /// reservations. Specifies the schedule during which capacity - /// reservation is active and VM or VMSS resource can be allocated - /// using reservation. This property is required and only supported - /// when the capacity reservation group type is 'Block'. The - /// scheduleProfile, start, and end fields are immutable after - /// creation. Minimum API version: 2025-04-01. Please refer to - /// https://aka.ms/blockcapacityreservation for more details. + /// Gets the provisioning state, which only appears in the response. /// - [JsonProperty(PropertyName = "properties.scheduleProfile")] - public ScheduleProfile ScheduleProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets SKU of the resource for which capacity needs be - /// reserved. The SKU name and capacity is required to be set. For - /// Block capacity reservations, sku.capacity can only accept values 1, - /// 2, 4, 8, 16, 32, 64. Currently VM Skus with the capability called - /// 'CapacityReservationSupported' set to true are supported. When - /// 'CapacityReservationSupported' is true, the SKU capability also - /// specifies the 'SupportedCapacityReservationTypes', which lists the - /// types of capacity reservations (such as Targeted or Block) that the - /// SKU supports. Refer to List Microsoft.Compute SKUs in a region - /// (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for - /// supported values. + /// Gets the Capacity reservation instance view. /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.instanceView")] + public CapacityReservationInstanceView InstanceView {get; private set; } /// - /// Gets or sets the availability zones. + /// Gets specifies the time at which the Capacity Reservation resource was + /// created. Minimum api-version: 2021-11-01. /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeCreated")] + public System.DateTime? TimeCreated {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (Sku == null) + if (this.Sku == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Sku"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Sku"); } + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroup.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroup.cs index f7ff9f1e9564..cc7305200b07 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroup.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroup.cs @@ -1,31 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specifies information about the capacity reservation group that the /// capacity reservations should be assigned to. Currently, a capacity - /// reservation can only be added to a capacity reservation group at - /// creation time. An existing capacity reservation cannot be added or - /// moved to another capacity reservation group. + /// reservation can only be added to a capacity reservation group at creation + /// time. An existing capacity reservation cannot be added or moved to another + /// capacity reservation group. /// - [Rest.Serialization.JsonTransformation] - public partial class CapacityReservationGroup : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class CapacityReservationGroup : TrackedResource { /// /// Initializes a new instance of the CapacityReservationGroup class. @@ -38,46 +28,64 @@ public CapacityReservationGroup() /// /// Initializes a new instance of the CapacityReservationGroup class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// A list of all capacity - /// reservation resource ids that belong to capacity reservation - /// group. - /// A list of references to all - /// virtual machines associated to the capacity reservation - /// group. - /// The capacity reservation group instance - /// view which has the list of instance views for all the capacity - /// reservations that belong to the capacity reservation group. - /// Specifies the settings to enable - /// sharing across subscriptions for the capacity reservation group - /// resource. The capacity reservation group resource can generally be - /// shared across subscriptions belonging to a single Azure AAD tenant - /// or across AAD tenants if there is a trust relationship established - /// between the tenants. Block capacity reservation does not support - /// sharing across subscriptions. **Note:** Minimum api-version: - /// 2023-09-01. Please refer to - /// https://aka.ms/computereservationsharing for more details. - /// Indicates the type of capacity - /// reservation. Allowed values are 'Block' for block capacity - /// reservations and 'Targeted' for reservations that enable a VM to - /// consume a specific capacity reservation when a capacity reservation - /// group is provided. The reservation type is immutable and cannot be - /// changed after it is assigned. Possible values include: 'Targeted', - /// 'Block' - /// The availability zones. - public CapacityReservationGroup(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IList capacityReservations = default(IList), IList virtualMachinesAssociated = default(IList), CapacityReservationGroupInstanceView instanceView = default(CapacityReservationGroupInstanceView), ResourceSharingProfile sharingProfile = default(ResourceSharingProfile), string reservationType = default(string), IList zones = default(IList)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// The availability zones. + /// + + /// Indicates the type of capacity reservation. Allowed values are 'Block' for + /// block capacity reservations and 'Targeted' for reservations that enable a + /// VM to consume a specific capacity reservation when a capacity reservation + /// group is provided. The reservation type is immutable and cannot be changed + /// after it is assigned. + /// Possible values include: 'Targeted', 'Block' + + /// A list of all capacity reservation resource ids that belong to capacity + /// reservation group. + /// + + /// A list of references to all virtual machines associated to the capacity + /// reservation group. + /// + + /// The capacity reservation group instance view which has the list of instance + /// views for all the capacity reservations that belong to the capacity + /// reservation group. + /// + + /// Specifies the settings to enable sharing across subscriptions for the + /// capacity reservation group resource. The capacity reservation group + /// resource can generally be shared across subscriptions belonging to a single + /// Azure AAD tenant or across AAD tenants if there is a trust relationship + /// established between the tenants. Block capacity reservation does not + /// support sharing across subscriptions. **Note:** Minimum api-version: + /// 2023-09-01. Please refer to https://aka.ms/computereservationsharing for + /// more details. + /// + public CapacityReservationGroup(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), string reservationType = default(string), System.Collections.Generic.IList capacityReservations = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualMachinesAssociated = default(System.Collections.Generic.IList), CapacityReservationGroupInstanceView instanceView = default(CapacityReservationGroupInstanceView), ResourceSharingProfile sharingProfile = default(ResourceSharingProfile)) + + : base(location, id, name, type, tags) { - CapacityReservations = capacityReservations; - VirtualMachinesAssociated = virtualMachinesAssociated; - InstanceView = instanceView; - SharingProfile = sharingProfile; - ReservationType = reservationType; - Zones = zones; + this.Zones = zones; + this.ReservationType = reservationType; + this.CapacityReservations = capacityReservations; + this.VirtualMachinesAssociated = virtualMachinesAssociated; + this.InstanceView = instanceView; + this.SharingProfile = sharingProfile; CustomInit(); } @@ -86,68 +94,72 @@ public CapacityReservationGroup() /// partial void CustomInit(); + /// - /// Gets a list of all capacity reservation resource ids that belong to - /// capacity reservation group. + /// Gets or sets the availability zones. /// - [JsonProperty(PropertyName = "properties.capacityReservations")] - public IList CapacityReservations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } /// - /// Gets a list of references to all virtual machines associated to the - /// capacity reservation group. + /// Gets or sets indicates the type of capacity reservation. Allowed values are + /// 'Block' for block capacity reservations and 'Targeted' for reservations + /// that enable a VM to consume a specific capacity reservation when a capacity + /// reservation group is provided. The reservation type is immutable and cannot + /// be changed after it is assigned. Possible values include: 'Targeted', 'Block' /// - [JsonProperty(PropertyName = "properties.virtualMachinesAssociated")] - public IList VirtualMachinesAssociated { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.reservationType")] + public string ReservationType {get; set; } /// - /// Gets the capacity reservation group instance view which has the - /// list of instance views for all the capacity reservations that - /// belong to the capacity reservation group. + /// Gets a list of all capacity reservation resource ids that belong to + /// capacity reservation group. /// - [JsonProperty(PropertyName = "properties.instanceView")] - public CapacityReservationGroupInstanceView InstanceView { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.capacityReservations")] + public System.Collections.Generic.IList CapacityReservations {get; private set; } /// - /// Gets or sets specifies the settings to enable sharing across - /// subscriptions for the capacity reservation group resource. The - /// capacity reservation group resource can generally be shared across - /// subscriptions belonging to a single Azure AAD tenant or across AAD - /// tenants if there is a trust relationship established between the - /// tenants. Block capacity reservation does not support sharing - /// across subscriptions. **Note:** Minimum api-version: 2023-09-01. - /// Please refer to https://aka.ms/computereservationsharing for more - /// details. + /// Gets a list of references to all virtual machines associated to the + /// capacity reservation group. /// - [JsonProperty(PropertyName = "properties.sharingProfile")] - public ResourceSharingProfile SharingProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachinesAssociated")] + public System.Collections.Generic.IList VirtualMachinesAssociated {get; private set; } /// - /// Gets or sets indicates the type of capacity reservation. Allowed - /// values are 'Block' for block capacity reservations and 'Targeted' - /// for reservations that enable a VM to consume a specific capacity - /// reservation when a capacity reservation group is provided. The - /// reservation type is immutable and cannot be changed after it is - /// assigned. Possible values include: 'Targeted', 'Block' + /// Gets the capacity reservation group instance view which has the list of + /// instance views for all the capacity reservations that belong to the + /// capacity reservation group. /// - [JsonProperty(PropertyName = "properties.reservationType")] - public string ReservationType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.instanceView")] + public CapacityReservationGroupInstanceView InstanceView {get; private set; } /// - /// Gets or sets the availability zones. + /// Gets or sets specifies the settings to enable sharing across subscriptions + /// for the capacity reservation group resource. The capacity reservation group + /// resource can generally be shared across subscriptions belonging to a single + /// Azure AAD tenant or across AAD tenants if there is a trust relationship + /// established between the tenants. Block capacity reservation does not + /// support sharing across subscriptions. **Note:** Minimum api-version: + /// 2023-09-01. Please refer to https://aka.ms/computereservationsharing for + /// more details. /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sharingProfile")] + public ResourceSharingProfile SharingProfile {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroupInstanceView.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroupInstanceView.cs index a0b71526abbb..5ed101fb9624 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroupInstanceView.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroupInstanceView.cs @@ -1,25 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; public partial class CapacityReservationGroupInstanceView { /// - /// Initializes a new instance of the - /// CapacityReservationGroupInstanceView class. + /// Initializes a new instance of the CapacityReservationGroupInstanceView class. /// public CapacityReservationGroupInstanceView() { @@ -27,19 +18,22 @@ public CapacityReservationGroupInstanceView() } /// - /// Initializes a new instance of the - /// CapacityReservationGroupInstanceView class. + /// Initializes a new instance of the CapacityReservationGroupInstanceView class. /// - /// List of instance view of the - /// capacity reservations under the capacity reservation group. - /// List of the subscriptions that - /// the capacity reservation group is shared with. **Note:** Minimum - /// api-version: 2023-09-01. Please refer to - /// https://aka.ms/computereservationsharing for more details. - public CapacityReservationGroupInstanceView(IList capacityReservations = default(IList), IList sharedSubscriptionIds = default(IList)) + + /// List of instance view of the capacity reservations under the capacity + /// reservation group. + /// + + /// List of the subscriptions that the capacity reservation group is shared + /// with. **Note:** Minimum api-version: 2023-09-01. Please refer to + /// https://aka.ms/computereservationsharing for more details. + /// + public CapacityReservationGroupInstanceView(System.Collections.Generic.IList capacityReservations = default(System.Collections.Generic.IList), System.Collections.Generic.IList sharedSubscriptionIds = default(System.Collections.Generic.IList)) + { - CapacityReservations = capacityReservations; - SharedSubscriptionIds = sharedSubscriptionIds; + this.CapacityReservations = capacityReservations; + this.SharedSubscriptionIds = sharedSubscriptionIds; CustomInit(); } @@ -48,20 +42,20 @@ public CapacityReservationGroupInstanceView() /// partial void CustomInit(); + /// - /// Gets list of instance view of the capacity reservations under the - /// capacity reservation group. + /// Gets list of instance view of the capacity reservations under the capacity + /// reservation group. /// - [JsonProperty(PropertyName = "capacityReservations")] - public IList CapacityReservations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "capacityReservations")] + public System.Collections.Generic.IList CapacityReservations {get; private set; } /// - /// Gets list of the subscriptions that the capacity reservation group - /// is shared with. **Note:** Minimum api-version: 2023-09-01. Please - /// refer to https://aka.ms/computereservationsharing for more details. + /// Gets list of the subscriptions that the capacity reservation group is + /// shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to + /// https://aka.ms/computereservationsharing for more details. /// - [JsonProperty(PropertyName = "sharedSubscriptionIds")] - public IList SharedSubscriptionIds { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sharedSubscriptionIds")] + public System.Collections.Generic.IList SharedSubscriptionIds {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroupInstanceViewTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroupInstanceViewTypes.cs index 9f03856bad53..21b1b4605d32 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroupInstanceViewTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroupInstanceViewTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for CapacityReservationGroupInstanceViewTypes. /// + + public static class CapacityReservationGroupInstanceViewTypes { public const string InstanceView = "instanceView"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroupProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroupProperties.cs new file mode 100644 index 000000000000..eebe8ec1576f --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroupProperties.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// capacity reservation group Properties. + /// + public partial class CapacityReservationGroupProperties + { + /// + /// Initializes a new instance of the CapacityReservationGroupProperties class. + /// + public CapacityReservationGroupProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CapacityReservationGroupProperties class. + /// + + /// A list of all capacity reservation resource ids that belong to capacity + /// reservation group. + /// + + /// A list of references to all virtual machines associated to the capacity + /// reservation group. + /// + + /// The capacity reservation group instance view which has the list of instance + /// views for all the capacity reservations that belong to the capacity + /// reservation group. + /// + + /// Specifies the settings to enable sharing across subscriptions for the + /// capacity reservation group resource. The capacity reservation group + /// resource can generally be shared across subscriptions belonging to a single + /// Azure AAD tenant or across AAD tenants if there is a trust relationship + /// established between the tenants. Block capacity reservation does not + /// support sharing across subscriptions. **Note:** Minimum api-version: + /// 2023-09-01. Please refer to https://aka.ms/computereservationsharing for + /// more details. + /// + + /// Indicates the type of capacity reservation. Allowed values are 'Block' for + /// block capacity reservations and 'Targeted' for reservations that enable a + /// VM to consume a specific capacity reservation when a capacity reservation + /// group is provided. The reservation type is immutable and cannot be changed + /// after it is assigned. + /// Possible values include: 'Targeted', 'Block' + public CapacityReservationGroupProperties(System.Collections.Generic.IList capacityReservations = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualMachinesAssociated = default(System.Collections.Generic.IList), CapacityReservationGroupInstanceView instanceView = default(CapacityReservationGroupInstanceView), ResourceSharingProfile sharingProfile = default(ResourceSharingProfile), string reservationType = default(string)) + + { + this.CapacityReservations = capacityReservations; + this.VirtualMachinesAssociated = virtualMachinesAssociated; + this.InstanceView = instanceView; + this.SharingProfile = sharingProfile; + this.ReservationType = reservationType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets a list of all capacity reservation resource ids that belong to + /// capacity reservation group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "capacityReservations")] + public System.Collections.Generic.IList CapacityReservations {get; private set; } + + /// + /// Gets a list of references to all virtual machines associated to the + /// capacity reservation group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachinesAssociated")] + public System.Collections.Generic.IList VirtualMachinesAssociated {get; private set; } + + /// + /// Gets the capacity reservation group instance view which has the list of + /// instance views for all the capacity reservations that belong to the + /// capacity reservation group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "instanceView")] + public CapacityReservationGroupInstanceView InstanceView {get; private set; } + + /// + /// Gets or sets specifies the settings to enable sharing across subscriptions + /// for the capacity reservation group resource. The capacity reservation group + /// resource can generally be shared across subscriptions belonging to a single + /// Azure AAD tenant or across AAD tenants if there is a trust relationship + /// established between the tenants. Block capacity reservation does not + /// support sharing across subscriptions. **Note:** Minimum api-version: + /// 2023-09-01. Please refer to https://aka.ms/computereservationsharing for + /// more details. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sharingProfile")] + public ResourceSharingProfile SharingProfile {get; set; } + + /// + /// Gets or sets indicates the type of capacity reservation. Allowed values are + /// 'Block' for block capacity reservations and 'Targeted' for reservations + /// that enable a VM to consume a specific capacity reservation when a capacity + /// reservation group is provided. The reservation type is immutable and cannot + /// be changed after it is assigned. Possible values include: 'Targeted', 'Block' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "reservationType")] + public string ReservationType {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroupUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroupUpdate.cs index aee90874f15a..6baaf9652235 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroupUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationGroupUpdate.cs @@ -1,32 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Specifies information about the capacity reservation group. Only tags - /// can be updated. + /// Specifies information about the capacity reservation group. Only tags can + /// be updated. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class CapacityReservationGroupUpdate : UpdateResource { /// - /// Initializes a new instance of the CapacityReservationGroupUpdate - /// class. + /// Initializes a new instance of the CapacityReservationGroupUpdate class. /// public CapacityReservationGroupUpdate() { @@ -34,43 +23,50 @@ public CapacityReservationGroupUpdate() } /// - /// Initializes a new instance of the CapacityReservationGroupUpdate - /// class. + /// Initializes a new instance of the CapacityReservationGroupUpdate class. /// - /// Resource tags - /// A list of all capacity - /// reservation resource ids that belong to capacity reservation - /// group. - /// A list of references to all - /// virtual machines associated to the capacity reservation - /// group. - /// The capacity reservation group instance - /// view which has the list of instance views for all the capacity - /// reservations that belong to the capacity reservation group. - /// Specifies the settings to enable - /// sharing across subscriptions for the capacity reservation group - /// resource. The capacity reservation group resource can generally be - /// shared across subscriptions belonging to a single Azure AAD tenant - /// or across AAD tenants if there is a trust relationship established - /// between the tenants. Block capacity reservation does not support - /// sharing across subscriptions. **Note:** Minimum api-version: - /// 2023-09-01. Please refer to - /// https://aka.ms/computereservationsharing for more details. - /// Indicates the type of capacity - /// reservation. Allowed values are 'Block' for block capacity - /// reservations and 'Targeted' for reservations that enable a VM to - /// consume a specific capacity reservation when a capacity reservation - /// group is provided. The reservation type is immutable and cannot be - /// changed after it is assigned. Possible values include: 'Targeted', - /// 'Block' - public CapacityReservationGroupUpdate(IDictionary tags = default(IDictionary), IList capacityReservations = default(IList), IList virtualMachinesAssociated = default(IList), CapacityReservationGroupInstanceView instanceView = default(CapacityReservationGroupInstanceView), ResourceSharingProfile sharingProfile = default(ResourceSharingProfile), string reservationType = default(string)) - : base(tags) + + /// Resource tags + /// + + /// Indicates the type of capacity reservation. Allowed values are 'Block' for + /// block capacity reservations and 'Targeted' for reservations that enable a + /// VM to consume a specific capacity reservation when a capacity reservation + /// group is provided. The reservation type is immutable and cannot be changed + /// after it is assigned. + /// Possible values include: 'Targeted', 'Block' + + /// A list of all capacity reservation resource ids that belong to capacity + /// reservation group. + /// + + /// A list of references to all virtual machines associated to the capacity + /// reservation group. + /// + + /// The capacity reservation group instance view which has the list of instance + /// views for all the capacity reservations that belong to the capacity + /// reservation group. + /// + + /// Specifies the settings to enable sharing across subscriptions for the + /// capacity reservation group resource. The capacity reservation group + /// resource can generally be shared across subscriptions belonging to a single + /// Azure AAD tenant or across AAD tenants if there is a trust relationship + /// established between the tenants. Block capacity reservation does not + /// support sharing across subscriptions. **Note:** Minimum api-version: + /// 2023-09-01. Please refer to https://aka.ms/computereservationsharing for + /// more details. + /// + public CapacityReservationGroupUpdate(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string reservationType = default(string), System.Collections.Generic.IList capacityReservations = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualMachinesAssociated = default(System.Collections.Generic.IList), CapacityReservationGroupInstanceView instanceView = default(CapacityReservationGroupInstanceView), ResourceSharingProfile sharingProfile = default(ResourceSharingProfile)) + + : base(tags) { - CapacityReservations = capacityReservations; - VirtualMachinesAssociated = virtualMachinesAssociated; - InstanceView = instanceView; - SharingProfile = sharingProfile; - ReservationType = reservationType; + this.ReservationType = reservationType; + this.CapacityReservations = capacityReservations; + this.VirtualMachinesAssociated = virtualMachinesAssociated; + this.InstanceView = instanceView; + this.SharingProfile = sharingProfile; CustomInit(); } @@ -79,52 +75,50 @@ public CapacityReservationGroupUpdate() /// partial void CustomInit(); + /// - /// Gets a list of all capacity reservation resource ids that belong to - /// capacity reservation group. + /// Gets or sets indicates the type of capacity reservation. Allowed values are + /// 'Block' for block capacity reservations and 'Targeted' for reservations + /// that enable a VM to consume a specific capacity reservation when a capacity + /// reservation group is provided. The reservation type is immutable and cannot + /// be changed after it is assigned. Possible values include: 'Targeted', 'Block' /// - [JsonProperty(PropertyName = "properties.capacityReservations")] - public IList CapacityReservations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.reservationType")] + public string ReservationType {get; set; } /// - /// Gets a list of references to all virtual machines associated to the + /// Gets a list of all capacity reservation resource ids that belong to /// capacity reservation group. /// - [JsonProperty(PropertyName = "properties.virtualMachinesAssociated")] - public IList VirtualMachinesAssociated { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.capacityReservations")] + public System.Collections.Generic.IList CapacityReservations {get; private set; } /// - /// Gets the capacity reservation group instance view which has the - /// list of instance views for all the capacity reservations that - /// belong to the capacity reservation group. + /// Gets a list of references to all virtual machines associated to the + /// capacity reservation group. /// - [JsonProperty(PropertyName = "properties.instanceView")] - public CapacityReservationGroupInstanceView InstanceView { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachinesAssociated")] + public System.Collections.Generic.IList VirtualMachinesAssociated {get; private set; } /// - /// Gets or sets specifies the settings to enable sharing across - /// subscriptions for the capacity reservation group resource. The - /// capacity reservation group resource can generally be shared across - /// subscriptions belonging to a single Azure AAD tenant or across AAD - /// tenants if there is a trust relationship established between the - /// tenants. Block capacity reservation does not support sharing - /// across subscriptions. **Note:** Minimum api-version: 2023-09-01. - /// Please refer to https://aka.ms/computereservationsharing for more - /// details. + /// Gets the capacity reservation group instance view which has the list of + /// instance views for all the capacity reservations that belong to the + /// capacity reservation group. /// - [JsonProperty(PropertyName = "properties.sharingProfile")] - public ResourceSharingProfile SharingProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.instanceView")] + public CapacityReservationGroupInstanceView InstanceView {get; private set; } /// - /// Gets or sets indicates the type of capacity reservation. Allowed - /// values are 'Block' for block capacity reservations and 'Targeted' - /// for reservations that enable a VM to consume a specific capacity - /// reservation when a capacity reservation group is provided. The - /// reservation type is immutable and cannot be changed after it is - /// assigned. Possible values include: 'Targeted', 'Block' + /// Gets or sets specifies the settings to enable sharing across subscriptions + /// for the capacity reservation group resource. The capacity reservation group + /// resource can generally be shared across subscriptions belonging to a single + /// Azure AAD tenant or across AAD tenants if there is a trust relationship + /// established between the tenants. Block capacity reservation does not + /// support sharing across subscriptions. **Note:** Minimum api-version: + /// 2023-09-01. Please refer to https://aka.ms/computereservationsharing for + /// more details. /// - [JsonProperty(PropertyName = "properties.reservationType")] - public string ReservationType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sharingProfile")] + public ResourceSharingProfile SharingProfile {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationInstanceView.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationInstanceView.cs index 842469c5e675..b7adc685d3c4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationInstanceView.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationInstanceView.cs @@ -1,30 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// The instance view of a capacity reservation that provides as snapshot - /// of the runtime properties of the capacity reservation that is managed - /// by the platform and can change outside of control plane operations. + /// The instance view of a capacity reservation that provides as snapshot of + /// the runtime properties of the capacity reservation that is managed by the + /// platform and can change outside of control plane operations. /// public partial class CapacityReservationInstanceView { /// - /// Initializes a new instance of the CapacityReservationInstanceView - /// class. + /// Initializes a new instance of the CapacityReservationInstanceView class. /// public CapacityReservationInstanceView() { @@ -32,16 +23,19 @@ public CapacityReservationInstanceView() } /// - /// Initializes a new instance of the CapacityReservationInstanceView - /// class. + /// Initializes a new instance of the CapacityReservationInstanceView class. /// - /// Unutilized capacity of the capacity - /// reservation. - /// The resource status information. - public CapacityReservationInstanceView(CapacityReservationUtilization utilizationInfo = default(CapacityReservationUtilization), IList statuses = default(IList)) + + /// Unutilized capacity of the capacity reservation. + /// + + /// The resource status information. + /// + public CapacityReservationInstanceView(CapacityReservationUtilization utilizationInfo = default(CapacityReservationUtilization), System.Collections.Generic.IList statuses = default(System.Collections.Generic.IList)) + { - UtilizationInfo = utilizationInfo; - Statuses = statuses; + this.UtilizationInfo = utilizationInfo; + this.Statuses = statuses; CustomInit(); } @@ -50,17 +44,17 @@ public CapacityReservationInstanceView() /// partial void CustomInit(); + /// /// Gets or sets unutilized capacity of the capacity reservation. /// - [JsonProperty(PropertyName = "utilizationInfo")] - public CapacityReservationUtilization UtilizationInfo { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "utilizationInfo")] + public CapacityReservationUtilization UtilizationInfo {get; set; } /// /// Gets or sets the resource status information. /// - [JsonProperty(PropertyName = "statuses")] - public IList Statuses { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "statuses")] + public System.Collections.Generic.IList Statuses {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationInstanceViewTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationInstanceViewTypes.cs index 49830fa1c2f4..0f01b9e6fd2c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationInstanceViewTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationInstanceViewTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for CapacityReservationInstanceViewTypes. /// + + public static class CapacityReservationInstanceViewTypes { public const string InstanceView = "instanceView"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationInstanceViewWithName.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationInstanceViewWithName.cs index 68abbac33863..0cd9ca524cee 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationInstanceViewWithName.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationInstanceViewWithName.cs @@ -1,30 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// The instance view of a capacity reservation that includes the name of - /// the capacity reservation. It is used for the response to the instance - /// view of a capacity reservation group. + /// The instance view of a capacity reservation that includes the name of the + /// capacity reservation. It is used for the response to the instance view of a + /// capacity reservation group. /// public partial class CapacityReservationInstanceViewWithName : CapacityReservationInstanceView { /// - /// Initializes a new instance of the - /// CapacityReservationInstanceViewWithName class. + /// Initializes a new instance of the CapacityReservationInstanceViewWithName class. /// public CapacityReservationInstanceViewWithName() { @@ -32,17 +23,22 @@ public CapacityReservationInstanceViewWithName() } /// - /// Initializes a new instance of the - /// CapacityReservationInstanceViewWithName class. + /// Initializes a new instance of the CapacityReservationInstanceViewWithName class. /// - /// Unutilized capacity of the capacity - /// reservation. - /// The resource status information. - /// The name of the capacity reservation. - public CapacityReservationInstanceViewWithName(CapacityReservationUtilization utilizationInfo = default(CapacityReservationUtilization), IList statuses = default(IList), string name = default(string)) - : base(utilizationInfo, statuses) + + /// Unutilized capacity of the capacity reservation. + /// + + /// The resource status information. + /// + + /// The name of the capacity reservation. + /// + public CapacityReservationInstanceViewWithName(CapacityReservationUtilization utilizationInfo = default(CapacityReservationUtilization), System.Collections.Generic.IList statuses = default(System.Collections.Generic.IList), string name = default(string)) + + : base(utilizationInfo, statuses) { - Name = name; + this.Name = name; CustomInit(); } @@ -51,11 +47,11 @@ public CapacityReservationInstanceViewWithName() /// partial void CustomInit(); + /// /// Gets the name of the capacity reservation. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationProfile.cs index 476b3e1cbd8d..942684d4fcbc 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationProfile.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,16 @@ public CapacityReservationProfile() /// /// Initializes a new instance of the CapacityReservationProfile class. /// - /// Specifies the capacity - /// reservation group resource id that should be used for allocating - /// the virtual machine or scaleset vm instances provided enough + + /// Specifies the capacity reservation group resource id that should be used + /// for allocating the virtual machine or scaleset vm instances provided enough /// capacity has been reserved. Please refer to - /// https://aka.ms/CapacityReservation for more details. + /// https://aka.ms/CapacityReservation for more details. + /// public CapacityReservationProfile(SubResource capacityReservationGroup = default(SubResource)) + { - CapacityReservationGroup = capacityReservationGroup; + this.CapacityReservationGroup = capacityReservationGroup; CustomInit(); } @@ -45,14 +41,14 @@ public CapacityReservationProfile() /// partial void CustomInit(); + /// - /// Gets or sets specifies the capacity reservation group resource id - /// that should be used for allocating the virtual machine or scaleset - /// vm instances provided enough capacity has been reserved. Please - /// refer to https://aka.ms/CapacityReservation for more details. + /// Gets or sets specifies the capacity reservation group resource id that + /// should be used for allocating the virtual machine or scaleset vm instances + /// provided enough capacity has been reserved. Please refer to + /// https://aka.ms/CapacityReservation for more details. /// - [JsonProperty(PropertyName = "capacityReservationGroup")] - public SubResource CapacityReservationGroup { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "capacityReservationGroup")] + public SubResource CapacityReservationGroup {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationProperties.cs new file mode 100644 index 000000000000..6aa053d70279 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationProperties.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Properties of the Capacity reservation. + /// + public partial class CapacityReservationProperties + { + /// + /// Initializes a new instance of the CapacityReservationProperties class. + /// + public CapacityReservationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CapacityReservationProperties class. + /// + + /// A unique id generated and assigned to the capacity reservation by the + /// platform which does not change throughout the lifetime of the resource. + /// + + /// Specifies the value of fault domain count that Capacity Reservation + /// supports for requested VM size. **Note:** The fault domain count specified + /// for a resource (like virtual machines scale set) must be less than or equal + /// to this value if it deploys using capacity reservation. Minimum + /// api-version: 2022-08-01. + /// + + /// A list of all virtual machine resource ids that are associated with the + /// capacity reservation. + /// + + /// The date time when the capacity reservation was last updated. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// The Capacity reservation instance view. + /// + + /// Specifies the time at which the Capacity Reservation resource was created. + /// Minimum api-version: 2021-11-01. + /// + + /// Defines the schedule for Block-type capacity reservations. Specifies the + /// schedule during which capacity reservation is active and VM or VMSS + /// resource can be allocated using reservation. This property is required and + /// only supported when the capacity reservation group type is 'Block'. The + /// scheduleProfile, start, and end fields are immutable after creation. + /// Minimum API version: 2025-04-01. Please refer to + /// https://aka.ms/blockcapacityreservation for more details. + /// + public CapacityReservationProperties(string reservationId = default(string), int? platformFaultDomainCount = default(int?), System.Collections.Generic.IList virtualMachinesAssociated = default(System.Collections.Generic.IList), System.DateTime? provisioningTime = default(System.DateTime?), string provisioningState = default(string), CapacityReservationInstanceView instanceView = default(CapacityReservationInstanceView), System.DateTime? timeCreated = default(System.DateTime?), ScheduleProfile scheduleProfile = default(ScheduleProfile)) + + { + this.ReservationId = reservationId; + this.PlatformFaultDomainCount = platformFaultDomainCount; + this.VirtualMachinesAssociated = virtualMachinesAssociated; + this.ProvisioningTime = provisioningTime; + this.ProvisioningState = provisioningState; + this.InstanceView = instanceView; + this.TimeCreated = timeCreated; + this.ScheduleProfile = scheduleProfile; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets a unique id generated and assigned to the capacity reservation by the + /// platform which does not change throughout the lifetime of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "reservationId")] + public string ReservationId {get; private set; } + + /// + /// Gets specifies the value of fault domain count that Capacity Reservation + /// supports for requested VM size. **Note:** The fault domain count specified + /// for a resource (like virtual machines scale set) must be less than or equal + /// to this value if it deploys using capacity reservation. Minimum + /// api-version: 2022-08-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "platformFaultDomainCount")] + public int? PlatformFaultDomainCount {get; private set; } + + /// + /// Gets a list of all virtual machine resource ids that are associated with + /// the capacity reservation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachinesAssociated")] + public System.Collections.Generic.IList VirtualMachinesAssociated {get; private set; } + + /// + /// Gets the date time when the capacity reservation was last updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningTime")] + public System.DateTime? ProvisioningTime {get; private set; } + + /// + /// Gets the provisioning state, which only appears in the response. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the Capacity reservation instance view. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "instanceView")] + public CapacityReservationInstanceView InstanceView {get; private set; } + + /// + /// Gets specifies the time at which the Capacity Reservation resource was + /// created. Minimum api-version: 2021-11-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeCreated")] + public System.DateTime? TimeCreated {get; private set; } + + /// + /// Gets or sets defines the schedule for Block-type capacity reservations. + /// Specifies the schedule during which capacity reservation is active and VM + /// or VMSS resource can be allocated using reservation. This property is + /// required and only supported when the capacity reservation group type is + /// 'Block'. The scheduleProfile, start, and end fields are immutable after + /// creation. Minimum API version: 2025-04-01. Please refer to + /// https://aka.ms/blockcapacityreservation for more details. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scheduleProfile")] + public ScheduleProfile ScheduleProfile {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationUpdate.cs index 98082336e230..47f0a86be497 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationUpdate.cs @@ -1,28 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Specifies information about the capacity reservation. sku.capacity - /// cannot be updated for Block Capacity Reservation. Tags can be update - /// for all Capacity Reservation Types. + /// Specifies information about the capacity reservation. sku.capacity cannot + /// be updated for Block Capacity Reservation. Tags can be update for all + /// Capacity Reservation Types. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class CapacityReservationUpdate : UpdateResource { /// @@ -36,59 +26,71 @@ public CapacityReservationUpdate() /// /// Initializes a new instance of the CapacityReservationUpdate class. /// - /// Resource tags - /// A unique id generated and assigned to - /// the capacity reservation by the platform which does not change - /// throughout the lifetime of the resource. - /// Specifies the value of fault - /// domain count that Capacity Reservation supports for requested VM - /// size. **Note:** The fault domain count specified for a resource - /// (like virtual machines scale set) must be less than or equal to - /// this value if it deploys using capacity reservation. Minimum - /// api-version: 2022-08-01. - /// A list of all virtual - /// machine resource ids that are associated with the capacity - /// reservation. - /// The date time when the capacity - /// reservation was last updated. - /// The provisioning state, which only - /// appears in the response. - /// The Capacity reservation instance - /// view. - /// Specifies the time at which the Capacity - /// Reservation resource was created. Minimum api-version: - /// 2021-11-01. - /// Defines the schedule for Block-type - /// capacity reservations. Specifies the schedule during which capacity - /// reservation is active and VM or VMSS resource can be allocated - /// using reservation. This property is required and only supported - /// when the capacity reservation group type is 'Block'. The - /// scheduleProfile, start, and end fields are immutable after - /// creation. Minimum API version: 2025-04-01. Please refer to - /// https://aka.ms/blockcapacityreservation for more details. - /// SKU of the resource for which capacity needs be - /// reserved. The SKU name and capacity is required to be set. - /// Currently VM Skus with the capability called - /// 'CapacityReservationSupported' set to true are supported. When - /// 'CapacityReservationSupported' is true, the SKU capability also - /// specifies the 'SupportedCapacityReservationTypes', which lists the - /// types of capacity reservations (such as Targeted or Block) that the - /// SKU supports. Refer to List Microsoft.Compute SKUs in a region + + /// Resource tags + /// + + /// SKU of the resource for which capacity needs be reserved. The SKU name and + /// capacity is required to be set. Currently VM Skus with the capability + /// called 'CapacityReservationSupported' set to true are supported. When + /// 'CapacityReservationSupported' is true, the SKU capability also specifies + /// the 'SupportedCapacityReservationTypes', which lists the types of capacity + /// reservations (such as Targeted or Block) that the SKU supports. Refer to + /// List Microsoft.Compute SKUs in a region /// (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for - /// supported values. **Note:** The SKU name and capacity cannot be - /// updated for Block capacity reservations. - public CapacityReservationUpdate(IDictionary tags = default(IDictionary), string reservationId = default(string), int? platformFaultDomainCount = default(int?), IList virtualMachinesAssociated = default(IList), System.DateTime? provisioningTime = default(System.DateTime?), string provisioningState = default(string), CapacityReservationInstanceView instanceView = default(CapacityReservationInstanceView), System.DateTime? timeCreated = default(System.DateTime?), ScheduleProfile scheduleProfile = default(ScheduleProfile), Sku sku = default(Sku)) - : base(tags) + /// supported values. **Note:** The SKU name and capacity cannot be updated for + /// Block capacity reservations. + /// + + /// Defines the schedule for Block-type capacity reservations. Specifies the + /// schedule during which capacity reservation is active and VM or VMSS + /// resource can be allocated using reservation. This property is required and + /// only supported when the capacity reservation group type is 'Block'. The + /// scheduleProfile, start, and end fields are immutable after creation. + /// Minimum API version: 2025-04-01. Please refer to + /// https://aka.ms/blockcapacityreservation for more details. + /// + + /// A unique id generated and assigned to the capacity reservation by the + /// platform which does not change throughout the lifetime of the resource. + /// + + /// Specifies the value of fault domain count that Capacity Reservation + /// supports for requested VM size. **Note:** The fault domain count specified + /// for a resource (like virtual machines scale set) must be less than or equal + /// to this value if it deploys using capacity reservation. Minimum + /// api-version: 2022-08-01. + /// + + /// A list of all virtual machine resource ids that are associated with the + /// capacity reservation. + /// + + /// The date time when the capacity reservation was last updated. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// The Capacity reservation instance view. + /// + + /// Specifies the time at which the Capacity Reservation resource was created. + /// Minimum api-version: 2021-11-01. + /// + public CapacityReservationUpdate(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), Sku sku = default(Sku), ScheduleProfile scheduleProfile = default(ScheduleProfile), string reservationId = default(string), int? platformFaultDomainCount = default(int?), System.Collections.Generic.IList virtualMachinesAssociated = default(System.Collections.Generic.IList), System.DateTime? provisioningTime = default(System.DateTime?), string provisioningState = default(string), CapacityReservationInstanceView instanceView = default(CapacityReservationInstanceView), System.DateTime? timeCreated = default(System.DateTime?)) + + : base(tags) { - ReservationId = reservationId; - PlatformFaultDomainCount = platformFaultDomainCount; - VirtualMachinesAssociated = virtualMachinesAssociated; - ProvisioningTime = provisioningTime; - ProvisioningState = provisioningState; - InstanceView = instanceView; - TimeCreated = timeCreated; - ScheduleProfile = scheduleProfile; - Sku = sku; + this.Sku = sku; + this.ScheduleProfile = scheduleProfile; + this.ReservationId = reservationId; + this.PlatformFaultDomainCount = platformFaultDomainCount; + this.VirtualMachinesAssociated = virtualMachinesAssociated; + this.ProvisioningTime = provisioningTime; + this.ProvisioningState = provisioningState; + this.InstanceView = instanceView; + this.TimeCreated = timeCreated; CustomInit(); } @@ -97,84 +99,81 @@ public CapacityReservationUpdate() /// partial void CustomInit(); + /// - /// Gets a unique id generated and assigned to the capacity reservation - /// by the platform which does not change throughout the lifetime of - /// the resource. + /// Gets or sets sKU of the resource for which capacity needs be reserved. The + /// SKU name and capacity is required to be set. Currently VM Skus with the + /// capability called 'CapacityReservationSupported' set to true are supported. + /// When 'CapacityReservationSupported' is true, the SKU capability also + /// specifies the 'SupportedCapacityReservationTypes', which lists the types of + /// capacity reservations (such as Targeted or Block) that the SKU supports. + /// Refer to List Microsoft.Compute SKUs in a region + /// (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for + /// supported values. **Note:** The SKU name and capacity cannot be updated for + /// Block capacity reservations. /// - [JsonProperty(PropertyName = "properties.reservationId")] - public string ReservationId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public Sku Sku {get; set; } /// - /// Gets specifies the value of fault domain count that Capacity - /// Reservation supports for requested VM size. **Note:** The fault - /// domain count specified for a resource (like virtual machines scale - /// set) must be less than or equal to this value if it deploys using - /// capacity reservation. Minimum api-version: 2022-08-01. + /// Gets or sets defines the schedule for Block-type capacity reservations. + /// Specifies the schedule during which capacity reservation is active and VM + /// or VMSS resource can be allocated using reservation. This property is + /// required and only supported when the capacity reservation group type is + /// 'Block'. The scheduleProfile, start, and end fields are immutable after + /// creation. Minimum API version: 2025-04-01. Please refer to + /// https://aka.ms/blockcapacityreservation for more details. /// - [JsonProperty(PropertyName = "properties.platformFaultDomainCount")] - public int? PlatformFaultDomainCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scheduleProfile")] + public ScheduleProfile ScheduleProfile {get; set; } /// - /// Gets a list of all virtual machine resource ids that are associated - /// with the capacity reservation. + /// Gets a unique id generated and assigned to the capacity reservation by the + /// platform which does not change throughout the lifetime of the resource. /// - [JsonProperty(PropertyName = "properties.virtualMachinesAssociated")] - public IList VirtualMachinesAssociated { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.reservationId")] + public string ReservationId {get; private set; } /// - /// Gets the date time when the capacity reservation was last updated. + /// Gets specifies the value of fault domain count that Capacity Reservation + /// supports for requested VM size. **Note:** The fault domain count specified + /// for a resource (like virtual machines scale set) must be less than or equal + /// to this value if it deploys using capacity reservation. Minimum + /// api-version: 2022-08-01. /// - [JsonProperty(PropertyName = "properties.provisioningTime")] - public System.DateTime? ProvisioningTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.platformFaultDomainCount")] + public int? PlatformFaultDomainCount {get; private set; } /// - /// Gets the provisioning state, which only appears in the response. + /// Gets a list of all virtual machine resource ids that are associated with + /// the capacity reservation. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachinesAssociated")] + public System.Collections.Generic.IList VirtualMachinesAssociated {get; private set; } /// - /// Gets the Capacity reservation instance view. + /// Gets the date time when the capacity reservation was last updated. /// - [JsonProperty(PropertyName = "properties.instanceView")] - public CapacityReservationInstanceView InstanceView { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningTime")] + public System.DateTime? ProvisioningTime {get; private set; } /// - /// Gets specifies the time at which the Capacity Reservation resource - /// was created. Minimum api-version: 2021-11-01. + /// Gets the provisioning state, which only appears in the response. /// - [JsonProperty(PropertyName = "properties.timeCreated")] - public System.DateTime? TimeCreated { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets defines the schedule for Block-type capacity - /// reservations. Specifies the schedule during which capacity - /// reservation is active and VM or VMSS resource can be allocated - /// using reservation. This property is required and only supported - /// when the capacity reservation group type is 'Block'. The - /// scheduleProfile, start, and end fields are immutable after - /// creation. Minimum API version: 2025-04-01. Please refer to - /// https://aka.ms/blockcapacityreservation for more details. + /// Gets the Capacity reservation instance view. /// - [JsonProperty(PropertyName = "properties.scheduleProfile")] - public ScheduleProfile ScheduleProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.instanceView")] + public CapacityReservationInstanceView InstanceView {get; private set; } /// - /// Gets or sets SKU of the resource for which capacity needs be - /// reserved. The SKU name and capacity is required to be set. - /// Currently VM Skus with the capability called - /// 'CapacityReservationSupported' set to true are supported. When - /// 'CapacityReservationSupported' is true, the SKU capability also - /// specifies the 'SupportedCapacityReservationTypes', which lists the - /// types of capacity reservations (such as Targeted or Block) that the - /// SKU supports. Refer to List Microsoft.Compute SKUs in a region - /// (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for - /// supported values. **Note:** The SKU name and capacity cannot be - /// updated for Block capacity reservations. + /// Gets specifies the time at which the Capacity Reservation resource was + /// created. Minimum api-version: 2021-11-01. /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeCreated")] + public System.DateTime? TimeCreated {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationUtilization.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationUtilization.cs index f0304776451f..2198d613d424 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationUtilization.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationUtilization.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +14,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class CapacityReservationUtilization { /// - /// Initializes a new instance of the CapacityReservationUtilization - /// class. + /// Initializes a new instance of the CapacityReservationUtilization class. /// public CapacityReservationUtilization() { @@ -31,20 +22,22 @@ public CapacityReservationUtilization() } /// - /// Initializes a new instance of the CapacityReservationUtilization - /// class. + /// Initializes a new instance of the CapacityReservationUtilization class. /// - /// The value provides the current - /// capacity of the VM size which was reserved successfully and for - /// which the customer is getting billed. Minimum api-version: - /// 2022-08-01. - /// A list of all virtual - /// machines resource ids allocated against the capacity - /// reservation. - public CapacityReservationUtilization(int? currentCapacity = default(int?), IList virtualMachinesAllocated = default(IList)) + + /// The value provides the current capacity of the VM size which was reserved + /// successfully and for which the customer is getting billed. Minimum + /// api-version: 2022-08-01. + /// + + /// A list of all virtual machines resource ids allocated against the capacity + /// reservation. + /// + public CapacityReservationUtilization(int? currentCapacity = default(int?), System.Collections.Generic.IList virtualMachinesAllocated = default(System.Collections.Generic.IList)) + { - CurrentCapacity = currentCapacity; - VirtualMachinesAllocated = virtualMachinesAllocated; + this.CurrentCapacity = currentCapacity; + this.VirtualMachinesAllocated = virtualMachinesAllocated; CustomInit(); } @@ -53,20 +46,20 @@ public CapacityReservationUtilization() /// partial void CustomInit(); + /// - /// Gets the value provides the current capacity of the VM size which - /// was reserved successfully and for which the customer is getting - /// billed. Minimum api-version: 2022-08-01. + /// Gets the value provides the current capacity of the VM size which was + /// reserved successfully and for which the customer is getting billed. Minimum + /// api-version: 2022-08-01. /// - [JsonProperty(PropertyName = "currentCapacity")] - public int? CurrentCapacity { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "currentCapacity")] + public int? CurrentCapacity {get; private set; } /// - /// Gets a list of all virtual machines resource ids allocated against - /// the capacity reservation. + /// Gets a list of all virtual machines resource ids allocated against the + /// capacity reservation. /// - [JsonProperty(PropertyName = "virtualMachinesAllocated")] - public IList VirtualMachinesAllocated { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachinesAllocated")] + public System.Collections.Generic.IList VirtualMachinesAllocated {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationsCreateOrUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationsCreateOrUpdateHeaders.cs index 4d4ab8af6544..1f982b740899 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationsCreateOrUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CapacityReservationsCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class CapacityReservationsCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// CapacityReservationsCreateOrUpdateHeaders class. + /// Initializes a new instance of the CapacityReservationsCreateOrUpdateHeaders class. /// public CapacityReservationsCreateOrUpdateHeaders() { @@ -28,18 +18,19 @@ public CapacityReservationsCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// CapacityReservationsCreateOrUpdateHeaders class. + /// Initializes a new instance of the CapacityReservationsCreateOrUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public CapacityReservationsCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public CapacityReservationsCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CheckNameAvailabilityReason.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CheckNameAvailabilityReason.cs index 37cabfa8315e..bb38c685973e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CheckNameAvailabilityReason.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CheckNameAvailabilityReason.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for CheckNameAvailabilityReason. /// + + public static class CheckNameAvailabilityReason { public const string Invalid = "Invalid"; public const string AlreadyExists = "AlreadyExists"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CheckNameAvailabilityRequest.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CheckNameAvailabilityRequest.cs index 539b17b58c46..aa408fc9016d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CheckNameAvailabilityRequest.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CheckNameAvailabilityRequest.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class CheckNameAvailabilityRequest { /// - /// Initializes a new instance of the CheckNameAvailabilityRequest - /// class. + /// Initializes a new instance of the CheckNameAvailabilityRequest class. /// public CheckNameAvailabilityRequest() { @@ -28,16 +21,19 @@ public CheckNameAvailabilityRequest() } /// - /// Initializes a new instance of the CheckNameAvailabilityRequest - /// class. + /// Initializes a new instance of the CheckNameAvailabilityRequest class. /// - /// The name of the resource for which availability - /// needs to be checked. - /// The resource type. + + /// The name of the resource for which availability needs to be checked. + /// + + /// The resource type. + /// public CheckNameAvailabilityRequest(string name = default(string), string type = default(string)) + { - Name = name; - Type = type; + this.Name = name; + this.Type = type; CustomInit(); } @@ -46,18 +42,18 @@ public CheckNameAvailabilityRequest() /// partial void CustomInit(); + /// - /// Gets or sets the name of the resource for which availability needs - /// to be checked. + /// Gets or sets the name of the resource for which availability needs to be + /// checked. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the resource type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CheckNameAvailabilityResponse.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CheckNameAvailabilityResponse.cs index b1c9c28aa1d9..5faca8eb8c66 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CheckNameAvailabilityResponse.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CheckNameAvailabilityResponse.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class CheckNameAvailabilityResponse { /// - /// Initializes a new instance of the CheckNameAvailabilityResponse - /// class. + /// Initializes a new instance of the CheckNameAvailabilityResponse class. /// public CheckNameAvailabilityResponse() { @@ -28,21 +21,23 @@ public CheckNameAvailabilityResponse() } /// - /// Initializes a new instance of the CheckNameAvailabilityResponse - /// class. + /// Initializes a new instance of the CheckNameAvailabilityResponse class. /// - /// Indicates if the resource name is - /// available. - /// The reason why the given name is not - /// available. Possible values include: 'Invalid', - /// 'AlreadyExists' - /// Detailed reason why the given name is - /// available. + + /// Indicates if the resource name is available. + /// + + /// The reason why the given name is not available. + /// Possible values include: 'Invalid', 'AlreadyExists' + + /// Detailed reason why the given name is available. + /// public CheckNameAvailabilityResponse(bool? nameAvailable = default(bool?), string reason = default(string), string message = default(string)) + { - NameAvailable = nameAvailable; - Reason = reason; - Message = message; + this.NameAvailable = nameAvailable; + this.Reason = reason; + this.Message = message; CustomInit(); } @@ -51,24 +46,23 @@ public CheckNameAvailabilityResponse() /// partial void CustomInit(); + /// /// Gets or sets indicates if the resource name is available. /// - [JsonProperty(PropertyName = "nameAvailable")] - public bool? NameAvailable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nameAvailable")] + public bool? NameAvailable {get; set; } /// - /// Gets or sets the reason why the given name is not available. - /// Possible values include: 'Invalid', 'AlreadyExists' + /// Gets or sets the reason why the given name is not available. Possible values include: 'Invalid', 'AlreadyExists' /// - [JsonProperty(PropertyName = "reason")] - public string Reason { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "reason")] + public string Reason {get; set; } /// /// Gets or sets detailed reason why the given name is available. /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGallery.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGallery.cs index 2798ace25a98..a3f5d015f22c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGallery.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGallery.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Specifies information about the Community Gallery that you want to - /// create or update. + /// Specifies information about the Community Gallery that you want to create + /// or update. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class CommunityGallery : PirCommunityGalleryResource { /// @@ -35,23 +25,34 @@ public CommunityGallery() /// /// Initializes a new instance of the CommunityGallery class. /// - /// Resource name - /// Resource location - /// Resource type - /// The unique id of this community - /// gallery. - /// The disclaimer for a community gallery - /// resource. - /// The artifact tags of a community gallery - /// resource. - /// The metadata of community - /// gallery. - public CommunityGallery(string name = default(string), string location = default(string), string type = default(string), string uniqueId = default(string), string disclaimer = default(string), IDictionary artifactTags = default(IDictionary), CommunityGalleryMetadata communityMetadata = default(CommunityGalleryMetadata)) - : base(name, location, type, uniqueId) + + /// The unique id of this community gallery. + /// + + /// Resource name + /// + + /// Resource location + /// + + /// Resource type + /// + + /// The disclaimer for a community gallery resource. + /// + + /// The artifact tags of a community gallery resource. + /// + + /// The metadata of community gallery. + /// + public CommunityGallery(string uniqueId = default(string), string name = default(string), string location = default(string), string type = default(string), string disclaimer = default(string), System.Collections.Generic.IDictionary artifactTags = default(System.Collections.Generic.IDictionary), CommunityGalleryMetadata communityMetadata = default(CommunityGalleryMetadata)) + + : base(name, location, type, uniqueId) { - Disclaimer = disclaimer; - ArtifactTags = artifactTags; - CommunityMetadata = communityMetadata; + this.Disclaimer = disclaimer; + this.ArtifactTags = artifactTags; + this.CommunityMetadata = communityMetadata; CustomInit(); } @@ -60,36 +61,38 @@ public CommunityGallery() /// partial void CustomInit(); + /// /// Gets or sets the disclaimer for a community gallery resource. /// - [JsonProperty(PropertyName = "properties.disclaimer")] - public string Disclaimer { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disclaimer")] + public string Disclaimer {get; set; } /// /// Gets or sets the artifact tags of a community gallery resource. /// - [JsonProperty(PropertyName = "properties.artifactTags")] - public IDictionary ArtifactTags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.artifactTags")] + public System.Collections.Generic.IDictionary ArtifactTags {get; set; } /// /// Gets or sets the metadata of community gallery. /// - [JsonProperty(PropertyName = "properties.communityMetadata")] - public CommunityGalleryMetadata CommunityMetadata { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.communityMetadata")] + public CommunityGalleryMetadata CommunityMetadata {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (CommunityMetadata != null) + + + if (this.CommunityMetadata != null) { - CommunityMetadata.Validate(); + this.CommunityMetadata.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryIdentifier.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryIdentifier.cs new file mode 100644 index 000000000000..ceb861d43e0c --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryIdentifier.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// The identifier information of community gallery. + /// + public partial class CommunityGalleryIdentifier + { + /// + /// Initializes a new instance of the CommunityGalleryIdentifier class. + /// + public CommunityGalleryIdentifier() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CommunityGalleryIdentifier class. + /// + + /// The unique id of this community gallery. + /// + public CommunityGalleryIdentifier(string uniqueId = default(string)) + + { + this.UniqueId = uniqueId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the unique id of this community gallery. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueId")] + public string UniqueId {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImage.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImage.cs index 4db51730a94c..69214e3480f2 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImage.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImage.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Specifies information about the gallery image definition that you want - /// to create or update. + /// Specifies information about the gallery image definition that you want to + /// create or update. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class CommunityGalleryImage : PirCommunityGalleryResource { /// @@ -35,63 +25,85 @@ public CommunityGalleryImage() /// /// Initializes a new instance of the CommunityGalleryImage class. /// - /// This property allows you to specify the type - /// of the OS that is included in the disk when creating a VM from a - /// managed image. Possible values are: **Windows,** **Linux.**. - /// Possible values include: 'Windows', 'Linux' - /// This property allows the user to specify - /// whether the virtual machines created under this image are - /// 'Generalized' or 'Specialized'. Possible values include: - /// 'Generalized', 'Specialized' - /// This is the community - /// gallery image definition identifier. - /// Resource name - /// Resource location - /// Resource type - /// The unique id of this community - /// gallery. - /// The end of life date of the gallery - /// image definition. This property can be used for decommissioning - /// purposes. This property is updatable. - /// The properties describe the recommended - /// machine configuration for this Image Definition. These properties - /// are updatable. - /// Describes the disallowed disk - /// types. - /// The hypervisor generation of the - /// Virtual Machine. Applicable to OS disks only. Possible values - /// include: 'V1', 'V2' - /// A list of gallery image features. - /// Describes the gallery image definition - /// purchase plan. This is used by marketplace images. - /// The architecture of the image. - /// Applicable to OS disks only. Possible values include: 'x64', - /// 'Arm64' - /// Privacy statement URI for the - /// current community gallery image. - /// The end-user license agreement for the current - /// community gallery image. - /// The disclaimer for a community gallery - /// resource. - /// The artifact tags of a community gallery - /// resource. - public CommunityGalleryImage(OperatingSystemTypes osType, OperatingSystemStateTypes osState, CommunityGalleryImageIdentifier communityGalleryImageIdentifier, string name = default(string), string location = default(string), string type = default(string), string uniqueId = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), string hyperVGeneration = default(string), IList features = default(IList), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string architecture = default(string), string privacyStatementUri = default(string), string eula = default(string), string disclaimer = default(string), IDictionary artifactTags = default(IDictionary)) - : base(name, location, type, uniqueId) + + /// The unique id of this community gallery. + /// + + /// Resource name + /// + + /// Resource location + /// + + /// Resource type + /// + + /// Describes the disallowed disk types. + /// + + /// The architecture of the image. Applicable to OS disks only. + /// Possible values include: 'x64', 'Arm64' + + /// This property allows you to specify the type of the OS that is included in + /// the disk when creating a VM from a managed image. Possible values are: + /// **Windows,** **Linux.** + /// Possible values include: 'Windows', 'Linux' + + /// This property allows the user to specify whether the virtual machines + /// created under this image are 'Generalized' or 'Specialized'. + /// Possible values include: 'Generalized', 'Specialized' + + /// The end of life date of the gallery image definition. This property can be + /// used for decommissioning purposes. This property is updatable. + /// + + /// This is the community gallery image definition identifier. + /// + + /// The properties describe the recommended machine configuration for this + /// Image Definition. These properties are updatable. + /// + + /// The hypervisor generation of the Virtual Machine. Applicable to OS disks + /// only. + /// Possible values include: 'V1', 'V2' + + /// A list of gallery image features. + /// + + /// Describes the gallery image definition purchase plan. This is used by + /// marketplace images. + /// + + /// Privacy statement URI for the current community gallery image. + /// + + /// The end-user license agreement for the current community gallery image. + /// + + /// The disclaimer for a community gallery resource. + /// + + /// The artifact tags of a community gallery resource. + /// + public CommunityGalleryImage(string uniqueId = default(string), string name = default(string), string location = default(string), string type = default(string), Disallowed disallowed = default(Disallowed), string architecture = default(string), OperatingSystemTypes? osType = default(OperatingSystemTypes?), OperatingSystemStateTypes? osState = default(OperatingSystemStateTypes?), System.DateTime? endOfLifeDate = default(System.DateTime?), CommunityGalleryImageIdentifier propertiesIdentifier = default(CommunityGalleryImageIdentifier), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), string hyperVGeneration = default(string), System.Collections.Generic.IList features = default(System.Collections.Generic.IList), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string privacyStatementUri = default(string), string eula = default(string), string disclaimer = default(string), System.Collections.Generic.IDictionary artifactTags = default(System.Collections.Generic.IDictionary)) + + : base(name, location, type, uniqueId) { - OsType = osType; - OsState = osState; - EndOfLifeDate = endOfLifeDate; - CommunityGalleryImageIdentifier = communityGalleryImageIdentifier; - Recommended = recommended; - Disallowed = disallowed; - HyperVGeneration = hyperVGeneration; - Features = features; - PurchasePlan = purchasePlan; - Architecture = architecture; - PrivacyStatementUri = privacyStatementUri; - Eula = eula; - Disclaimer = disclaimer; - ArtifactTags = artifactTags; + this.Disallowed = disallowed; + this.Architecture = architecture; + this.OsType = osType; + this.OsState = osState; + this.EndOfLifeDate = endOfLifeDate; + this.PropertiesIdentifier = propertiesIdentifier; + this.Recommended = recommended; + this.HyperVGeneration = hyperVGeneration; + this.Features = features; + this.PurchasePlan = purchasePlan; + this.PrivacyStatementUri = privacyStatementUri; + this.Eula = eula; + this.Disclaimer = disclaimer; + this.ArtifactTags = artifactTags; CustomInit(); } @@ -100,118 +112,98 @@ public CommunityGalleryImage() /// partial void CustomInit(); + /// - /// Gets or sets this property allows you to specify the type of the OS - /// that is included in the disk when creating a VM from a managed - /// image. Possible values are: **Windows,** **Linux.**. Possible - /// values include: 'Windows', 'Linux' + /// Gets or sets describes the disallowed disk types. /// - [JsonProperty(PropertyName = "properties.osType")] - public OperatingSystemTypes OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disallowed")] + public Disallowed Disallowed {get; set; } /// - /// Gets or sets this property allows the user to specify whether the - /// virtual machines created under this image are 'Generalized' or - /// 'Specialized'. Possible values include: 'Generalized', - /// 'Specialized' + /// Gets or sets the architecture of the image. Applicable to OS disks only. Possible values include: 'x64', 'Arm64' /// - [JsonProperty(PropertyName = "properties.osState")] - public OperatingSystemStateTypes OsState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.architecture")] + public string Architecture {get; set; } /// - /// Gets or sets the end of life date of the gallery image definition. - /// This property can be used for decommissioning purposes. This - /// property is updatable. + /// Gets or sets this property allows you to specify the type of the OS that is + /// included in the disk when creating a VM from a managed image. Possible + /// values are: **Windows,** **Linux.** Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "properties.endOfLifeDate")] - public System.DateTime? EndOfLifeDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osType")] + public OperatingSystemTypes? OsType {get; set; } /// - /// Gets or sets this is the community gallery image definition - /// identifier. + /// Gets or sets this property allows the user to specify whether the virtual + /// machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'Generalized', 'Specialized' /// - [JsonProperty(PropertyName = "properties.identifier")] - public CommunityGalleryImageIdentifier CommunityGalleryImageIdentifier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osState")] + public OperatingSystemStateTypes? OsState {get; set; } /// - /// Gets or sets the properties describe the recommended machine - /// configuration for this Image Definition. These properties are + /// Gets or sets the end of life date of the gallery image definition. This + /// property can be used for decommissioning purposes. This property is /// updatable. /// - [JsonProperty(PropertyName = "properties.recommended")] - public RecommendedMachineConfiguration Recommended { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.endOfLifeDate")] + public System.DateTime? EndOfLifeDate {get; set; } /// - /// Gets or sets describes the disallowed disk types. + /// Gets or sets this is the community gallery image definition identifier. /// - [JsonProperty(PropertyName = "properties.disallowed")] - public Disallowed Disallowed { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.identifier")] + public CommunityGalleryImageIdentifier PropertiesIdentifier {get; set; } /// - /// Gets or sets the hypervisor generation of the Virtual Machine. - /// Applicable to OS disks only. Possible values include: 'V1', 'V2' + /// Gets or sets the properties describe the recommended machine configuration + /// for this Image Definition. These properties are updatable. /// - [JsonProperty(PropertyName = "properties.hyperVGeneration")] - public string HyperVGeneration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.recommended")] + public RecommendedMachineConfiguration Recommended {get; set; } /// - /// Gets or sets a list of gallery image features. + /// Gets or sets the hypervisor generation of the Virtual Machine. Applicable + /// to OS disks only. Possible values include: 'V1', 'V2' /// - [JsonProperty(PropertyName = "properties.features")] - public IList Features { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hyperVGeneration")] + public string HyperVGeneration {get; set; } /// - /// Gets or sets describes the gallery image definition purchase plan. - /// This is used by marketplace images. + /// Gets or sets a list of gallery image features. /// - [JsonProperty(PropertyName = "properties.purchasePlan")] - public ImagePurchasePlan PurchasePlan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.features")] + public System.Collections.Generic.IList Features {get; set; } /// - /// Gets or sets the architecture of the image. Applicable to OS disks - /// only. Possible values include: 'x64', 'Arm64' + /// Gets or sets describes the gallery image definition purchase plan. This is + /// used by marketplace images. /// - [JsonProperty(PropertyName = "properties.architecture")] - public string Architecture { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.purchasePlan")] + public ImagePurchasePlan PurchasePlan {get; set; } /// - /// Gets or sets privacy statement URI for the current community - /// gallery image. + /// Gets or sets privacy statement URI for the current community gallery image. /// - [JsonProperty(PropertyName = "properties.privacyStatementUri")] - public string PrivacyStatementUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privacyStatementUri")] + public string PrivacyStatementUri {get; set; } /// - /// Gets or sets the end-user license agreement for the current - /// community gallery image. + /// Gets or sets the end-user license agreement for the current community + /// gallery image. /// - [JsonProperty(PropertyName = "properties.eula")] - public string Eula { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.eula")] + public string Eula {get; set; } /// /// Gets or sets the disclaimer for a community gallery resource. /// - [JsonProperty(PropertyName = "properties.disclaimer")] - public string Disclaimer { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disclaimer")] + public string Disclaimer {get; set; } /// /// Gets or sets the artifact tags of a community gallery resource. /// - [JsonProperty(PropertyName = "properties.artifactTags")] - public IDictionary ArtifactTags { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (CommunityGalleryImageIdentifier == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "CommunityGalleryImageIdentifier"); - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.artifactTags")] + public System.Collections.Generic.IDictionary ArtifactTags {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageIdentifier.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageIdentifier.cs index b828fbf38627..58966398e91b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageIdentifier.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageIdentifier.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class CommunityGalleryImageIdentifier { /// - /// Initializes a new instance of the CommunityGalleryImageIdentifier - /// class. + /// Initializes a new instance of the CommunityGalleryImageIdentifier class. /// public CommunityGalleryImageIdentifier() { @@ -28,20 +21,23 @@ public CommunityGalleryImageIdentifier() } /// - /// Initializes a new instance of the CommunityGalleryImageIdentifier - /// class. + /// Initializes a new instance of the CommunityGalleryImageIdentifier class. /// - /// The name of the gallery image definition - /// publisher. - /// The name of the gallery image definition - /// offer. - /// The name of the gallery image definition - /// SKU. + + /// The name of the gallery image definition publisher. + /// + + /// The name of the gallery image definition offer. + /// + + /// The name of the gallery image definition SKU. + /// public CommunityGalleryImageIdentifier(string publisher = default(string), string offer = default(string), string sku = default(string)) + { - Publisher = publisher; - Offer = offer; - Sku = sku; + this.Publisher = publisher; + this.Offer = offer; + this.Sku = sku; CustomInit(); } @@ -50,23 +46,23 @@ public CommunityGalleryImageIdentifier() /// partial void CustomInit(); + /// /// Gets or sets the name of the gallery image definition publisher. /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publisher")] + public string Publisher {get; set; } /// /// Gets or sets the name of the gallery image definition offer. /// - [JsonProperty(PropertyName = "offer")] - public string Offer { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "offer")] + public string Offer {get; set; } /// /// Gets or sets the name of the gallery image definition SKU. /// - [JsonProperty(PropertyName = "sku")] - public string Sku { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public string Sku {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageProperties.cs new file mode 100644 index 000000000000..6f2917a41a7a --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageProperties.cs @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a gallery image definition. + /// + public partial class CommunityGalleryImageProperties + { + /// + /// Initializes a new instance of the CommunityGalleryImageProperties class. + /// + public CommunityGalleryImageProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CommunityGalleryImageProperties class. + /// + + /// This property allows you to specify the type of the OS that is included in + /// the disk when creating a VM from a managed image. Possible values are: + /// **Windows,** **Linux.** + /// Possible values include: 'Windows', 'Linux' + + /// This property allows the user to specify whether the virtual machines + /// created under this image are 'Generalized' or 'Specialized'. + /// Possible values include: 'Generalized', 'Specialized' + + /// The end of life date of the gallery image definition. This property can be + /// used for decommissioning purposes. This property is updatable. + /// + + /// This is the community gallery image definition identifier. + /// + + /// The properties describe the recommended machine configuration for this + /// Image Definition. These properties are updatable. + /// + + /// Describes the disallowed disk types. + /// + + /// The hypervisor generation of the Virtual Machine. Applicable to OS disks + /// only. + /// Possible values include: 'V1', 'V2' + + /// A list of gallery image features. + /// + + /// Describes the gallery image definition purchase plan. This is used by + /// marketplace images. + /// + + /// The architecture of the image. Applicable to OS disks only. + /// Possible values include: 'x64', 'Arm64' + + /// Privacy statement URI for the current community gallery image. + /// + + /// The end-user license agreement for the current community gallery image. + /// + + /// The disclaimer for a community gallery resource. + /// + + /// The artifact tags of a community gallery resource. + /// + public CommunityGalleryImageProperties(OperatingSystemTypes osType, OperatingSystemStateTypes osState, CommunityGalleryImageIdentifier identifier, System.DateTime? endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), string hyperVGeneration = default(string), System.Collections.Generic.IList features = default(System.Collections.Generic.IList), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string architecture = default(string), string privacyStatementUri = default(string), string eula = default(string), string disclaimer = default(string), System.Collections.Generic.IDictionary artifactTags = default(System.Collections.Generic.IDictionary)) + + { + this.OsType = osType; + this.OsState = osState; + this.EndOfLifeDate = endOfLifeDate; + this.Identifier = identifier; + this.Recommended = recommended; + this.Disallowed = disallowed; + this.HyperVGeneration = hyperVGeneration; + this.Features = features; + this.PurchasePlan = purchasePlan; + this.Architecture = architecture; + this.PrivacyStatementUri = privacyStatementUri; + this.Eula = eula; + this.Disclaimer = disclaimer; + this.ArtifactTags = artifactTags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets this property allows you to specify the type of the OS that is + /// included in the disk when creating a VM from a managed image. Possible + /// values are: **Windows,** **Linux.** Possible values include: 'Windows', 'Linux' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public OperatingSystemTypes OsType {get; set; } + + /// + /// Gets or sets this property allows the user to specify whether the virtual + /// machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'Generalized', 'Specialized' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osState")] + public OperatingSystemStateTypes OsState {get; set; } + + /// + /// Gets or sets the end of life date of the gallery image definition. This + /// property can be used for decommissioning purposes. This property is + /// updatable. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "endOfLifeDate")] + public System.DateTime? EndOfLifeDate {get; set; } + + /// + /// Gets or sets this is the community gallery image definition identifier. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identifier")] + public CommunityGalleryImageIdentifier Identifier {get; set; } + + /// + /// Gets or sets the properties describe the recommended machine configuration + /// for this Image Definition. These properties are updatable. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "recommended")] + public RecommendedMachineConfiguration Recommended {get; set; } + + /// + /// Gets or sets describes the disallowed disk types. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disallowed")] + public Disallowed Disallowed {get; set; } + + /// + /// Gets or sets the hypervisor generation of the Virtual Machine. Applicable + /// to OS disks only. Possible values include: 'V1', 'V2' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hyperVGeneration")] + public string HyperVGeneration {get; set; } + + /// + /// Gets or sets a list of gallery image features. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "features")] + public System.Collections.Generic.IList Features {get; set; } + + /// + /// Gets or sets describes the gallery image definition purchase plan. This is + /// used by marketplace images. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "purchasePlan")] + public ImagePurchasePlan PurchasePlan {get; set; } + + /// + /// Gets or sets the architecture of the image. Applicable to OS disks only. Possible values include: 'x64', 'Arm64' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "architecture")] + public string Architecture {get; set; } + + /// + /// Gets or sets privacy statement URI for the current community gallery image. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privacyStatementUri")] + public string PrivacyStatementUri {get; set; } + + /// + /// Gets or sets the end-user license agreement for the current community + /// gallery image. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eula")] + public string Eula {get; set; } + + /// + /// Gets or sets the disclaimer for a community gallery resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disclaimer")] + public string Disclaimer {get; set; } + + /// + /// Gets or sets the artifact tags of a community gallery resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "artifactTags")] + public System.Collections.Generic.IDictionary ArtifactTags {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Identifier == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Identifier"); + } + + + + + + + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageVersion.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageVersion.cs index 64e5c6e4a2e2..57b0ae9aba36 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageVersion.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageVersion.cs @@ -1,32 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specifies information about the gallery image version that you want to /// create or update. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class CommunityGalleryImageVersion : PirCommunityGalleryResource { /// - /// Initializes a new instance of the CommunityGalleryImageVersion - /// class. + /// Initializes a new instance of the CommunityGalleryImageVersion class. /// public CommunityGalleryImageVersion() { @@ -34,38 +23,51 @@ public CommunityGalleryImageVersion() } /// - /// Initializes a new instance of the CommunityGalleryImageVersion - /// class. + /// Initializes a new instance of the CommunityGalleryImageVersion class. /// - /// Resource name - /// Resource location - /// Resource type - /// The unique id of this community - /// gallery. - /// The published date of the gallery image - /// version Definition. This property can be used for decommissioning - /// purposes. This property is updatable. - /// The end of life date of the gallery - /// image version Definition. This property can be used for - /// decommissioning purposes. This property is updatable. - /// If set to true, Virtual Machines - /// deployed from the latest version of the Image Definition won't use - /// this Image Version. - /// Describes the storage profile of the - /// image version. - /// The disclaimer for a community gallery - /// resource. - /// The artifact tags of a community gallery - /// resource. - public CommunityGalleryImageVersion(string name = default(string), string location = default(string), string type = default(string), string uniqueId = default(string), System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? excludeFromLatest = default(bool?), SharedGalleryImageVersionStorageProfile storageProfile = default(SharedGalleryImageVersionStorageProfile), string disclaimer = default(string), IDictionary artifactTags = default(IDictionary)) - : base(name, location, type, uniqueId) + + /// The unique id of this community gallery. + /// + + /// Resource name + /// + + /// Resource location + /// + + /// Resource type + /// + + /// The published date of the gallery image version Definition. This property + /// can be used for decommissioning purposes. This property is updatable. + /// + + /// The end of life date of the gallery image version Definition. This property + /// can be used for decommissioning purposes. This property is updatable. + /// + + /// If set to true, Virtual Machines deployed from the latest version of the + /// Image Definition won't use this Image Version. + /// + + /// Describes the storage profile of the image version. + /// + + /// The disclaimer for a community gallery resource. + /// + + /// The artifact tags of a community gallery resource. + /// + public CommunityGalleryImageVersion(string uniqueId = default(string), string name = default(string), string location = default(string), string type = default(string), System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? excludeFromLatest = default(bool?), SharedGalleryImageVersionStorageProfile storageProfile = default(SharedGalleryImageVersionStorageProfile), string disclaimer = default(string), System.Collections.Generic.IDictionary artifactTags = default(System.Collections.Generic.IDictionary)) + + : base(name, location, type, uniqueId) { - PublishedDate = publishedDate; - EndOfLifeDate = endOfLifeDate; - ExcludeFromLatest = excludeFromLatest; - StorageProfile = storageProfile; - Disclaimer = disclaimer; - ArtifactTags = artifactTags; + this.PublishedDate = publishedDate; + this.EndOfLifeDate = endOfLifeDate; + this.ExcludeFromLatest = excludeFromLatest; + this.StorageProfile = storageProfile; + this.Disclaimer = disclaimer; + this.ArtifactTags = artifactTags; CustomInit(); } @@ -74,47 +76,46 @@ public CommunityGalleryImageVersion() /// partial void CustomInit(); + /// - /// Gets or sets the published date of the gallery image version - /// Definition. This property can be used for decommissioning purposes. - /// This property is updatable. + /// Gets or sets the published date of the gallery image version Definition. + /// This property can be used for decommissioning purposes. This property is + /// updatable. /// - [JsonProperty(PropertyName = "properties.publishedDate")] - public System.DateTime? PublishedDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publishedDate")] + public System.DateTime? PublishedDate {get; set; } /// - /// Gets or sets the end of life date of the gallery image version - /// Definition. This property can be used for decommissioning purposes. - /// This property is updatable. + /// Gets or sets the end of life date of the gallery image version Definition. + /// This property can be used for decommissioning purposes. This property is + /// updatable. /// - [JsonProperty(PropertyName = "properties.endOfLifeDate")] - public System.DateTime? EndOfLifeDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.endOfLifeDate")] + public System.DateTime? EndOfLifeDate {get; set; } /// - /// Gets or sets if set to true, Virtual Machines deployed from the - /// latest version of the Image Definition won't use this Image - /// Version. + /// Gets or sets if set to true, Virtual Machines deployed from the latest + /// version of the Image Definition won't use this Image Version. /// - [JsonProperty(PropertyName = "properties.excludeFromLatest")] - public bool? ExcludeFromLatest { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.excludeFromLatest")] + public bool? ExcludeFromLatest {get; set; } /// /// Gets or sets describes the storage profile of the image version. /// - [JsonProperty(PropertyName = "properties.storageProfile")] - public SharedGalleryImageVersionStorageProfile StorageProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageProfile")] + public SharedGalleryImageVersionStorageProfile StorageProfile {get; set; } /// /// Gets or sets the disclaimer for a community gallery resource. /// - [JsonProperty(PropertyName = "properties.disclaimer")] - public string Disclaimer { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disclaimer")] + public string Disclaimer {get; set; } /// /// Gets or sets the artifact tags of a community gallery resource. /// - [JsonProperty(PropertyName = "properties.artifactTags")] - public IDictionary ArtifactTags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.artifactTags")] + public System.Collections.Generic.IDictionary ArtifactTags {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageVersionProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageVersionProperties.cs new file mode 100644 index 000000000000..312d2c4a4ac2 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryImageVersionProperties.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a gallery image version. + /// + public partial class CommunityGalleryImageVersionProperties + { + /// + /// Initializes a new instance of the CommunityGalleryImageVersionProperties class. + /// + public CommunityGalleryImageVersionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CommunityGalleryImageVersionProperties class. + /// + + /// The published date of the gallery image version Definition. This property + /// can be used for decommissioning purposes. This property is updatable. + /// + + /// The end of life date of the gallery image version Definition. This property + /// can be used for decommissioning purposes. This property is updatable. + /// + + /// If set to true, Virtual Machines deployed from the latest version of the + /// Image Definition won't use this Image Version. + /// + + /// Describes the storage profile of the image version. + /// + + /// The disclaimer for a community gallery resource. + /// + + /// The artifact tags of a community gallery resource. + /// + public CommunityGalleryImageVersionProperties(System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? excludeFromLatest = default(bool?), SharedGalleryImageVersionStorageProfile storageProfile = default(SharedGalleryImageVersionStorageProfile), string disclaimer = default(string), System.Collections.Generic.IDictionary artifactTags = default(System.Collections.Generic.IDictionary)) + + { + this.PublishedDate = publishedDate; + this.EndOfLifeDate = endOfLifeDate; + this.ExcludeFromLatest = excludeFromLatest; + this.StorageProfile = storageProfile; + this.Disclaimer = disclaimer; + this.ArtifactTags = artifactTags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the published date of the gallery image version Definition. + /// This property can be used for decommissioning purposes. This property is + /// updatable. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publishedDate")] + public System.DateTime? PublishedDate {get; set; } + + /// + /// Gets or sets the end of life date of the gallery image version Definition. + /// This property can be used for decommissioning purposes. This property is + /// updatable. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "endOfLifeDate")] + public System.DateTime? EndOfLifeDate {get; set; } + + /// + /// Gets or sets if set to true, Virtual Machines deployed from the latest + /// version of the Image Definition won't use this Image Version. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "excludeFromLatest")] + public bool? ExcludeFromLatest {get; set; } + + /// + /// Gets or sets describes the storage profile of the image version. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageProfile")] + public SharedGalleryImageVersionStorageProfile StorageProfile {get; set; } + + /// + /// Gets or sets the disclaimer for a community gallery resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disclaimer")] + public string Disclaimer {get; set; } + + /// + /// Gets or sets the artifact tags of a community gallery resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "artifactTags")] + public System.Collections.Generic.IDictionary ArtifactTags {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryInfo.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryInfo.cs index ec47ca47d6c2..5f13b009debb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryInfo.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryInfo.cs @@ -1,23 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Information of community gallery if current gallery is shared to - /// community + /// Information of community gallery if current gallery is shared to community /// public partial class CommunityGalleryInfo { @@ -32,27 +23,35 @@ public CommunityGalleryInfo() /// /// Initializes a new instance of the CommunityGalleryInfo class. /// - /// The link to the publisher website. - /// Visible to all users. - /// Community gallery publisher support - /// email. The email address of the publisher. Visible to all - /// users. - /// End-user license agreement for community gallery - /// image. - /// The prefix of the gallery name that - /// will be displayed publicly. Visible to all users. - /// Contains info about whether - /// community gallery sharing is enabled. - /// Community gallery public name - /// list. - public CommunityGalleryInfo(string publisherUri = default(string), string publisherContact = default(string), string eula = default(string), string publicNamePrefix = default(string), bool? communityGalleryEnabled = default(bool?), IList publicNames = default(IList)) + + /// The link to the publisher website. Visible to all users. + /// + + /// Community gallery publisher support email. The email address of the + /// publisher. Visible to all users. + /// + + /// End-user license agreement for community gallery image. + /// + + /// The prefix of the gallery name that will be displayed publicly. Visible to + /// all users. + /// + + /// Contains info about whether community gallery sharing is enabled. + /// + + /// Community gallery public name list. + /// + public CommunityGalleryInfo(string publisherUri = default(string), string publisherContact = default(string), string eula = default(string), string publicNamePrefix = default(string), bool? communityGalleryEnabled = default(bool?), System.Collections.Generic.IList publicNames = default(System.Collections.Generic.IList)) + { - PublisherUri = publisherUri; - PublisherContact = publisherContact; - Eula = eula; - PublicNamePrefix = publicNamePrefix; - CommunityGalleryEnabled = communityGalleryEnabled; - PublicNames = publicNames; + this.PublisherUri = publisherUri; + this.PublisherContact = publisherContact; + this.Eula = eula; + this.PublicNamePrefix = publicNamePrefix; + this.CommunityGalleryEnabled = communityGalleryEnabled; + this.PublicNames = publicNames; CustomInit(); } @@ -61,46 +60,43 @@ public CommunityGalleryInfo() /// partial void CustomInit(); + /// - /// Gets or sets the link to the publisher website. Visible to all - /// users. + /// Gets or sets the link to the publisher website. Visible to all users. /// - [JsonProperty(PropertyName = "publisherUri")] - public string PublisherUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publisherUri")] + public string PublisherUri {get; set; } /// - /// Gets or sets community gallery publisher support email. The email - /// address of the publisher. Visible to all users. + /// Gets or sets community gallery publisher support email. The email address + /// of the publisher. Visible to all users. /// - [JsonProperty(PropertyName = "publisherContact")] - public string PublisherContact { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publisherContact")] + public string PublisherContact {get; set; } /// - /// Gets or sets end-user license agreement for community gallery - /// image. + /// Gets or sets end-user license agreement for community gallery image. /// - [JsonProperty(PropertyName = "eula")] - public string Eula { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "eula")] + public string Eula {get; set; } /// /// Gets or sets the prefix of the gallery name that will be displayed /// publicly. Visible to all users. /// - [JsonProperty(PropertyName = "publicNamePrefix")] - public string PublicNamePrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publicNamePrefix")] + public string PublicNamePrefix {get; set; } /// - /// Gets contains info about whether community gallery sharing is - /// enabled. + /// Gets contains info about whether community gallery sharing is enabled. /// - [JsonProperty(PropertyName = "communityGalleryEnabled")] - public bool? CommunityGalleryEnabled { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "communityGalleryEnabled")] + public bool? CommunityGalleryEnabled {get; private set; } /// /// Gets community gallery public name list. /// - [JsonProperty(PropertyName = "publicNames")] - public IList PublicNames { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "publicNames")] + public System.Collections.Generic.IList PublicNames {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryMetadata.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryMetadata.cs index cecaf9fb97f3..ef6b590d1d62 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryMetadata.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryMetadata.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,24 +23,30 @@ public CommunityGalleryMetadata() /// /// Initializes a new instance of the CommunityGalleryMetadata class. /// - /// The publisher email id of this - /// community gallery. - /// A list of public names the gallery - /// has. - /// The publisher URI of this community - /// gallery. - /// The end-user license agreement for this - /// community gallery. - /// The link for the privacy - /// statement of this community gallery from the gallery - /// publisher. - public CommunityGalleryMetadata(string publisherContact, IList publicNames, string publisherUri = default(string), string eula = default(string), string privacyStatementUri = default(string)) + + /// The publisher URI of this community gallery. + /// + + /// The publisher email id of this community gallery. + /// + + /// The end-user license agreement for this community gallery. + /// + + /// A list of public names the gallery has. + /// + + /// The link for the privacy statement of this community gallery from the + /// gallery publisher. + /// + public CommunityGalleryMetadata(string publisherContact, System.Collections.Generic.IList publicNames, string publisherUri = default(string), string eula = default(string), string privacyStatementUri = default(string)) + { - PublisherUri = publisherUri; - PublisherContact = publisherContact; - Eula = eula; - PublicNames = publicNames; - PrivacyStatementUri = privacyStatementUri; + this.PublisherUri = publisherUri; + this.PublisherContact = publisherContact; + this.Eula = eula; + this.PublicNames = publicNames; + this.PrivacyStatementUri = privacyStatementUri; CustomInit(); } @@ -58,54 +55,58 @@ public CommunityGalleryMetadata() /// partial void CustomInit(); + /// /// Gets or sets the publisher URI of this community gallery. /// - [JsonProperty(PropertyName = "publisherUri")] - public string PublisherUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publisherUri")] + public string PublisherUri {get; set; } /// /// Gets or sets the publisher email id of this community gallery. /// - [JsonProperty(PropertyName = "publisherContact")] - public string PublisherContact { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publisherContact")] + public string PublisherContact {get; set; } /// - /// Gets or sets the end-user license agreement for this community - /// gallery. + /// Gets or sets the end-user license agreement for this community gallery. /// - [JsonProperty(PropertyName = "eula")] - public string Eula { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "eula")] + public string Eula {get; set; } /// /// Gets or sets a list of public names the gallery has. /// - [JsonProperty(PropertyName = "publicNames")] - public IList PublicNames { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publicNames")] + public System.Collections.Generic.IList PublicNames {get; set; } /// - /// Gets or sets the link for the privacy statement of this community - /// gallery from the gallery publisher. + /// Gets or sets the link for the privacy statement of this community gallery + /// from the gallery publisher. /// - [JsonProperty(PropertyName = "privacyStatementUri")] - public string PrivacyStatementUri { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "privacyStatementUri")] + public string PrivacyStatementUri {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (PublisherContact == null) + if (this.PublisherContact == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "PublisherContact"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PublisherContact"); } - if (PublicNames == null) + if (this.PublicNames == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "PublicNames"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PublicNames"); } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryProperties.cs new file mode 100644 index 000000000000..977455f58ea2 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CommunityGalleryProperties.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a community gallery. + /// + public partial class CommunityGalleryProperties + { + /// + /// Initializes a new instance of the CommunityGalleryProperties class. + /// + public CommunityGalleryProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CommunityGalleryProperties class. + /// + + /// The disclaimer for a community gallery resource. + /// + + /// The artifact tags of a community gallery resource. + /// + + /// The metadata of community gallery. + /// + public CommunityGalleryProperties(string disclaimer = default(string), System.Collections.Generic.IDictionary artifactTags = default(System.Collections.Generic.IDictionary), CommunityGalleryMetadata communityMetadata = default(CommunityGalleryMetadata)) + + { + this.Disclaimer = disclaimer; + this.ArtifactTags = artifactTags; + this.CommunityMetadata = communityMetadata; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the disclaimer for a community gallery resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disclaimer")] + public string Disclaimer {get; set; } + + /// + /// Gets or sets the artifact tags of a community gallery resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "artifactTags")] + public System.Collections.Generic.IDictionary ArtifactTags {get; set; } + + /// + /// Gets or sets the metadata of community gallery. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "communityMetadata")] + public CommunityGalleryMetadata CommunityMetadata {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + if (this.CommunityMetadata != null) + { + this.CommunityMetadata.Validate(); + } + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ComponentNames.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ComponentNames.cs index fa005a8109a2..4ba1cc7908bd 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ComponentNames.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ComponentNames.cs @@ -1,27 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for ComponentNames. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum ComponentNames { - [EnumMember(Value = "Microsoft-Windows-Shell-Setup")] + [System.Runtime.Serialization.EnumMember(Value = "Microsoft-Windows-Shell-Setup")] MicrosoftWindowsShellSetup } internal static class ComponentNamesEnumExtension @@ -30,7 +23,6 @@ internal static string ToSerializedValue(this ComponentNames? value) { return value == null ? null : ((ComponentNames)value).ToSerializedValue(); } - internal static string ToSerializedValue(this ComponentNames value) { switch( value ) @@ -40,7 +32,6 @@ internal static string ToSerializedValue(this ComponentNames value) } return null; } - internal static ComponentNames? ParseComponentNames(this string value) { switch( value ) @@ -51,4 +42,4 @@ internal static string ToSerializedValue(this ComponentNames value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ConfidentialVMEncryptionType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ConfidentialVMEncryptionType.cs index 50ce21c60793..896b7510fb44 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ConfidentialVMEncryptionType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ConfidentialVMEncryptionType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ConfidentialVMEncryptionType. /// + + public static class ConfidentialVMEncryptionType { public const string EncryptedVMGuestStateOnlyWithPmk = "EncryptedVMGuestStateOnlyWithPmk"; @@ -21,4 +18,4 @@ public static class ConfidentialVMEncryptionType public const string EncryptedWithCmk = "EncryptedWithCmk"; public const string NonPersistedTPM = "NonPersistedTPM"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ConsistencyModeTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ConsistencyModeTypes.cs index d00df066e779..d948a44059c6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ConsistencyModeTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ConsistencyModeTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ConsistencyModeTypes. /// + + public static class ConsistencyModeTypes { public const string CrashConsistent = "CrashConsistent"; public const string FileSystemConsistent = "FileSystemConsistent"; public const string ApplicationConsistent = "ApplicationConsistent"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ConvertToVirtualMachineScaleSetInput.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ConvertToVirtualMachineScaleSetInput.cs index d6d01e3d98cd..a3636b915450 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ConvertToVirtualMachineScaleSetInput.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ConvertToVirtualMachineScaleSetInput.cs @@ -1,27 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Describes the Virtual Machine Scale Set to convert from Availability - /// Set. + /// Describes the Virtual Machine Scale Set to convert from Availability Set. /// public partial class ConvertToVirtualMachineScaleSetInput { /// - /// Initializes a new instance of the - /// ConvertToVirtualMachineScaleSetInput class. + /// Initializes a new instance of the ConvertToVirtualMachineScaleSetInput class. /// public ConvertToVirtualMachineScaleSetInput() { @@ -29,15 +21,16 @@ public ConvertToVirtualMachineScaleSetInput() } /// - /// Initializes a new instance of the - /// ConvertToVirtualMachineScaleSetInput class. + /// Initializes a new instance of the ConvertToVirtualMachineScaleSetInput class. /// - /// Specifies information - /// about the Virtual Machine Scale Set that the Availability Set - /// should be converted to. + + /// Specifies information about the Virtual Machine Scale Set that the + /// Availability Set should be converted to. + /// public ConvertToVirtualMachineScaleSetInput(string virtualMachineScaleSetName = default(string)) + { - VirtualMachineScaleSetName = virtualMachineScaleSetName; + this.VirtualMachineScaleSetName = virtualMachineScaleSetName; CustomInit(); } @@ -46,12 +39,12 @@ public ConvertToVirtualMachineScaleSetInput() /// partial void CustomInit(); + /// - /// Gets or sets specifies information about the Virtual Machine Scale - /// Set that the Availability Set should be converted to. + /// Gets or sets specifies information about the Virtual Machine Scale Set that + /// the Availability Set should be converted to. /// - [JsonProperty(PropertyName = "virtualMachineScaleSetName")] - public string VirtualMachineScaleSetName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachineScaleSetName")] + public string VirtualMachineScaleSetName {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CopyCompletionError.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CopyCompletionError.cs index 1f445732ceec..7f4dc37c5c66 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CopyCompletionError.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CopyCompletionError.cs @@ -1,22 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// - /// Indicates the error details if the background copy of a resource - /// created via the CopyStart operation fails. + /// Indicates the error details if the background copy of a resource created + /// via the CopyStart operation fails. /// public partial class CopyCompletionError { @@ -31,12 +24,14 @@ public CopyCompletionError() /// /// Initializes a new instance of the CopyCompletionError class. /// - /// Indicates the error message if the - /// background copy of a resource created via the CopyStart operation - /// fails. + + /// Indicates the error message if the background copy of a resource created + /// via the CopyStart operation fails. + /// public CopyCompletionError(string errorMessage) + { - ErrorMessage = errorMessage; + this.ErrorMessage = errorMessage; CustomInit(); } /// @@ -52,32 +47,32 @@ static CopyCompletionError() /// partial void CustomInit(); + /// - /// Gets or sets indicates the error message if the background copy of - /// a resource created via the CopyStart operation fails. + /// Gets or sets indicates the error message if the background copy of a + /// resource created via the CopyStart operation fails. /// - [JsonProperty(PropertyName = "errorMessage")] - public string ErrorMessage { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "errorMessage")] + public string ErrorMessage {get; set; } /// - /// Indicates the error code if the background copy of a resource - /// created via the CopyStart operation fails. + /// Gets or sets indicates the error code if the background copy of a resource created via the CopyStart operation fails. /// - [JsonProperty(PropertyName = "errorCode")] - public static string ErrorCode { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "errorCode")] + public static string ErrorCode {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ErrorMessage == null) + if (this.ErrorMessage == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ErrorMessage"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ErrorMessage"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CopyCompletionErrorReason.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CopyCompletionErrorReason.cs index e7bb79f42e13..18cfb86ed41a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CopyCompletionErrorReason.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CopyCompletionErrorReason.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,13 +9,14 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for CopyCompletionErrorReason. /// + + public static class CopyCompletionErrorReason { /// - /// Indicates that the source snapshot was deleted while the background - /// copy of the resource created via CopyStart operation was in - /// progress. + /// Indicates that the source snapshot was deleted while the background copy of + /// the resource created via CopyStart operation was in progress. /// public const string CopySourceNotFound = "CopySourceNotFound"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CreatedByType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CreatedByType.cs index 0d5f2c86410c..2a7cf101942d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CreatedByType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CreatedByType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for CreatedByType. /// + + public static class CreatedByType { public const string User = "User"; @@ -21,4 +18,4 @@ public static class CreatedByType public const string ManagedIdentity = "ManagedIdentity"; public const string Key = "Key"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/CreationData.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/CreationData.cs index ed2d7c36a969..9f9e3b4d775a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/CreationData.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/CreationData.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,71 +23,89 @@ public CreationData() /// /// Initializes a new instance of the CreationData class. /// - /// This enumerates the possible sources of - /// a disk's creation. Possible values include: 'Empty', 'Attach', - /// 'FromImage', 'Import', 'Copy', 'Restore', 'Upload', 'CopyStart', - /// 'ImportSecure', 'UploadPreparedSecure', - /// 'CopyFromSanSnapshot' - /// Required if createOption is Import. - /// The Azure Resource Manager identifier of the storage account - /// containing the blob to import as a disk. - /// Disk source information for PIR or - /// user images. - /// Required if creating from a - /// Gallery Image. The id/sharedGalleryImageId/communityGalleryImageId - /// of the ImageDiskReference will be the ARM id of the shared galley - /// image version from which to create a disk. - /// If createOption is Import, this is the URI - /// of a blob to be imported into a managed disk. - /// If createOption is Copy, this is the - /// ARM id of the source snapshot or disk. - /// If this field is set, this is the - /// unique id identifying the source of this resource. - /// If createOption is Upload, this is - /// the size of the contents of the upload including the VHD footer. - /// This value should be between 20972032 (20 MiB + 512 bytes for the - /// VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes for the - /// VHD footer). - /// Logical sector size in bytes for - /// Ultra disks. Supported values are 512 ad 4096. 4096 is the - /// default. - /// If createOption is ImportSecure, this - /// is the URI of a blob to be imported into VM guest state. - /// If createOption is ImportSecure, - /// this is the URI of a blob to be imported into VM metadata for - /// Confidential VM. - /// Set this flag to true to get a boost - /// on the performance target of the disk deployed, see here on the - /// respective performance target. This flag can only be set on disk - /// creation time and cannot be disabled after enabled. - /// Required if createOption is - /// CopyFromSanSnapshot. This is the ARM id of the source elastic san - /// volume snapshot. - /// If this field is set on - /// a snapshot and createOption is CopyStart, the snapshot will be - /// copied at a quicker speed. Possible values include: 'None', - /// 'Enhanced' - /// For snapshots created - /// from Premium SSD v2 or Ultra disk, this property determines the - /// time in minutes the snapshot is retained for instant access to - /// enable faster restore. + + /// This enumerates the possible sources of a disk's creation. + /// Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', + /// 'Restore', 'Upload', 'CopyStart', 'ImportSecure', 'UploadPreparedSecure', + /// 'CopyFromSanSnapshot' + + /// Required if createOption is Import. The Azure Resource Manager identifier + /// of the storage account containing the blob to import as a disk. + /// + + /// Disk source information for PIR or user images. + /// + + /// Required if creating from a Gallery Image. The + /// id/sharedGalleryImageId/communityGalleryImageId of the ImageDiskReference + /// will be the ARM id of the shared galley image version from which to create + /// a disk. + /// + + /// If createOption is Import, this is the URI of a blob to be imported into a + /// managed disk. + /// + + /// If createOption is Copy, this is the ARM id of the source snapshot or disk. + /// + + /// If this field is set, this is the unique id identifying the source of this + /// resource. + /// + + /// If createOption is Upload, this is the size of the contents of the upload + /// including the VHD footer. This value should be between 20972032 (20 MiB + + /// 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes + /// for the VHD footer). + /// + + /// Logical sector size in bytes for Ultra disks. Supported values are 512 ad + /// 4096. 4096 is the default. + /// + + /// If createOption is ImportSecure, this is the URI of a blob to be imported + /// into VM guest state. + /// + + /// If createOption is ImportSecure, this is the URI of a blob to be imported + /// into VM metadata for Confidential VM. + /// + + /// Set this flag to true to get a boost on the performance target of the disk + /// deployed, see here on the respective performance target. This flag can only + /// be set on disk creation time and cannot be disabled after enabled. + /// + + /// Required if createOption is CopyFromSanSnapshot. This is the ARM id of the + /// source elastic san volume snapshot. + /// + + /// If this field is set on a snapshot and createOption is CopyStart, the + /// snapshot will be copied at a quicker speed. + /// Possible values include: 'None', 'Enhanced' + + /// For snapshots created from Premium SSD v2 or Ultra disk, this property + /// determines the time in minutes the snapshot is retained for instant access + /// to enable faster restore. + /// public CreationData(string createOption, string storageAccountId = default(string), ImageDiskReference imageReference = default(ImageDiskReference), ImageDiskReference galleryImageReference = default(ImageDiskReference), string sourceUri = default(string), string sourceResourceId = default(string), string sourceUniqueId = default(string), long? uploadSizeBytes = default(long?), int? logicalSectorSize = default(int?), string securityDataUri = default(string), string securityMetadataUri = default(string), bool? performancePlus = default(bool?), string elasticSanResourceId = default(string), string provisionedBandwidthCopySpeed = default(string), long? instantAccessDurationMinutes = default(long?)) + { - CreateOption = createOption; - StorageAccountId = storageAccountId; - ImageReference = imageReference; - GalleryImageReference = galleryImageReference; - SourceUri = sourceUri; - SourceResourceId = sourceResourceId; - SourceUniqueId = sourceUniqueId; - UploadSizeBytes = uploadSizeBytes; - LogicalSectorSize = logicalSectorSize; - SecurityDataUri = securityDataUri; - SecurityMetadataUri = securityMetadataUri; - PerformancePlus = performancePlus; - ElasticSanResourceId = elasticSanResourceId; - ProvisionedBandwidthCopySpeed = provisionedBandwidthCopySpeed; - InstantAccessDurationMinutes = instantAccessDurationMinutes; + this.CreateOption = createOption; + this.StorageAccountId = storageAccountId; + this.ImageReference = imageReference; + this.GalleryImageReference = galleryImageReference; + this.SourceUri = sourceUri; + this.SourceResourceId = sourceResourceId; + this.SourceUniqueId = sourceUniqueId; + this.UploadSizeBytes = uploadSizeBytes; + this.LogicalSectorSize = logicalSectorSize; + this.SecurityDataUri = securityDataUri; + this.SecurityMetadataUri = securityMetadataUri; + this.PerformancePlus = performancePlus; + this.ElasticSanResourceId = elasticSanResourceId; + this.ProvisionedBandwidthCopySpeed = provisionedBandwidthCopySpeed; + this.InstantAccessDurationMinutes = instantAccessDurationMinutes; CustomInit(); } @@ -103,140 +114,146 @@ public CreationData() /// partial void CustomInit(); + /// - /// Gets or sets this enumerates the possible sources of a disk's - /// creation. Possible values include: 'Empty', 'Attach', 'FromImage', - /// 'Import', 'Copy', 'Restore', 'Upload', 'CopyStart', 'ImportSecure', - /// 'UploadPreparedSecure', 'CopyFromSanSnapshot' + /// Gets or sets this enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore', 'Upload', 'CopyStart', 'ImportSecure', 'UploadPreparedSecure', 'CopyFromSanSnapshot' /// - [JsonProperty(PropertyName = "createOption")] - public string CreateOption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createOption")] + public string CreateOption {get; set; } /// - /// Gets or sets required if createOption is Import. The Azure Resource - /// Manager identifier of the storage account containing the blob to - /// import as a disk. + /// Gets or sets required if createOption is Import. The Azure Resource Manager + /// identifier of the storage account containing the blob to import as a disk. /// - [JsonProperty(PropertyName = "storageAccountId")] - public string StorageAccountId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountId")] + public string StorageAccountId {get; set; } /// /// Gets or sets disk source information for PIR or user images. /// - [JsonProperty(PropertyName = "imageReference")] - public ImageDiskReference ImageReference { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "imageReference")] + public ImageDiskReference ImageReference {get; set; } /// /// Gets or sets required if creating from a Gallery Image. The - /// id/sharedGalleryImageId/communityGalleryImageId of the - /// ImageDiskReference will be the ARM id of the shared galley image - /// version from which to create a disk. + /// id/sharedGalleryImageId/communityGalleryImageId of the ImageDiskReference + /// will be the ARM id of the shared galley image version from which to create + /// a disk. /// - [JsonProperty(PropertyName = "galleryImageReference")] - public ImageDiskReference GalleryImageReference { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "galleryImageReference")] + public ImageDiskReference GalleryImageReference {get; set; } /// - /// Gets or sets if createOption is Import, this is the URI of a blob - /// to be imported into a managed disk. + /// Gets or sets if createOption is Import, this is the URI of a blob to be + /// imported into a managed disk. /// - [JsonProperty(PropertyName = "sourceUri")] - public string SourceUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceUri")] + public string SourceUri {get; set; } /// - /// Gets or sets if createOption is Copy, this is the ARM id of the - /// source snapshot or disk. + /// Gets or sets if createOption is Copy, this is the ARM id of the source + /// snapshot or disk. /// - [JsonProperty(PropertyName = "sourceResourceId")] - public string SourceResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceResourceId")] + public string SourceResourceId {get; set; } /// - /// Gets if this field is set, this is the unique id identifying the - /// source of this resource. + /// Gets if this field is set, this is the unique id identifying the source of + /// this resource. /// - [JsonProperty(PropertyName = "sourceUniqueId")] - public string SourceUniqueId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceUniqueId")] + public string SourceUniqueId {get; private set; } /// - /// Gets or sets if createOption is Upload, this is the size of the - /// contents of the upload including the VHD footer. This value should - /// be between 20972032 (20 MiB + 512 bytes for the VHD footer) and - /// 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). + /// Gets or sets if createOption is Upload, this is the size of the contents of + /// the upload including the VHD footer. This value should be between 20972032 + /// (20 MiB + 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB + + /// 512 bytes for the VHD footer). /// - [JsonProperty(PropertyName = "uploadSizeBytes")] - public long? UploadSizeBytes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "uploadSizeBytes")] + public long? UploadSizeBytes {get; set; } /// - /// Gets or sets logical sector size in bytes for Ultra disks. - /// Supported values are 512 ad 4096. 4096 is the default. + /// Gets or sets logical sector size in bytes for Ultra disks. Supported values + /// are 512 ad 4096. 4096 is the default. /// - [JsonProperty(PropertyName = "logicalSectorSize")] - public int? LogicalSectorSize { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "logicalSectorSize")] + public int? LogicalSectorSize {get; set; } /// - /// Gets or sets if createOption is ImportSecure, this is the URI of a - /// blob to be imported into VM guest state. + /// Gets or sets if createOption is ImportSecure, this is the URI of a blob to + /// be imported into VM guest state. /// - [JsonProperty(PropertyName = "securityDataUri")] - public string SecurityDataUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "securityDataUri")] + public string SecurityDataUri {get; set; } /// - /// Gets or sets if createOption is ImportSecure, this is the URI of a - /// blob to be imported into VM metadata for Confidential VM. + /// Gets or sets if createOption is ImportSecure, this is the URI of a blob to + /// be imported into VM metadata for Confidential VM. /// - [JsonProperty(PropertyName = "securityMetadataUri")] - public string SecurityMetadataUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "securityMetadataUri")] + public string SecurityMetadataUri {get; set; } /// - /// Gets or sets set this flag to true to get a boost on the - /// performance target of the disk deployed, see here on the respective - /// performance target. This flag can only be set on disk creation time - /// and cannot be disabled after enabled. + /// Gets or sets set this flag to true to get a boost on the performance target + /// of the disk deployed, see here on the respective performance target. This + /// flag can only be set on disk creation time and cannot be disabled after + /// enabled. /// - [JsonProperty(PropertyName = "performancePlus")] - public bool? PerformancePlus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "performancePlus")] + public bool? PerformancePlus {get; set; } /// - /// Gets or sets required if createOption is CopyFromSanSnapshot. This - /// is the ARM id of the source elastic san volume snapshot. + /// Gets or sets required if createOption is CopyFromSanSnapshot. This is the + /// ARM id of the source elastic san volume snapshot. /// - [JsonProperty(PropertyName = "elasticSanResourceId")] - public string ElasticSanResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "elasticSanResourceId")] + public string ElasticSanResourceId {get; set; } /// /// Gets or sets if this field is set on a snapshot and createOption is - /// CopyStart, the snapshot will be copied at a quicker speed. Possible - /// values include: 'None', 'Enhanced' + /// CopyStart, the snapshot will be copied at a quicker speed. Possible values include: 'None', 'Enhanced' /// - [JsonProperty(PropertyName = "provisionedBandwidthCopySpeed")] - public string ProvisionedBandwidthCopySpeed { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "provisionedBandwidthCopySpeed")] + public string ProvisionedBandwidthCopySpeed {get; set; } /// - /// Gets or sets for snapshots created from Premium SSD v2 or Ultra - /// disk, this property determines the time in minutes the snapshot is - /// retained for instant access to enable faster restore. + /// Gets or sets for snapshots created from Premium SSD v2 or Ultra disk, this + /// property determines the time in minutes the snapshot is retained for + /// instant access to enable faster restore. /// - [JsonProperty(PropertyName = "instantAccessDurationMinutes")] - public long? InstantAccessDurationMinutes { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "instantAccessDurationMinutes")] + public long? InstantAccessDurationMinutes {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (CreateOption == null) + if (this.CreateOption == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "CreateOption"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CreateOption"); } - if (InstantAccessDurationMinutes != null) + + + + + + + + + + + + if (this.InstantAccessDurationMinutes != null) { - if (InstantAccessDurationMinutes < 1) + if (this.InstantAccessDurationMinutes < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "InstantAccessDurationMinutes", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "InstantAccessDurationMinutes", 1); } } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DataAccessAuthMode.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DataAccessAuthMode.cs index 8c7876ce51ba..fe302f1de191 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DataAccessAuthMode.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DataAccessAuthMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,12 +9,14 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for DataAccessAuthMode. /// + + public static class DataAccessAuthMode { /// - /// When export/upload URL is used, the system checks if the user has - /// an identity in Azure Active Directory and has necessary permissions - /// to export/upload the data. Please refer to aka.ms/DisksAzureADAuth. + /// When export/upload URL is used, the system checks if the user has an + /// identity in Azure Active Directory and has necessary permissions to + /// export/upload the data. Please refer to aka.ms/DisksAzureADAuth. /// public const string AzureActiveDirectory = "AzureActiveDirectory"; /// @@ -28,4 +25,4 @@ public static class DataAccessAuthMode /// public const string None = "None"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DataDisk.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DataDisk.cs index a9775b05d134..1db94b082189 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DataDisk.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DataDisk.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,93 +23,108 @@ public DataDisk() /// /// Initializes a new instance of the DataDisk class. /// - /// Specifies the logical unit number of the data - /// disk. This value is used to identify data disks within the VM and - /// therefore must be unique for each data disk attached to a - /// VM. - /// Specifies how the virtual machine disk - /// should be created. Possible values are **Attach:** This value is - /// used when you are using a specialized disk to create the virtual - /// machine. **FromImage:** This value is used when you are using an - /// image to create the virtual machine data disk. If you are using a - /// platform image, you should also use the imageReference element - /// described above. If you are using a marketplace image, you should - /// also use the plan element previously described. **Empty:** This - /// value is used when creating an empty data disk. **Copy:** This - /// value is used to create a data disk from a snapshot or another - /// disk. **Restore:** This value is used to create a data disk from a - /// disk restore point. Possible values include: 'FromImage', 'Empty', - /// 'Attach', 'Copy', 'Restore' - /// The disk name. - /// The virtual hard disk. - /// The source user image virtual hard disk. The - /// virtual hard disk will be copied before being attached to the - /// virtual machine. If SourceImage is provided, the destination - /// virtual hard drive must not exist. - /// Specifies the caching requirements. Possible - /// values are: **None,** **ReadOnly,** **ReadWrite.** The defaulting - /// behavior is: **None for Standard storage. ReadOnly for Premium - /// storage.**. Possible values include: 'None', 'ReadOnly', - /// 'ReadWrite' - /// Specifies whether - /// writeAccelerator should be enabled or disabled on the disk. - /// Specifies the size of an empty data disk - /// in gigabytes. This element can be used to overwrite the size of the - /// disk in a virtual machine image. The property 'diskSizeGB' is the - /// number of bytes x 1024^3 for the disk and the value cannot be - /// larger than 1023. - /// The managed disk parameters. - /// The source resource identifier. It can - /// be a snapshot, or disk restore point from which to create a - /// disk. - /// Specifies whether the data disk is in - /// process of detachment from the - /// VirtualMachine/VirtualMachineScaleset - /// Specifies the Read-Write IOPS for - /// the managed disk when StorageAccountType is UltraSSD_LRS. Returned - /// only for VirtualMachine ScaleSet VM disks. Can be updated only via - /// updates to the VirtualMachine Scale Set. - /// Specifies the bandwidth in MB per - /// second for the managed disk when StorageAccountType is - /// UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. - /// Can be updated only via updates to the VirtualMachine Scale - /// Set. - /// Specifies the detach behavior to be used - /// while detaching a disk or which is already in the process of - /// detachment from the virtual machine. Supported values: - /// **ForceDetach.** detachOption: **ForceDetach** is applicable only - /// for managed data disks. If a previous detachment attempt of the - /// data disk did not complete due to an unexpected failure from the - /// virtual machine and the disk is still not released then use - /// force-detach as a last resort option to detach the disk forcibly - /// from the VM. All writes might not have been flushed when using this - /// detach behavior. **This feature is still in preview**. To - /// force-detach a data disk update toBeDetached to 'true' along with - /// setting detachOption: 'ForceDetach'. Possible values include: - /// 'ForceDetach' - /// Specifies whether data disk should be - /// deleted or detached upon VM deletion. Possible values are: - /// **Delete.** If this value is used, the data disk is deleted when VM - /// is deleted. **Detach.** If this value is used, the data disk is - /// retained after VM is deleted. The default value is set to - /// **Detach**. Possible values include: 'Delete', 'Detach' - public DataDisk(int lun, string createOption, string name = default(string), VirtualHardDisk vhd = default(VirtualHardDisk), VirtualHardDisk image = default(VirtualHardDisk), CachingTypes? caching = default(CachingTypes?), bool? writeAcceleratorEnabled = default(bool?), int? diskSizeGB = default(int?), ManagedDiskParameters managedDisk = default(ManagedDiskParameters), ApiEntityReference sourceResource = default(ApiEntityReference), bool? toBeDetached = default(bool?), long? diskIOPSReadWrite = default(long?), long? diskMBpsReadWrite = default(long?), string detachOption = default(string), string deleteOption = default(string)) + + /// Specifies the logical unit number of the data disk. This value is used to + /// identify data disks within the VM and therefore must be unique for each + /// data disk attached to a VM. + /// + + /// The disk name. + /// + + /// The virtual hard disk. + /// + + /// The source user image virtual hard disk. The virtual hard disk will be + /// copied before being attached to the virtual machine. If SourceImage is + /// provided, the destination virtual hard drive must not exist. + /// + + /// Specifies the caching requirements. Possible values are: **None,** + /// **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None for + /// Standard storage. ReadOnly for Premium storage.** + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + + /// Specifies whether writeAccelerator should be enabled or disabled on the + /// disk. + /// + + /// Specifies how the virtual machine disk should be created. Possible values + /// are **Attach:** This value is used when you are using a specialized disk to + /// create the virtual machine. **FromImage:** This value is used when you are + /// using an image to create the virtual machine data disk. If you are using a + /// platform image, you should also use the imageReference element described + /// above. If you are using a marketplace image, you should also use the plan + /// element previously described. **Empty:** This value is used when creating + /// an empty data disk. **Copy:** This value is used to create a data disk from + /// a snapshot or another disk. **Restore:** This value is used to create a + /// data disk from a disk restore point. + /// Possible values include: 'FromImage', 'Empty', 'Attach', 'Copy', 'Restore' + + /// Specifies the size of an empty data disk in gigabytes. This element can be + /// used to overwrite the size of the disk in a virtual machine image. The + /// property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the + /// value cannot be larger than 1023. + /// + + /// The managed disk parameters. + /// + + /// The source resource identifier. It can be a snapshot, or disk restore point + /// from which to create a disk. + /// + + /// Specifies whether the data disk is in process of detachment from the + /// VirtualMachine/VirtualMachineScaleset + /// + + /// Specifies the Read-Write IOPS for the managed disk when StorageAccountType + /// is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be + /// updated only via updates to the VirtualMachine Scale Set. + /// + + /// Specifies the bandwidth in MB per second for the managed disk when + /// StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine + /// ScaleSet VM disks. Can be updated only via updates to the VirtualMachine + /// Scale Set. + /// + + /// Specifies the detach behavior to be used while detaching a disk or which is + /// already in the process of detachment from the virtual machine. Supported + /// values: **ForceDetach.** detachOption: **ForceDetach** is applicable only + /// for managed data disks. If a previous detachment attempt of the data disk + /// did not complete due to an unexpected failure from the virtual machine and + /// the disk is still not released then use force-detach as a last resort + /// option to detach the disk forcibly from the VM. All writes might not have + /// been flushed when using this detach behavior. **This feature is still in + /// preview**. To force-detach a data disk update toBeDetached to 'true' along + /// with setting detachOption: 'ForceDetach'. + /// Possible values include: 'ForceDetach' + + /// Specifies whether data disk should be deleted or detached upon VM deletion. + /// Possible values are: **Delete.** If this value is used, the data disk is + /// deleted when VM is deleted. **Detach.** If this value is used, the data + /// disk is retained after VM is deleted. The default value is set to + /// **Detach**. + /// Possible values include: 'Delete', 'Detach' + public DataDisk(int lun, string createOption, string name = default(string), VirtualHardDisk vhd = default(VirtualHardDisk), VirtualHardDisk image = default(VirtualHardDisk), CachingTypes? caching = default(CachingTypes?), bool? writeAcceleratorEnabled = default(bool?), int? diskSizeGb = default(int?), ManagedDiskParameters managedDisk = default(ManagedDiskParameters), ApiEntityReference sourceResource = default(ApiEntityReference), bool? toBeDetached = default(bool?), long? diskIopsReadWrite = default(long?), long? diskMBpsReadWrite = default(long?), string detachOption = default(string), string deleteOption = default(string)) + { - Lun = lun; - Name = name; - Vhd = vhd; - Image = image; - Caching = caching; - WriteAcceleratorEnabled = writeAcceleratorEnabled; - CreateOption = createOption; - DiskSizeGB = diskSizeGB; - ManagedDisk = managedDisk; - SourceResource = sourceResource; - ToBeDetached = toBeDetached; - DiskIOPSReadWrite = diskIOPSReadWrite; - DiskMBpsReadWrite = diskMBpsReadWrite; - DetachOption = detachOption; - DeleteOption = deleteOption; + this.Lun = lun; + this.Name = name; + this.Vhd = vhd; + this.Image = image; + this.Caching = caching; + this.WriteAcceleratorEnabled = writeAcceleratorEnabled; + this.CreateOption = createOption; + this.DiskSizeGB = diskSizeGb; + this.ManagedDisk = managedDisk; + this.SourceResource = sourceResource; + this.ToBeDetached = toBeDetached; + this.DiskIOPSReadWrite = diskIopsReadWrite; + this.DiskMBpsReadWrite = diskMBpsReadWrite; + this.DetachOption = detachOption; + this.DeleteOption = deleteOption; CustomInit(); } @@ -125,157 +133,158 @@ public DataDisk() /// partial void CustomInit(); + /// - /// Gets or sets specifies the logical unit number of the data disk. - /// This value is used to identify data disks within the VM and - /// therefore must be unique for each data disk attached to a VM. + /// Gets or sets specifies the logical unit number of the data disk. This value + /// is used to identify data disks within the VM and therefore must be unique + /// for each data disk attached to a VM. /// - [JsonProperty(PropertyName = "lun")] - public int Lun { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lun")] + public int Lun {get; set; } /// /// Gets or sets the disk name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the virtual hard disk. /// - [JsonProperty(PropertyName = "vhd")] - public VirtualHardDisk Vhd { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vhd")] + public VirtualHardDisk Vhd {get; set; } /// - /// Gets or sets the source user image virtual hard disk. The virtual - /// hard disk will be copied before being attached to the virtual - /// machine. If SourceImage is provided, the destination virtual hard - /// drive must not exist. + /// Gets or sets the source user image virtual hard disk. The virtual hard disk + /// will be copied before being attached to the virtual machine. If SourceImage + /// is provided, the destination virtual hard drive must not exist. /// - [JsonProperty(PropertyName = "image")] - public VirtualHardDisk Image { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "image")] + public VirtualHardDisk Image {get; set; } /// - /// Gets or sets specifies the caching requirements. Possible values - /// are: **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior - /// is: **None for Standard storage. ReadOnly for Premium storage.**. - /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + /// Gets or sets specifies the caching requirements. Possible values are: + /// **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None + /// for Standard storage. ReadOnly for Premium storage.** Possible values include: 'None', 'ReadOnly', 'ReadWrite' /// - [JsonProperty(PropertyName = "caching")] - public CachingTypes? Caching { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "caching")] + public CachingTypes? Caching {get; set; } /// - /// Gets or sets specifies whether writeAccelerator should be enabled - /// or disabled on the disk. + /// Gets or sets specifies whether writeAccelerator should be enabled or + /// disabled on the disk. /// - [JsonProperty(PropertyName = "writeAcceleratorEnabled")] - public bool? WriteAcceleratorEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "writeAcceleratorEnabled")] + public bool? WriteAcceleratorEnabled {get; set; } /// - /// Gets or sets specifies how the virtual machine disk should be - /// created. Possible values are **Attach:** This value is used when - /// you are using a specialized disk to create the virtual machine. - /// **FromImage:** This value is used when you are using an image to - /// create the virtual machine data disk. If you are using a platform - /// image, you should also use the imageReference element described - /// above. If you are using a marketplace image, you should also use - /// the plan element previously described. **Empty:** This value is - /// used when creating an empty data disk. **Copy:** This value is used - /// to create a data disk from a snapshot or another disk. **Restore:** - /// This value is used to create a data disk from a disk restore point. - /// Possible values include: 'FromImage', 'Empty', 'Attach', 'Copy', - /// 'Restore' + /// Gets or sets specifies how the virtual machine disk should be created. + /// Possible values are **Attach:** This value is used when you are using a + /// specialized disk to create the virtual machine. **FromImage:** This value + /// is used when you are using an image to create the virtual machine data + /// disk. If you are using a platform image, you should also use the + /// imageReference element described above. If you are using a marketplace + /// image, you should also use the plan element previously described. + /// **Empty:** This value is used when creating an empty data disk. **Copy:** + /// This value is used to create a data disk from a snapshot or another disk. + /// **Restore:** This value is used to create a data disk from a disk restore + /// point. Possible values include: 'FromImage', 'Empty', 'Attach', 'Copy', 'Restore' /// - [JsonProperty(PropertyName = "createOption")] - public string CreateOption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createOption")] + public string CreateOption {get; set; } /// - /// Gets or sets specifies the size of an empty data disk in gigabytes. - /// This element can be used to overwrite the size of the disk in a - /// virtual machine image. The property 'diskSizeGB' is the number of - /// bytes x 1024^3 for the disk and the value cannot be larger than - /// 1023. + /// Gets or sets specifies the size of an empty data disk in gigabytes. This + /// element can be used to overwrite the size of the disk in a virtual machine + /// image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the + /// disk and the value cannot be larger than 1023. /// - [JsonProperty(PropertyName = "diskSizeGB")] - public int? DiskSizeGB { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeGB")] + public int? DiskSizeGB {get; set; } /// /// Gets or sets the managed disk parameters. /// - [JsonProperty(PropertyName = "managedDisk")] - public ManagedDiskParameters ManagedDisk { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managedDisk")] + public ManagedDiskParameters ManagedDisk {get; set; } /// - /// Gets or sets the source resource identifier. It can be a snapshot, - /// or disk restore point from which to create a disk. + /// Gets or sets the source resource identifier. It can be a snapshot, or disk + /// restore point from which to create a disk. /// - [JsonProperty(PropertyName = "sourceResource")] - public ApiEntityReference SourceResource { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceResource")] + public ApiEntityReference SourceResource {get; set; } /// - /// Gets or sets specifies whether the data disk is in process of - /// detachment from the VirtualMachine/VirtualMachineScaleset + /// Gets or sets specifies whether the data disk is in process of detachment + /// from the VirtualMachine/VirtualMachineScaleset /// - [JsonProperty(PropertyName = "toBeDetached")] - public bool? ToBeDetached { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "toBeDetached")] + public bool? ToBeDetached {get; set; } /// /// Gets specifies the Read-Write IOPS for the managed disk when - /// StorageAccountType is UltraSSD_LRS. Returned only for - /// VirtualMachine ScaleSet VM disks. Can be updated only via updates - /// to the VirtualMachine Scale Set. + /// StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine + /// ScaleSet VM disks. Can be updated only via updates to the VirtualMachine + /// Scale Set. /// - [JsonProperty(PropertyName = "diskIOPSReadWrite")] - public long? DiskIOPSReadWrite { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskIOPSReadWrite")] + public long? DiskIOPSReadWrite {get; private set; } /// - /// Gets specifies the bandwidth in MB per second for the managed disk - /// when StorageAccountType is UltraSSD_LRS. Returned only for - /// VirtualMachine ScaleSet VM disks. Can be updated only via updates - /// to the VirtualMachine Scale Set. + /// Gets specifies the bandwidth in MB per second for the managed disk when + /// StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine + /// ScaleSet VM disks. Can be updated only via updates to the VirtualMachine + /// Scale Set. /// - [JsonProperty(PropertyName = "diskMBpsReadWrite")] - public long? DiskMBpsReadWrite { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskMBpsReadWrite")] + public long? DiskMBpsReadWrite {get; private set; } /// - /// Gets or sets specifies the detach behavior to be used while - /// detaching a disk or which is already in the process of detachment - /// from the virtual machine. Supported values: **ForceDetach.** - /// detachOption: **ForceDetach** is applicable only for managed data - /// disks. If a previous detachment attempt of the data disk did not - /// complete due to an unexpected failure from the virtual machine and - /// the disk is still not released then use force-detach as a last - /// resort option to detach the disk forcibly from the VM. All writes - /// might not have been flushed when using this detach behavior. **This - /// feature is still in preview**. To force-detach a data disk update - /// toBeDetached to 'true' along with setting detachOption: - /// 'ForceDetach'. Possible values include: 'ForceDetach' + /// Gets or sets specifies the detach behavior to be used while detaching a + /// disk or which is already in the process of detachment from the virtual + /// machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** + /// is applicable only for managed data disks. If a previous detachment attempt + /// of the data disk did not complete due to an unexpected failure from the + /// virtual machine and the disk is still not released then use force-detach as + /// a last resort option to detach the disk forcibly from the VM. All writes + /// might not have been flushed when using this detach behavior. **This feature + /// is still in preview**. To force-detach a data disk update toBeDetached to + /// 'true' along with setting detachOption: 'ForceDetach'. Possible values include: 'ForceDetach' /// - [JsonProperty(PropertyName = "detachOption")] - public string DetachOption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "detachOption")] + public string DetachOption {get; set; } /// - /// Gets or sets specifies whether data disk should be deleted or - /// detached upon VM deletion. Possible values are: **Delete.** If this - /// value is used, the data disk is deleted when VM is deleted. - /// **Detach.** If this value is used, the data disk is retained after - /// VM is deleted. The default value is set to **Detach**. Possible - /// values include: 'Delete', 'Detach' + /// Gets or sets specifies whether data disk should be deleted or detached upon + /// VM deletion. Possible values are: **Delete.** If this value is used, the + /// data disk is deleted when VM is deleted. **Detach.** If this value is used, + /// the data disk is retained after VM is deleted. The default value is set to + /// **Detach**. Possible values include: 'Delete', 'Detach' /// - [JsonProperty(PropertyName = "deleteOption")] - public string DeleteOption { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "deleteOption")] + public string DeleteOption {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (CreateOption == null) + if (this.CreateOption == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "CreateOption"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CreateOption"); } + + + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DataDiskImage.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DataDiskImage.cs index 2bf7163edbbf..a0156a4d0e44 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DataDiskImage.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DataDiskImage.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,15 @@ public DataDiskImage() /// /// Initializes a new instance of the DataDiskImage class. /// - /// Specifies the logical unit number of the data - /// disk. This value is used to identify data disks within the VM and - /// therefore must be unique for each data disk attached to a - /// VM. + + /// Specifies the logical unit number of the data disk. This value is used to + /// identify data disks within the VM and therefore must be unique for each + /// data disk attached to a VM. + /// public DataDiskImage(int? lun = default(int?)) + { - Lun = lun; + this.Lun = lun; CustomInit(); } @@ -44,13 +40,13 @@ public DataDiskImage() /// partial void CustomInit(); + /// - /// Gets specifies the logical unit number of the data disk. This value - /// is used to identify data disks within the VM and therefore must be - /// unique for each data disk attached to a VM. + /// Gets specifies the logical unit number of the data disk. This value is used + /// to identify data disks within the VM and therefore must be unique for each + /// data disk attached to a VM. /// - [JsonProperty(PropertyName = "lun")] - public int? Lun { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "lun")] + public int? Lun {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DataDiskImageEncryption.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DataDiskImageEncryption.cs index a5a6152bb24d..f196b3d29791 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DataDiskImageEncryption.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DataDiskImageEncryption.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,16 +23,20 @@ public DataDiskImageEncryption() /// /// Initializes a new instance of the DataDiskImageEncryption class. /// - /// This property specifies the logical unit number - /// of the data disk. This value is used to identify data disks within - /// the Virtual Machine and therefore must be unique for each data disk - /// attached to the Virtual Machine. - /// A relative URI containing the - /// resource ID of the disk encryption set. + + /// A relative URI containing the resource ID of the disk encryption set. + /// + + /// This property specifies the logical unit number of the data disk. This + /// value is used to identify data disks within the Virtual Machine and + /// therefore must be unique for each data disk attached to the Virtual + /// Machine. + /// public DataDiskImageEncryption(int lun, string diskEncryptionSetId = default(string)) - : base(diskEncryptionSetId) + + : base(diskEncryptionSetId) { - Lun = lun; + this.Lun = lun; CustomInit(); } @@ -47,19 +45,19 @@ public DataDiskImageEncryption() /// partial void CustomInit(); + /// - /// Gets or sets this property specifies the logical unit number of the - /// data disk. This value is used to identify data disks within the - /// Virtual Machine and therefore must be unique for each data disk - /// attached to the Virtual Machine. + /// Gets or sets this property specifies the logical unit number of the data + /// disk. This value is used to identify data disks within the Virtual Machine + /// and therefore must be unique for each data disk attached to the Virtual + /// Machine. /// - [JsonProperty(PropertyName = "lun")] - public int Lun { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "lun")] + public int Lun {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() @@ -67,4 +65,4 @@ public virtual void Validate() //Nothing to validate } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DataDisksToAttach.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DataDisksToAttach.cs index 89395e7dfeb9..397bfdb49a54 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DataDisksToAttach.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DataDisksToAttach.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,34 +23,43 @@ public DataDisksToAttach() /// /// Initializes a new instance of the DataDisksToAttach class. /// - /// ID of the managed data disk. - /// The logical unit number of the data disk. This - /// value is used to identify data disks within the VM and therefore - /// must be unique for each data disk attached to a VM. If not - /// specified, lun would be auto assigned. - /// Specifies the caching requirements. Possible - /// values are: **None,** **ReadOnly,** **ReadWrite.** The defaulting - /// behavior is: **None for Standard storage. ReadOnly for Premium - /// storage.**. Possible values include: 'None', 'ReadOnly', - /// 'ReadWrite' - /// Specifies whether data disk should be - /// deleted or detached upon VM deletion. Possible values are: - /// **Delete.** If this value is used, the data disk is deleted when VM - /// is deleted. **Detach.** If this value is used, the data disk is - /// retained after VM is deleted. The default value is set to - /// **Detach**. Possible values include: 'Delete', 'Detach' - /// Specifies the customer managed disk - /// encryption set resource id for the managed disk. - /// Specifies whether - /// writeAccelerator should be enabled or disabled on the disk. + + /// ID of the managed data disk. + /// + + /// The logical unit number of the data disk. This value is used to identify + /// data disks within the VM and therefore must be unique for each data disk + /// attached to a VM. If not specified, lun would be auto assigned. + /// + + /// Specifies the caching requirements. Possible values are: **None,** + /// **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None for + /// Standard storage. ReadOnly for Premium storage.** + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + + /// Specifies whether data disk should be deleted or detached upon VM deletion. + /// Possible values are: **Delete.** If this value is used, the data disk is + /// deleted when VM is deleted. **Detach.** If this value is used, the data + /// disk is retained after VM is deleted. The default value is set to + /// **Detach**. + /// Possible values include: 'Delete', 'Detach' + + /// Specifies the customer managed disk encryption set resource id for the + /// managed disk. + /// + + /// Specifies whether writeAccelerator should be enabled or disabled on the + /// disk. + /// public DataDisksToAttach(string diskId, int? lun = default(int?), CachingTypes? caching = default(CachingTypes?), string deleteOption = default(string), DiskEncryptionSetParameters diskEncryptionSet = default(DiskEncryptionSetParameters), bool? writeAcceleratorEnabled = default(bool?)) + { - DiskId = diskId; - Lun = lun; - Caching = caching; - DeleteOption = deleteOption; - DiskEncryptionSet = diskEncryptionSet; - WriteAcceleratorEnabled = writeAcceleratorEnabled; + this.DiskId = diskId; + this.Lun = lun; + this.Caching = caching; + this.DeleteOption = deleteOption; + this.DiskEncryptionSet = diskEncryptionSet; + this.WriteAcceleratorEnabled = writeAcceleratorEnabled; CustomInit(); } @@ -66,67 +68,68 @@ public DataDisksToAttach() /// partial void CustomInit(); + /// - /// Gets or sets ID of the managed data disk. + /// Gets or sets iD of the managed data disk. /// - [JsonProperty(PropertyName = "diskId")] - public string DiskId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskId")] + public string DiskId {get; set; } /// - /// Gets or sets the logical unit number of the data disk. This value - /// is used to identify data disks within the VM and therefore must be - /// unique for each data disk attached to a VM. If not specified, lun - /// would be auto assigned. + /// Gets or sets the logical unit number of the data disk. This value is used + /// to identify data disks within the VM and therefore must be unique for each + /// data disk attached to a VM. If not specified, lun would be auto assigned. /// - [JsonProperty(PropertyName = "lun")] - public int? Lun { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lun")] + public int? Lun {get; set; } /// - /// Gets or sets specifies the caching requirements. Possible values - /// are: **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior - /// is: **None for Standard storage. ReadOnly for Premium storage.**. - /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + /// Gets or sets specifies the caching requirements. Possible values are: + /// **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None + /// for Standard storage. ReadOnly for Premium storage.** Possible values include: 'None', 'ReadOnly', 'ReadWrite' /// - [JsonProperty(PropertyName = "caching")] - public CachingTypes? Caching { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "caching")] + public CachingTypes? Caching {get; set; } /// - /// Gets or sets specifies whether data disk should be deleted or - /// detached upon VM deletion. Possible values are: **Delete.** If this - /// value is used, the data disk is deleted when VM is deleted. - /// **Detach.** If this value is used, the data disk is retained after - /// VM is deleted. The default value is set to **Detach**. Possible - /// values include: 'Delete', 'Detach' + /// Gets or sets specifies whether data disk should be deleted or detached upon + /// VM deletion. Possible values are: **Delete.** If this value is used, the + /// data disk is deleted when VM is deleted. **Detach.** If this value is used, + /// the data disk is retained after VM is deleted. The default value is set to + /// **Detach**. Possible values include: 'Delete', 'Detach' /// - [JsonProperty(PropertyName = "deleteOption")] - public string DeleteOption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "deleteOption")] + public string DeleteOption {get; set; } /// - /// Gets or sets specifies the customer managed disk encryption set - /// resource id for the managed disk. + /// Gets or sets specifies the customer managed disk encryption set resource id + /// for the managed disk. /// - [JsonProperty(PropertyName = "diskEncryptionSet")] - public DiskEncryptionSetParameters DiskEncryptionSet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskEncryptionSet")] + public DiskEncryptionSetParameters DiskEncryptionSet {get; set; } /// - /// Gets or sets specifies whether writeAccelerator should be enabled - /// or disabled on the disk. + /// Gets or sets specifies whether writeAccelerator should be enabled or + /// disabled on the disk. /// - [JsonProperty(PropertyName = "writeAcceleratorEnabled")] - public bool? WriteAcceleratorEnabled { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "writeAcceleratorEnabled")] + public bool? WriteAcceleratorEnabled {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (DiskId == null) + if (this.DiskId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "DiskId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DiskId"); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DataDisksToDetach.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DataDisksToDetach.cs index f21a7e0f0df5..c2d997214788 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DataDisksToDetach.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DataDisksToDetach.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,14 +23,18 @@ public DataDisksToDetach() /// /// Initializes a new instance of the DataDisksToDetach class. /// - /// ID of the managed data disk. - /// Supported options available for Detach - /// of a disk from a VM. Refer to DetachOption object reference for - /// more details. Possible values include: 'ForceDetach' + + /// ID of the managed data disk. + /// + + /// Supported options available for Detach of a disk from a VM. Refer to + /// DetachOption object reference for more details. + /// Possible values include: 'ForceDetach' public DataDisksToDetach(string diskId, string detachOption = default(string)) + { - DiskId = diskId; - DetachOption = detachOption; + this.DiskId = diskId; + this.DetachOption = detachOption; CustomInit(); } @@ -46,32 +43,33 @@ public DataDisksToDetach() /// partial void CustomInit(); + /// - /// Gets or sets ID of the managed data disk. + /// Gets or sets iD of the managed data disk. /// - [JsonProperty(PropertyName = "diskId")] - public string DiskId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskId")] + public string DiskId {get; set; } /// - /// Gets or sets supported options available for Detach of a disk from - /// a VM. Refer to DetachOption object reference for more details. - /// Possible values include: 'ForceDetach' + /// Gets or sets supported options available for Detach of a disk from a VM. + /// Refer to DetachOption object reference for more details. Possible values include: 'ForceDetach' /// - [JsonProperty(PropertyName = "detachOption")] - public string DetachOption { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "detachOption")] + public string DetachOption {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (DiskId == null) + if (this.DiskId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "DiskId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DiskId"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHost.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHost.cs index dccf79220311..812643bbe802 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHost.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHost.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specifies information about the Dedicated host. /// - [Rest.Serialization.JsonTransformation] - public partial class DedicatedHost : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class DedicatedHost : TrackedResource { /// /// Initializes a new instance of the DedicatedHost class. @@ -34,51 +24,74 @@ public DedicatedHost() /// /// Initializes a new instance of the DedicatedHost class. /// - /// Resource location - /// SKU of the dedicated host for Hardware Generation - /// and VM family. Only name is required to be set. List - /// Microsoft.Compute SKUs for a list of possible values. - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// Fault domain of the dedicated - /// host within a dedicated host group. - /// Specifies whether the dedicated - /// host should be replaced automatically in case of a failure. The - /// value is defaulted to 'true' when not provided. - /// A unique id generated and assigned to the - /// dedicated host by the platform. Does not change throughout the - /// lifetime of the host. - /// A list of references to all virtual - /// machines in the Dedicated Host. - /// Specifies the software license type that - /// will be applied to the VMs deployed on the dedicated host. Possible - /// values are: **None,** **Windows_Server_Hybrid,** - /// **Windows_Server_Perpetual.** The default value is: **None.**. - /// Possible values include: 'None', 'Windows_Server_Hybrid', - /// 'Windows_Server_Perpetual' - /// The date when the host was first - /// provisioned. - /// The provisioning state, which only - /// appears in the response. - /// The dedicated host instance - /// view. - /// Specifies the time at which the Dedicated - /// Host resource was created. Minimum api-version: 2021-11-01. - public DedicatedHost(string location, Sku sku, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), int? platformFaultDomain = default(int?), bool? autoReplaceOnFailure = default(bool?), string hostId = default(string), IList virtualMachines = default(IList), DedicatedHostLicenseTypes? licenseType = default(DedicatedHostLicenseTypes?), System.DateTime? provisioningTime = default(System.DateTime?), string provisioningState = default(string), DedicatedHostInstanceView instanceView = default(DedicatedHostInstanceView), System.DateTime? timeCreated = default(System.DateTime?)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// SKU of the dedicated host for Hardware Generation and VM family. Only name + /// is required to be set. List Microsoft.Compute SKUs for a list of possible + /// values. + /// + + /// Fault domain of the dedicated host within a dedicated host group. + /// + + /// Specifies whether the dedicated host should be replaced automatically in + /// case of a failure. The value is defaulted to 'true' when not provided. + /// + + /// A unique id generated and assigned to the dedicated host by the platform. + /// Does not change throughout the lifetime of the host. + /// + + /// A list of references to all virtual machines in the Dedicated Host. + /// + + /// Specifies the software license type that will be applied to the VMs + /// deployed on the dedicated host. Possible values are: **None,** + /// **Windows_Server_Hybrid,** **Windows_Server_Perpetual.** The default value + /// is: **None.** + /// Possible values include: 'None', 'Windows_Server_Hybrid', + /// 'Windows_Server_Perpetual' + + /// The date when the host was first provisioned. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// The dedicated host instance view. + /// + + /// Specifies the time at which the Dedicated Host resource was created. + /// Minimum api-version: 2021-11-01. + /// + public DedicatedHost(string location, Sku sku, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), int? platformFaultDomain = default(int?), bool? autoReplaceOnFailure = default(bool?), string hostId = default(string), System.Collections.Generic.IList virtualMachines = default(System.Collections.Generic.IList), DedicatedHostLicenseTypes? licenseType = default(DedicatedHostLicenseTypes?), System.DateTime? provisioningTime = default(System.DateTime?), string provisioningState = default(string), DedicatedHostInstanceView instanceView = default(DedicatedHostInstanceView), System.DateTime? timeCreated = default(System.DateTime?)) + + : base(location, id, name, type, tags) { - PlatformFaultDomain = platformFaultDomain; - AutoReplaceOnFailure = autoReplaceOnFailure; - HostId = hostId; - VirtualMachines = virtualMachines; - LicenseType = licenseType; - ProvisioningTime = provisioningTime; - ProvisioningState = provisioningState; - InstanceView = instanceView; - TimeCreated = timeCreated; - Sku = sku; + this.Sku = sku; + this.PlatformFaultDomain = platformFaultDomain; + this.AutoReplaceOnFailure = autoReplaceOnFailure; + this.HostId = hostId; + this.VirtualMachines = virtualMachines; + this.LicenseType = licenseType; + this.ProvisioningTime = provisioningTime; + this.ProvisioningState = provisioningState; + this.InstanceView = instanceView; + this.TimeCreated = timeCreated; CustomInit(); } @@ -87,92 +100,95 @@ public DedicatedHost() /// partial void CustomInit(); + + /// + /// Gets or sets sKU of the dedicated host for Hardware Generation and VM + /// family. Only name is required to be set. List Microsoft.Compute SKUs for a + /// list of possible values. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public Sku Sku {get; set; } + /// - /// Gets or sets fault domain of the dedicated host within a dedicated - /// host group. + /// Gets or sets fault domain of the dedicated host within a dedicated host + /// group. /// - [JsonProperty(PropertyName = "properties.platformFaultDomain")] - public int? PlatformFaultDomain { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.platformFaultDomain")] + public int? PlatformFaultDomain {get; set; } /// - /// Gets or sets specifies whether the dedicated host should be - /// replaced automatically in case of a failure. The value is defaulted - /// to 'true' when not provided. + /// Gets or sets specifies whether the dedicated host should be replaced + /// automatically in case of a failure. The value is defaulted to 'true' when + /// not provided. /// - [JsonProperty(PropertyName = "properties.autoReplaceOnFailure")] - public bool? AutoReplaceOnFailure { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoReplaceOnFailure")] + public bool? AutoReplaceOnFailure {get; set; } /// - /// Gets a unique id generated and assigned to the dedicated host by - /// the platform. Does not change throughout the lifetime of the host. + /// Gets a unique id generated and assigned to the dedicated host by the + /// platform. Does not change throughout the lifetime of the host. /// - [JsonProperty(PropertyName = "properties.hostId")] - public string HostId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hostId")] + public string HostId {get; private set; } /// - /// Gets a list of references to all virtual machines in the Dedicated - /// Host. + /// Gets a list of references to all virtual machines in the Dedicated Host. /// - [JsonProperty(PropertyName = "properties.virtualMachines")] - public IList VirtualMachines { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachines")] + public System.Collections.Generic.IList VirtualMachines {get; private set; } /// - /// Gets or sets specifies the software license type that will be - /// applied to the VMs deployed on the dedicated host. Possible values - /// are: **None,** **Windows_Server_Hybrid,** - /// **Windows_Server_Perpetual.** The default value is: **None.**. - /// Possible values include: 'None', 'Windows_Server_Hybrid', - /// 'Windows_Server_Perpetual' + /// Gets or sets specifies the software license type that will be applied to + /// the VMs deployed on the dedicated host. Possible values are: **None,** + /// **Windows_Server_Hybrid,** **Windows_Server_Perpetual.** The default value + /// is: **None.** Possible values include: 'None', 'Windows_Server_Hybrid', 'Windows_Server_Perpetual' /// - [JsonProperty(PropertyName = "properties.licenseType")] - public DedicatedHostLicenseTypes? LicenseType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.licenseType")] + public DedicatedHostLicenseTypes? LicenseType {get; set; } /// /// Gets the date when the host was first provisioned. /// - [JsonProperty(PropertyName = "properties.provisioningTime")] - public System.DateTime? ProvisioningTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningTime")] + public System.DateTime? ProvisioningTime {get; private set; } /// /// Gets the provisioning state, which only appears in the response. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Gets the dedicated host instance view. /// - [JsonProperty(PropertyName = "properties.instanceView")] - public DedicatedHostInstanceView InstanceView { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.instanceView")] + public DedicatedHostInstanceView InstanceView {get; private set; } /// - /// Gets specifies the time at which the Dedicated Host resource was - /// created. Minimum api-version: 2021-11-01. + /// Gets specifies the time at which the Dedicated Host resource was created. + /// Minimum api-version: 2021-11-01. /// - [JsonProperty(PropertyName = "properties.timeCreated")] - public System.DateTime? TimeCreated { get; private set; } - - /// - /// Gets or sets SKU of the dedicated host for Hardware Generation and - /// VM family. Only name is required to be set. List Microsoft.Compute - /// SKUs for a list of possible values. - /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeCreated")] + public System.DateTime? TimeCreated {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (Sku == null) + if (this.Sku == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Sku"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Sku"); } + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostAllocatableVM.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostAllocatableVM.cs index f0fc416b0752..e9bc08dd8739 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostAllocatableVM.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostAllocatableVM.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Represents the dedicated host unutilized capacity in terms of a - /// specific VM size. + /// Represents the dedicated host unutilized capacity in terms of a specific VM + /// size. /// public partial class DedicatedHostAllocatableVM { @@ -30,14 +24,18 @@ public DedicatedHostAllocatableVM() /// /// Initializes a new instance of the DedicatedHostAllocatableVM class. /// - /// VM size in terms of which the unutilized - /// capacity is represented. - /// Maximum number of VMs of size vmSize that can - /// fit in the dedicated host's remaining capacity. + + /// VM size in terms of which the unutilized capacity is represented. + /// + + /// Maximum number of VMs of size vmSize that can fit in the dedicated host's + /// remaining capacity. + /// public DedicatedHostAllocatableVM(string vmSize = default(string), double? count = default(double?)) + { - VmSize = vmSize; - Count = count; + this.VmSize = vmSize; + this.Count = count; CustomInit(); } @@ -46,19 +44,19 @@ public DedicatedHostAllocatableVM() /// partial void CustomInit(); + /// - /// Gets or sets VM size in terms of which the unutilized capacity is + /// Gets or sets vM size in terms of which the unutilized capacity is /// represented. /// - [JsonProperty(PropertyName = "vmSize")] - public string VmSize { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vmSize")] + public string VmSize {get; set; } /// - /// Gets or sets maximum number of VMs of size vmSize that can fit in - /// the dedicated host's remaining capacity. + /// Gets or sets maximum number of VMs of size vmSize that can fit in the + /// dedicated host's remaining capacity. /// - [JsonProperty(PropertyName = "count")] - public double? Count { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "count")] + public double? Count {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostAvailableCapacity.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostAvailableCapacity.cs index feb77504562d..143878725637 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostAvailableCapacity.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostAvailableCapacity.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class DedicatedHostAvailableCapacity { /// - /// Initializes a new instance of the DedicatedHostAvailableCapacity - /// class. + /// Initializes a new instance of the DedicatedHostAvailableCapacity class. /// public DedicatedHostAvailableCapacity() { @@ -30,15 +21,16 @@ public DedicatedHostAvailableCapacity() } /// - /// Initializes a new instance of the DedicatedHostAvailableCapacity - /// class. + /// Initializes a new instance of the DedicatedHostAvailableCapacity class. /// - /// The unutilized capacity of the - /// dedicated host represented in terms of each VM size that is allowed - /// to be deployed to the dedicated host. - public DedicatedHostAvailableCapacity(IList allocatableVMs = default(IList)) + + /// The unutilized capacity of the dedicated host represented in terms of each + /// VM size that is allowed to be deployed to the dedicated host. + /// + public DedicatedHostAvailableCapacity(System.Collections.Generic.IList allocatableVMS = default(System.Collections.Generic.IList)) + { - AllocatableVMs = allocatableVMs; + this.AllocatableVMs = allocatableVMS; CustomInit(); } @@ -47,13 +39,12 @@ public DedicatedHostAvailableCapacity() /// partial void CustomInit(); + /// - /// Gets or sets the unutilized capacity of the dedicated host - /// represented in terms of each VM size that is allowed to be deployed - /// to the dedicated host. + /// Gets or sets the unutilized capacity of the dedicated host represented in + /// terms of each VM size that is allowed to be deployed to the dedicated host. /// - [JsonProperty(PropertyName = "allocatableVMs")] - public IList AllocatableVMs { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "allocatableVMs")] + public System.Collections.Generic.IList AllocatableVMs {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroup.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroup.cs index de0c564743c5..f04905ea081e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroup.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroup.cs @@ -1,30 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specifies information about the dedicated host group that the dedicated - /// hosts should be assigned to. Currently, a dedicated host can only be - /// added to a dedicated host group at creation time. An existing dedicated - /// host cannot be added to another dedicated host group. + /// hosts should be assigned to. Currently, a dedicated host can only be added + /// to a dedicated host group at creation time. An existing dedicated host + /// cannot be added to another dedicated host group. /// - [Rest.Serialization.JsonTransformation] - public partial class DedicatedHostGroup : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class DedicatedHostGroup : TrackedResource { /// /// Initializes a new instance of the DedicatedHostGroup class. @@ -37,37 +27,55 @@ public DedicatedHostGroup() /// /// Initializes a new instance of the DedicatedHostGroup class. /// - /// Resource location - /// Number of fault domains that - /// the host group can span. - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// A list of references to all dedicated hosts in - /// the dedicated host group. - /// The dedicated host group instance view, - /// which has the list of instance view of the dedicated hosts under - /// the dedicated host group. - /// Specifies whether virtual - /// machines or virtual machine scale sets can be placed automatically - /// on the dedicated host group. Automatic placement means resources - /// are allocated on dedicated hosts, that are chosen by Azure, under - /// the dedicated host group. The value is defaulted to 'false' when - /// not provided. Minimum api-version: 2020-06-01. - /// Enables or disables a - /// capability on the dedicated host group. Minimum api-version: - /// 2022-03-01. - /// The availability zones. - public DedicatedHostGroup(string location, int platformFaultDomainCount, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IList hosts = default(IList), DedicatedHostGroupInstanceView instanceView = default(DedicatedHostGroupInstanceView), bool? supportAutomaticPlacement = default(bool?), DedicatedHostGroupPropertiesAdditionalCapabilities additionalCapabilities = default(DedicatedHostGroupPropertiesAdditionalCapabilities), IList zones = default(IList)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// The availability zones. + /// + + /// Number of fault domains that the host group can span. + /// + + /// A list of references to all dedicated hosts in the dedicated host group. + /// + + /// The dedicated host group instance view, which has the list of instance view + /// of the dedicated hosts under the dedicated host group. + /// + + /// Specifies whether virtual machines or virtual machine scale sets can be + /// placed automatically on the dedicated host group. Automatic placement means + /// resources are allocated on dedicated hosts, that are chosen by Azure, under + /// the dedicated host group. The value is defaulted to 'false' when not + /// provided. Minimum api-version: 2020-06-01. + /// + + /// Enables or disables a capability on the dedicated host group. Minimum + /// api-version: 2022-03-01. + /// + public DedicatedHostGroup(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), int? platformFaultDomainCount = default(int?), System.Collections.Generic.IList hosts = default(System.Collections.Generic.IList), DedicatedHostGroupInstanceView instanceView = default(DedicatedHostGroupInstanceView), bool? supportAutomaticPlacement = default(bool?), DedicatedHostGroupPropertiesAdditionalCapabilities additionalCapabilities = default(DedicatedHostGroupPropertiesAdditionalCapabilities)) + + : base(location, id, name, type, tags) { - PlatformFaultDomainCount = platformFaultDomainCount; - Hosts = hosts; - InstanceView = instanceView; - SupportAutomaticPlacement = supportAutomaticPlacement; - AdditionalCapabilities = additionalCapabilities; - Zones = zones; + this.Zones = zones; + this.PlatformFaultDomainCount = platformFaultDomainCount; + this.Hosts = hosts; + this.InstanceView = instanceView; + this.SupportAutomaticPlacement = supportAutomaticPlacement; + this.AdditionalCapabilities = additionalCapabilities; CustomInit(); } @@ -76,64 +84,69 @@ public DedicatedHostGroup() /// partial void CustomInit(); + /// - /// Gets or sets number of fault domains that the host group can span. + /// Gets or sets the availability zones. /// - [JsonProperty(PropertyName = "properties.platformFaultDomainCount")] - public int PlatformFaultDomainCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } /// - /// Gets a list of references to all dedicated hosts in the dedicated - /// host group. + /// Gets or sets number of fault domains that the host group can span. /// - [JsonProperty(PropertyName = "properties.hosts")] - public IList Hosts { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.platformFaultDomainCount")] + public int? PlatformFaultDomainCount {get; set; } /// - /// Gets the dedicated host group instance view, which has the list of - /// instance view of the dedicated hosts under the dedicated host + /// Gets a list of references to all dedicated hosts in the dedicated host /// group. /// - [JsonProperty(PropertyName = "properties.instanceView")] - public DedicatedHostGroupInstanceView InstanceView { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hosts")] + public System.Collections.Generic.IList Hosts {get; private set; } /// - /// Gets or sets specifies whether virtual machines or virtual machine - /// scale sets can be placed automatically on the dedicated host group. - /// Automatic placement means resources are allocated on dedicated - /// hosts, that are chosen by Azure, under the dedicated host group. - /// The value is defaulted to 'false' when not provided. Minimum - /// api-version: 2020-06-01. + /// Gets the dedicated host group instance view, which has the list of instance + /// view of the dedicated hosts under the dedicated host group. /// - [JsonProperty(PropertyName = "properties.supportAutomaticPlacement")] - public bool? SupportAutomaticPlacement { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.instanceView")] + public DedicatedHostGroupInstanceView InstanceView {get; private set; } /// - /// Gets or sets enables or disables a capability on the dedicated host - /// group. Minimum api-version: 2022-03-01. + /// Gets or sets specifies whether virtual machines or virtual machine scale + /// sets can be placed automatically on the dedicated host group. Automatic + /// placement means resources are allocated on dedicated hosts, that are chosen + /// by Azure, under the dedicated host group. The value is defaulted to 'false' + /// when not provided. Minimum api-version: 2020-06-01. /// - [JsonProperty(PropertyName = "properties.additionalCapabilities")] - public DedicatedHostGroupPropertiesAdditionalCapabilities AdditionalCapabilities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.supportAutomaticPlacement")] + public bool? SupportAutomaticPlacement {get; set; } /// - /// Gets or sets the availability zones. + /// Gets or sets enables or disables a capability on the dedicated host group. + /// Minimum api-version: 2022-03-01. /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.additionalCapabilities")] + public DedicatedHostGroupPropertiesAdditionalCapabilities AdditionalCapabilities {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (PlatformFaultDomainCount < 1) + + if (this.PlatformFaultDomainCount != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "PlatformFaultDomainCount", 1); + if (this.PlatformFaultDomainCount < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "PlatformFaultDomainCount", 1); + } } + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroupInstanceView.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroupInstanceView.cs index 3a12166c2020..852426d19140 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroupInstanceView.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroupInstanceView.cs @@ -1,25 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; public partial class DedicatedHostGroupInstanceView { /// - /// Initializes a new instance of the DedicatedHostGroupInstanceView - /// class. + /// Initializes a new instance of the DedicatedHostGroupInstanceView class. /// public DedicatedHostGroupInstanceView() { @@ -27,14 +18,16 @@ public DedicatedHostGroupInstanceView() } /// - /// Initializes a new instance of the DedicatedHostGroupInstanceView - /// class. + /// Initializes a new instance of the DedicatedHostGroupInstanceView class. /// - /// List of instance view of the dedicated hosts - /// under the dedicated host group. - public DedicatedHostGroupInstanceView(IList hosts = default(IList)) + + /// List of instance view of the dedicated hosts under the dedicated host + /// group. + /// + public DedicatedHostGroupInstanceView(System.Collections.Generic.IList hosts = default(System.Collections.Generic.IList)) + { - Hosts = hosts; + this.Hosts = hosts; CustomInit(); } @@ -43,12 +36,12 @@ public DedicatedHostGroupInstanceView() /// partial void CustomInit(); + /// /// Gets or sets list of instance view of the dedicated hosts under the /// dedicated host group. /// - [JsonProperty(PropertyName = "hosts")] - public IList Hosts { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "hosts")] + public System.Collections.Generic.IList Hosts {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroupProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroupProperties.cs new file mode 100644 index 000000000000..0a72632d8e56 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroupProperties.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Dedicated Host Group Properties. + /// + public partial class DedicatedHostGroupProperties + { + /// + /// Initializes a new instance of the DedicatedHostGroupProperties class. + /// + public DedicatedHostGroupProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DedicatedHostGroupProperties class. + /// + + /// Number of fault domains that the host group can span. + /// + + /// A list of references to all dedicated hosts in the dedicated host group. + /// + + /// The dedicated host group instance view, which has the list of instance view + /// of the dedicated hosts under the dedicated host group. + /// + + /// Specifies whether virtual machines or virtual machine scale sets can be + /// placed automatically on the dedicated host group. Automatic placement means + /// resources are allocated on dedicated hosts, that are chosen by Azure, under + /// the dedicated host group. The value is defaulted to 'false' when not + /// provided. Minimum api-version: 2020-06-01. + /// + + /// Enables or disables a capability on the dedicated host group. Minimum + /// api-version: 2022-03-01. + /// + public DedicatedHostGroupProperties(int platformFaultDomainCount, System.Collections.Generic.IList hosts = default(System.Collections.Generic.IList), DedicatedHostGroupInstanceView instanceView = default(DedicatedHostGroupInstanceView), bool? supportAutomaticPlacement = default(bool?), DedicatedHostGroupPropertiesAdditionalCapabilities additionalCapabilities = default(DedicatedHostGroupPropertiesAdditionalCapabilities)) + + { + this.PlatformFaultDomainCount = platformFaultDomainCount; + this.Hosts = hosts; + this.InstanceView = instanceView; + this.SupportAutomaticPlacement = supportAutomaticPlacement; + this.AdditionalCapabilities = additionalCapabilities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets number of fault domains that the host group can span. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "platformFaultDomainCount")] + public int PlatformFaultDomainCount {get; set; } + + /// + /// Gets a list of references to all dedicated hosts in the dedicated host + /// group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hosts")] + public System.Collections.Generic.IList Hosts {get; private set; } + + /// + /// Gets the dedicated host group instance view, which has the list of instance + /// view of the dedicated hosts under the dedicated host group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "instanceView")] + public DedicatedHostGroupInstanceView InstanceView {get; private set; } + + /// + /// Gets or sets specifies whether virtual machines or virtual machine scale + /// sets can be placed automatically on the dedicated host group. Automatic + /// placement means resources are allocated on dedicated hosts, that are chosen + /// by Azure, under the dedicated host group. The value is defaulted to 'false' + /// when not provided. Minimum api-version: 2020-06-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "supportAutomaticPlacement")] + public bool? SupportAutomaticPlacement {get; set; } + + /// + /// Gets or sets enables or disables a capability on the dedicated host group. + /// Minimum api-version: 2022-03-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalCapabilities")] + public DedicatedHostGroupPropertiesAdditionalCapabilities AdditionalCapabilities {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.PlatformFaultDomainCount < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "PlatformFaultDomainCount", 1); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroupPropertiesAdditionalCapabilities.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroupPropertiesAdditionalCapabilities.cs index a0b3626dacb2..845f1b15ee3a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroupPropertiesAdditionalCapabilities.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroupPropertiesAdditionalCapabilities.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +14,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class DedicatedHostGroupPropertiesAdditionalCapabilities { /// - /// Initializes a new instance of the - /// DedicatedHostGroupPropertiesAdditionalCapabilities class. + /// Initializes a new instance of the DedicatedHostGroupPropertiesAdditionalCapabilities class. /// public DedicatedHostGroupPropertiesAdditionalCapabilities() { @@ -29,22 +22,23 @@ public DedicatedHostGroupPropertiesAdditionalCapabilities() } /// - /// Initializes a new instance of the - /// DedicatedHostGroupPropertiesAdditionalCapabilities class. + /// Initializes a new instance of the DedicatedHostGroupPropertiesAdditionalCapabilities class. /// - /// The flag that enables or disables a - /// capability to have UltraSSD Enabled Virtual Machines on Dedicated - /// Hosts of the Dedicated Host Group. For the Virtual Machines to be - /// UltraSSD Enabled, UltraSSDEnabled flag for the resource needs to be - /// set true as well. The value is defaulted to 'false' when not - /// provided. Please refer to + + /// The flag that enables or disables a capability to have UltraSSD Enabled + /// Virtual Machines on Dedicated Hosts of the Dedicated Host Group. For the + /// Virtual Machines to be UltraSSD Enabled, UltraSSDEnabled flag for the + /// resource needs to be set true as well. The value is defaulted to 'false' + /// when not provided. Please refer to /// https://docs.microsoft.com/en-us/azure/virtual-machines/disks-enable-ultra-ssd - /// for more details on Ultra SSD feature. **Note:** The - /// ultraSSDEnabled setting can only be enabled for Host Groups that - /// are created as zonal. Minimum api-version: 2022-03-01. - public DedicatedHostGroupPropertiesAdditionalCapabilities(bool? ultraSSDEnabled = default(bool?)) + /// for more details on Ultra SSD feature. **Note:** The ultraSSDEnabled + /// setting can only be enabled for Host Groups that are created as zonal. + /// Minimum api-version: 2022-03-01. + /// + public DedicatedHostGroupPropertiesAdditionalCapabilities(bool? ultraSsdEnabled = default(bool?)) + { - UltraSSDEnabled = ultraSSDEnabled; + this.UltraSSDEnabled = ultraSsdEnabled; CustomInit(); } @@ -53,20 +47,19 @@ public DedicatedHostGroupPropertiesAdditionalCapabilities() /// partial void CustomInit(); + /// /// Gets or sets the flag that enables or disables a capability to have - /// UltraSSD Enabled Virtual Machines on Dedicated Hosts of the - /// Dedicated Host Group. For the Virtual Machines to be UltraSSD - /// Enabled, UltraSSDEnabled flag for the resource needs to be set true - /// as well. The value is defaulted to 'false' when not provided. - /// Please refer to + /// UltraSSD Enabled Virtual Machines on Dedicated Hosts of the Dedicated Host + /// Group. For the Virtual Machines to be UltraSSD Enabled, UltraSSDEnabled + /// flag for the resource needs to be set true as well. The value is defaulted + /// to 'false' when not provided. Please refer to /// https://docs.microsoft.com/en-us/azure/virtual-machines/disks-enable-ultra-ssd - /// for more details on Ultra SSD feature. **Note:** The - /// ultraSSDEnabled setting can only be enabled for Host Groups that - /// are created as zonal. Minimum api-version: 2022-03-01. + /// for more details on Ultra SSD feature. **Note:** The ultraSSDEnabled + /// setting can only be enabled for Host Groups that are created as zonal. + /// Minimum api-version: 2022-03-01. /// - [JsonProperty(PropertyName = "ultraSSDEnabled")] - public bool? UltraSSDEnabled { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ultraSSDEnabled")] + public bool? UltraSSDEnabled {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroupUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroupUpdate.cs index 537c52aa723f..19a903ecafc2 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroupUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostGroupUpdate.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specifies information about the dedicated host group that the dedicated /// host should be assigned to. Only tags may be updated. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class DedicatedHostGroupUpdate : UpdateResource { /// @@ -35,37 +25,46 @@ public DedicatedHostGroupUpdate() /// /// Initializes a new instance of the DedicatedHostGroupUpdate class. /// - /// Number of fault domains that - /// the host group can span. - /// Resource tags - /// A list of references to all dedicated hosts in - /// the dedicated host group. - /// The dedicated host group instance view, - /// which has the list of instance view of the dedicated hosts under - /// the dedicated host group. - /// Specifies whether virtual - /// machines or virtual machine scale sets can be placed automatically - /// on the dedicated host group. Automatic placement means resources - /// are allocated on dedicated hosts, that are chosen by Azure, under - /// the dedicated host group. The value is defaulted to 'false' when - /// not provided. Minimum api-version: 2020-06-01. - /// Enables or disables a - /// capability on the dedicated host group. Minimum api-version: - /// 2022-03-01. - /// Availability Zone to use for this host group. - /// Only single zone is supported. The zone can be assigned only during - /// creation. If not provided, the group supports all zones in the - /// region. If provided, enforces each host in the group to be in the - /// same zone. - public DedicatedHostGroupUpdate(int platformFaultDomainCount, IDictionary tags = default(IDictionary), IList hosts = default(IList), DedicatedHostGroupInstanceView instanceView = default(DedicatedHostGroupInstanceView), bool? supportAutomaticPlacement = default(bool?), DedicatedHostGroupPropertiesAdditionalCapabilities additionalCapabilities = default(DedicatedHostGroupPropertiesAdditionalCapabilities), IList zones = default(IList)) - : base(tags) + + /// Resource tags + /// + + /// Availability Zone to use for this host group. Only single zone is + /// supported. The zone can be assigned only during creation. If not provided, + /// the group supports all zones in the region. If provided, enforces each host + /// in the group to be in the same zone. + /// + + /// Number of fault domains that the host group can span. + /// + + /// A list of references to all dedicated hosts in the dedicated host group. + /// + + /// The dedicated host group instance view, which has the list of instance view + /// of the dedicated hosts under the dedicated host group. + /// + + /// Specifies whether virtual machines or virtual machine scale sets can be + /// placed automatically on the dedicated host group. Automatic placement means + /// resources are allocated on dedicated hosts, that are chosen by Azure, under + /// the dedicated host group. The value is defaulted to 'false' when not + /// provided. Minimum api-version: 2020-06-01. + /// + + /// Enables or disables a capability on the dedicated host group. Minimum + /// api-version: 2022-03-01. + /// + public DedicatedHostGroupUpdate(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), int? platformFaultDomainCount = default(int?), System.Collections.Generic.IList hosts = default(System.Collections.Generic.IList), DedicatedHostGroupInstanceView instanceView = default(DedicatedHostGroupInstanceView), bool? supportAutomaticPlacement = default(bool?), DedicatedHostGroupPropertiesAdditionalCapabilities additionalCapabilities = default(DedicatedHostGroupPropertiesAdditionalCapabilities)) + + : base(tags) { - PlatformFaultDomainCount = platformFaultDomainCount; - Hosts = hosts; - InstanceView = instanceView; - SupportAutomaticPlacement = supportAutomaticPlacement; - AdditionalCapabilities = additionalCapabilities; - Zones = zones; + this.Zones = zones; + this.PlatformFaultDomainCount = platformFaultDomainCount; + this.Hosts = hosts; + this.InstanceView = instanceView; + this.SupportAutomaticPlacement = supportAutomaticPlacement; + this.AdditionalCapabilities = additionalCapabilities; CustomInit(); } @@ -74,67 +73,71 @@ public DedicatedHostGroupUpdate() /// partial void CustomInit(); + /// - /// Gets or sets number of fault domains that the host group can span. + /// Gets or sets availability Zone to use for this host group. Only single zone + /// is supported. The zone can be assigned only during creation. If not + /// provided, the group supports all zones in the region. If provided, enforces + /// each host in the group to be in the same zone. /// - [JsonProperty(PropertyName = "properties.platformFaultDomainCount")] - public int PlatformFaultDomainCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } /// - /// Gets a list of references to all dedicated hosts in the dedicated - /// host group. + /// Gets or sets number of fault domains that the host group can span. /// - [JsonProperty(PropertyName = "properties.hosts")] - public IList Hosts { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.platformFaultDomainCount")] + public int? PlatformFaultDomainCount {get; set; } /// - /// Gets the dedicated host group instance view, which has the list of - /// instance view of the dedicated hosts under the dedicated host + /// Gets a list of references to all dedicated hosts in the dedicated host /// group. /// - [JsonProperty(PropertyName = "properties.instanceView")] - public DedicatedHostGroupInstanceView InstanceView { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hosts")] + public System.Collections.Generic.IList Hosts {get; private set; } /// - /// Gets or sets specifies whether virtual machines or virtual machine - /// scale sets can be placed automatically on the dedicated host group. - /// Automatic placement means resources are allocated on dedicated - /// hosts, that are chosen by Azure, under the dedicated host group. - /// The value is defaulted to 'false' when not provided. Minimum - /// api-version: 2020-06-01. + /// Gets the dedicated host group instance view, which has the list of instance + /// view of the dedicated hosts under the dedicated host group. /// - [JsonProperty(PropertyName = "properties.supportAutomaticPlacement")] - public bool? SupportAutomaticPlacement { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.instanceView")] + public DedicatedHostGroupInstanceView InstanceView {get; private set; } /// - /// Gets or sets enables or disables a capability on the dedicated host - /// group. Minimum api-version: 2022-03-01. + /// Gets or sets specifies whether virtual machines or virtual machine scale + /// sets can be placed automatically on the dedicated host group. Automatic + /// placement means resources are allocated on dedicated hosts, that are chosen + /// by Azure, under the dedicated host group. The value is defaulted to 'false' + /// when not provided. Minimum api-version: 2020-06-01. /// - [JsonProperty(PropertyName = "properties.additionalCapabilities")] - public DedicatedHostGroupPropertiesAdditionalCapabilities AdditionalCapabilities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.supportAutomaticPlacement")] + public bool? SupportAutomaticPlacement {get; set; } /// - /// Gets or sets availability Zone to use for this host group. Only - /// single zone is supported. The zone can be assigned only during - /// creation. If not provided, the group supports all zones in the - /// region. If provided, enforces each host in the group to be in the - /// same zone. + /// Gets or sets enables or disables a capability on the dedicated host group. + /// Minimum api-version: 2022-03-01. /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.additionalCapabilities")] + public DedicatedHostGroupPropertiesAdditionalCapabilities AdditionalCapabilities {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (PlatformFaultDomainCount < 1) + + if (this.PlatformFaultDomainCount != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "PlatformFaultDomainCount", 1); + if (this.PlatformFaultDomainCount < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "PlatformFaultDomainCount", 1); + } } + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostInstanceView.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostInstanceView.cs index 6e25d0364b64..1f4d3cecd3d5 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostInstanceView.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostInstanceView.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,16 +23,22 @@ public DedicatedHostInstanceView() /// /// Initializes a new instance of the DedicatedHostInstanceView class. /// - /// Specifies the unique id of the dedicated - /// physical machine on which the dedicated host resides. - /// Unutilized capacity of the - /// dedicated host. - /// The resource status information. - public DedicatedHostInstanceView(string assetId = default(string), DedicatedHostAvailableCapacity availableCapacity = default(DedicatedHostAvailableCapacity), IList statuses = default(IList)) + + /// Specifies the unique id of the dedicated physical machine on which the + /// dedicated host resides. + /// + + /// Unutilized capacity of the dedicated host. + /// + + /// The resource status information. + /// + public DedicatedHostInstanceView(string assetId = default(string), DedicatedHostAvailableCapacity availableCapacity = default(DedicatedHostAvailableCapacity), System.Collections.Generic.IList statuses = default(System.Collections.Generic.IList)) + { - AssetId = assetId; - AvailableCapacity = availableCapacity; - Statuses = statuses; + this.AssetId = assetId; + this.AvailableCapacity = availableCapacity; + this.Statuses = statuses; CustomInit(); } @@ -49,24 +47,24 @@ public DedicatedHostInstanceView() /// partial void CustomInit(); + /// - /// Gets specifies the unique id of the dedicated physical machine on - /// which the dedicated host resides. + /// Gets specifies the unique id of the dedicated physical machine on which the + /// dedicated host resides. /// - [JsonProperty(PropertyName = "assetId")] - public string AssetId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "assetId")] + public string AssetId {get; private set; } /// /// Gets or sets unutilized capacity of the dedicated host. /// - [JsonProperty(PropertyName = "availableCapacity")] - public DedicatedHostAvailableCapacity AvailableCapacity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "availableCapacity")] + public DedicatedHostAvailableCapacity AvailableCapacity {get; set; } /// /// Gets or sets the resource status information. /// - [JsonProperty(PropertyName = "statuses")] - public IList Statuses { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "statuses")] + public System.Collections.Generic.IList Statuses {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostInstanceViewWithName.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostInstanceViewWithName.cs index da90aa0c41e7..236f219967af 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostInstanceViewWithName.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostInstanceViewWithName.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -23,8 +15,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class DedicatedHostInstanceViewWithName : DedicatedHostInstanceView { /// - /// Initializes a new instance of the DedicatedHostInstanceViewWithName - /// class. + /// Initializes a new instance of the DedicatedHostInstanceViewWithName class. /// public DedicatedHostInstanceViewWithName() { @@ -32,19 +23,26 @@ public DedicatedHostInstanceViewWithName() } /// - /// Initializes a new instance of the DedicatedHostInstanceViewWithName - /// class. + /// Initializes a new instance of the DedicatedHostInstanceViewWithName class. /// - /// Specifies the unique id of the dedicated - /// physical machine on which the dedicated host resides. - /// Unutilized capacity of the - /// dedicated host. - /// The resource status information. - /// The name of the dedicated host. - public DedicatedHostInstanceViewWithName(string assetId = default(string), DedicatedHostAvailableCapacity availableCapacity = default(DedicatedHostAvailableCapacity), IList statuses = default(IList), string name = default(string)) - : base(assetId, availableCapacity, statuses) + + /// Specifies the unique id of the dedicated physical machine on which the + /// dedicated host resides. + /// + + /// Unutilized capacity of the dedicated host. + /// + + /// The resource status information. + /// + + /// The name of the dedicated host. + /// + public DedicatedHostInstanceViewWithName(string assetId = default(string), DedicatedHostAvailableCapacity availableCapacity = default(DedicatedHostAvailableCapacity), System.Collections.Generic.IList statuses = default(System.Collections.Generic.IList), string name = default(string)) + + : base(assetId, availableCapacity, statuses) { - Name = name; + this.Name = name; CustomInit(); } @@ -53,11 +51,11 @@ public DedicatedHostInstanceViewWithName() /// partial void CustomInit(); + /// /// Gets the name of the dedicated host. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostLicenseTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostLicenseTypes.cs index 408c2b449d33..1fc6b37fdffc 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostLicenseTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostLicenseTypes.cs @@ -1,31 +1,24 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for DedicatedHostLicenseTypes. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum DedicatedHostLicenseTypes { - [EnumMember(Value = "None")] + [System.Runtime.Serialization.EnumMember(Value = "None")] None, - [EnumMember(Value = "Windows_Server_Hybrid")] + [System.Runtime.Serialization.EnumMember(Value = "Windows_Server_Hybrid")] WindowsServerHybrid, - [EnumMember(Value = "Windows_Server_Perpetual")] + [System.Runtime.Serialization.EnumMember(Value = "Windows_Server_Perpetual")] WindowsServerPerpetual } internal static class DedicatedHostLicenseTypesEnumExtension @@ -34,7 +27,6 @@ internal static string ToSerializedValue(this DedicatedHostLicenseTypes? value) { return value == null ? null : ((DedicatedHostLicenseTypes)value).ToSerializedValue(); } - internal static string ToSerializedValue(this DedicatedHostLicenseTypes value) { switch( value ) @@ -48,7 +40,6 @@ internal static string ToSerializedValue(this DedicatedHostLicenseTypes value) } return null; } - internal static DedicatedHostLicenseTypes? ParseDedicatedHostLicenseTypes(this string value) { switch( value ) @@ -63,4 +54,4 @@ internal static string ToSerializedValue(this DedicatedHostLicenseTypes value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostProperties.cs new file mode 100644 index 000000000000..aa6258fe6553 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostProperties.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Properties of the dedicated host. + /// + public partial class DedicatedHostProperties + { + /// + /// Initializes a new instance of the DedicatedHostProperties class. + /// + public DedicatedHostProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DedicatedHostProperties class. + /// + + /// Fault domain of the dedicated host within a dedicated host group. + /// + + /// Specifies whether the dedicated host should be replaced automatically in + /// case of a failure. The value is defaulted to 'true' when not provided. + /// + + /// A unique id generated and assigned to the dedicated host by the platform. + /// Does not change throughout the lifetime of the host. + /// + + /// A list of references to all virtual machines in the Dedicated Host. + /// + + /// Specifies the software license type that will be applied to the VMs + /// deployed on the dedicated host. Possible values are: **None,** + /// **Windows_Server_Hybrid,** **Windows_Server_Perpetual.** The default value + /// is: **None.** + /// Possible values include: 'None', 'Windows_Server_Hybrid', + /// 'Windows_Server_Perpetual' + + /// The date when the host was first provisioned. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// The dedicated host instance view. + /// + + /// Specifies the time at which the Dedicated Host resource was created. + /// Minimum api-version: 2021-11-01. + /// + public DedicatedHostProperties(int? platformFaultDomain = default(int?), bool? autoReplaceOnFailure = default(bool?), string hostId = default(string), System.Collections.Generic.IList virtualMachines = default(System.Collections.Generic.IList), DedicatedHostLicenseTypes? licenseType = default(DedicatedHostLicenseTypes?), System.DateTime? provisioningTime = default(System.DateTime?), string provisioningState = default(string), DedicatedHostInstanceView instanceView = default(DedicatedHostInstanceView), System.DateTime? timeCreated = default(System.DateTime?)) + + { + this.PlatformFaultDomain = platformFaultDomain; + this.AutoReplaceOnFailure = autoReplaceOnFailure; + this.HostId = hostId; + this.VirtualMachines = virtualMachines; + this.LicenseType = licenseType; + this.ProvisioningTime = provisioningTime; + this.ProvisioningState = provisioningState; + this.InstanceView = instanceView; + this.TimeCreated = timeCreated; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets fault domain of the dedicated host within a dedicated host + /// group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "platformFaultDomain")] + public int? PlatformFaultDomain {get; set; } + + /// + /// Gets or sets specifies whether the dedicated host should be replaced + /// automatically in case of a failure. The value is defaulted to 'true' when + /// not provided. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "autoReplaceOnFailure")] + public bool? AutoReplaceOnFailure {get; set; } + + /// + /// Gets a unique id generated and assigned to the dedicated host by the + /// platform. Does not change throughout the lifetime of the host. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hostId")] + public string HostId {get; private set; } + + /// + /// Gets a list of references to all virtual machines in the Dedicated Host. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachines")] + public System.Collections.Generic.IList VirtualMachines {get; private set; } + + /// + /// Gets or sets specifies the software license type that will be applied to + /// the VMs deployed on the dedicated host. Possible values are: **None,** + /// **Windows_Server_Hybrid,** **Windows_Server_Perpetual.** The default value + /// is: **None.** Possible values include: 'None', 'Windows_Server_Hybrid', 'Windows_Server_Perpetual' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "licenseType")] + public DedicatedHostLicenseTypes? LicenseType {get; set; } + + /// + /// Gets the date when the host was first provisioned. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningTime")] + public System.DateTime? ProvisioningTime {get; private set; } + + /// + /// Gets the provisioning state, which only appears in the response. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the dedicated host instance view. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "instanceView")] + public DedicatedHostInstanceView InstanceView {get; private set; } + + /// + /// Gets specifies the time at which the Dedicated Host resource was created. + /// Minimum api-version: 2021-11-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeCreated")] + public System.DateTime? TimeCreated {get; private set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostUpdate.cs index f96ff3fe275c..d26dd557f324 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostUpdate.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specifies information about the dedicated host. Only tags, /// autoReplaceOnFailure and licenseType may be updated. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class DedicatedHostUpdate : UpdateResource { /// @@ -35,49 +25,63 @@ public DedicatedHostUpdate() /// /// Initializes a new instance of the DedicatedHostUpdate class. /// - /// Resource tags - /// Fault domain of the dedicated - /// host within a dedicated host group. - /// Specifies whether the dedicated - /// host should be replaced automatically in case of a failure. The - /// value is defaulted to 'true' when not provided. - /// A unique id generated and assigned to the - /// dedicated host by the platform. Does not change throughout the - /// lifetime of the host. - /// A list of references to all virtual - /// machines in the Dedicated Host. - /// Specifies the software license type that - /// will be applied to the VMs deployed on the dedicated host. Possible - /// values are: **None,** **Windows_Server_Hybrid,** - /// **Windows_Server_Perpetual.** The default value is: **None.**. - /// Possible values include: 'None', 'Windows_Server_Hybrid', - /// 'Windows_Server_Perpetual' - /// The date when the host was first - /// provisioned. - /// The provisioning state, which only - /// appears in the response. - /// The dedicated host instance - /// view. - /// Specifies the time at which the Dedicated - /// Host resource was created. Minimum api-version: 2021-11-01. - /// [List all available dedicated host sizes for - /// resizing] + + /// Resource tags + /// + + /// [List all available dedicated host sizes for resizing] /// (https://docs.microsoft.com/rest/api/compute/dedicated-hosts/listavailablesizes). - /// Resizing can be only used to scale up DedicatedHost. Only name is - /// required to be set. - public DedicatedHostUpdate(IDictionary tags = default(IDictionary), int? platformFaultDomain = default(int?), bool? autoReplaceOnFailure = default(bool?), string hostId = default(string), IList virtualMachines = default(IList), DedicatedHostLicenseTypes? licenseType = default(DedicatedHostLicenseTypes?), System.DateTime? provisioningTime = default(System.DateTime?), string provisioningState = default(string), DedicatedHostInstanceView instanceView = default(DedicatedHostInstanceView), System.DateTime? timeCreated = default(System.DateTime?), Sku sku = default(Sku)) - : base(tags) + /// Resizing can be only used to scale up DedicatedHost. Only name is required + /// to be set. + /// + + /// Fault domain of the dedicated host within a dedicated host group. + /// + + /// Specifies whether the dedicated host should be replaced automatically in + /// case of a failure. The value is defaulted to 'true' when not provided. + /// + + /// A unique id generated and assigned to the dedicated host by the platform. + /// Does not change throughout the lifetime of the host. + /// + + /// A list of references to all virtual machines in the Dedicated Host. + /// + + /// Specifies the software license type that will be applied to the VMs + /// deployed on the dedicated host. Possible values are: **None,** + /// **Windows_Server_Hybrid,** **Windows_Server_Perpetual.** The default value + /// is: **None.** + /// Possible values include: 'None', 'Windows_Server_Hybrid', + /// 'Windows_Server_Perpetual' + + /// The date when the host was first provisioned. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// The dedicated host instance view. + /// + + /// Specifies the time at which the Dedicated Host resource was created. + /// Minimum api-version: 2021-11-01. + /// + public DedicatedHostUpdate(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), Sku sku = default(Sku), int? platformFaultDomain = default(int?), bool? autoReplaceOnFailure = default(bool?), string hostId = default(string), System.Collections.Generic.IList virtualMachines = default(System.Collections.Generic.IList), DedicatedHostLicenseTypes? licenseType = default(DedicatedHostLicenseTypes?), System.DateTime? provisioningTime = default(System.DateTime?), string provisioningState = default(string), DedicatedHostInstanceView instanceView = default(DedicatedHostInstanceView), System.DateTime? timeCreated = default(System.DateTime?)) + + : base(tags) { - PlatformFaultDomain = platformFaultDomain; - AutoReplaceOnFailure = autoReplaceOnFailure; - HostId = hostId; - VirtualMachines = virtualMachines; - LicenseType = licenseType; - ProvisioningTime = provisioningTime; - ProvisioningState = provisioningState; - InstanceView = instanceView; - TimeCreated = timeCreated; - Sku = sku; + this.Sku = sku; + this.PlatformFaultDomain = platformFaultDomain; + this.AutoReplaceOnFailure = autoReplaceOnFailure; + this.HostId = hostId; + this.VirtualMachines = virtualMachines; + this.LicenseType = licenseType; + this.ProvisioningTime = provisioningTime; + this.ProvisioningState = provisioningState; + this.InstanceView = instanceView; + this.TimeCreated = timeCreated; CustomInit(); } @@ -86,79 +90,76 @@ public DedicatedHostUpdate() /// partial void CustomInit(); + /// - /// Gets or sets fault domain of the dedicated host within a dedicated - /// host group. + /// Gets or sets [List all available dedicated host sizes for resizing] + /// (https://docs.microsoft.com/rest/api/compute/dedicated-hosts/listavailablesizes). + /// Resizing can be only used to scale up DedicatedHost. Only name is required + /// to be set. /// - [JsonProperty(PropertyName = "properties.platformFaultDomain")] - public int? PlatformFaultDomain { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public Sku Sku {get; set; } /// - /// Gets or sets specifies whether the dedicated host should be - /// replaced automatically in case of a failure. The value is defaulted - /// to 'true' when not provided. + /// Gets or sets fault domain of the dedicated host within a dedicated host + /// group. /// - [JsonProperty(PropertyName = "properties.autoReplaceOnFailure")] - public bool? AutoReplaceOnFailure { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.platformFaultDomain")] + public int? PlatformFaultDomain {get; set; } /// - /// Gets a unique id generated and assigned to the dedicated host by - /// the platform. Does not change throughout the lifetime of the host. + /// Gets or sets specifies whether the dedicated host should be replaced + /// automatically in case of a failure. The value is defaulted to 'true' when + /// not provided. /// - [JsonProperty(PropertyName = "properties.hostId")] - public string HostId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoReplaceOnFailure")] + public bool? AutoReplaceOnFailure {get; set; } /// - /// Gets a list of references to all virtual machines in the Dedicated - /// Host. + /// Gets a unique id generated and assigned to the dedicated host by the + /// platform. Does not change throughout the lifetime of the host. /// - [JsonProperty(PropertyName = "properties.virtualMachines")] - public IList VirtualMachines { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hostId")] + public string HostId {get; private set; } /// - /// Gets or sets specifies the software license type that will be - /// applied to the VMs deployed on the dedicated host. Possible values - /// are: **None,** **Windows_Server_Hybrid,** - /// **Windows_Server_Perpetual.** The default value is: **None.**. - /// Possible values include: 'None', 'Windows_Server_Hybrid', - /// 'Windows_Server_Perpetual' + /// Gets a list of references to all virtual machines in the Dedicated Host. /// - [JsonProperty(PropertyName = "properties.licenseType")] - public DedicatedHostLicenseTypes? LicenseType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachines")] + public System.Collections.Generic.IList VirtualMachines {get; private set; } /// - /// Gets the date when the host was first provisioned. + /// Gets or sets specifies the software license type that will be applied to + /// the VMs deployed on the dedicated host. Possible values are: **None,** + /// **Windows_Server_Hybrid,** **Windows_Server_Perpetual.** The default value + /// is: **None.** Possible values include: 'None', 'Windows_Server_Hybrid', 'Windows_Server_Perpetual' /// - [JsonProperty(PropertyName = "properties.provisioningTime")] - public System.DateTime? ProvisioningTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.licenseType")] + public DedicatedHostLicenseTypes? LicenseType {get; set; } /// - /// Gets the provisioning state, which only appears in the response. + /// Gets the date when the host was first provisioned. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningTime")] + public System.DateTime? ProvisioningTime {get; private set; } /// - /// Gets the dedicated host instance view. + /// Gets the provisioning state, which only appears in the response. /// - [JsonProperty(PropertyName = "properties.instanceView")] - public DedicatedHostInstanceView InstanceView { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets specifies the time at which the Dedicated Host resource was - /// created. Minimum api-version: 2021-11-01. + /// Gets the dedicated host instance view. /// - [JsonProperty(PropertyName = "properties.timeCreated")] - public System.DateTime? TimeCreated { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.instanceView")] + public DedicatedHostInstanceView InstanceView {get; private set; } /// - /// Gets or sets [List all available dedicated host sizes for resizing] - /// (https://docs.microsoft.com/rest/api/compute/dedicated-hosts/listavailablesizes). - /// Resizing can be only used to scale up DedicatedHost. Only name is - /// required to be set. + /// Gets specifies the time at which the Dedicated Host resource was created. + /// Minimum api-version: 2021-11-01. /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeCreated")] + public System.DateTime? TimeCreated {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostsCreateOrUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostsCreateOrUpdateHeaders.cs index a12372f2bf5f..f92cd17891cc 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostsCreateOrUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostsCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class DedicatedHostsCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// DedicatedHostsCreateOrUpdateHeaders class. + /// Initializes a new instance of the DedicatedHostsCreateOrUpdateHeaders class. /// public DedicatedHostsCreateOrUpdateHeaders() { @@ -28,18 +18,19 @@ public DedicatedHostsCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// DedicatedHostsCreateOrUpdateHeaders class. + /// Initializes a new instance of the DedicatedHostsCreateOrUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public DedicatedHostsCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public DedicatedHostsCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostsRedeployHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostsRedeployHeaders.cs index 51029f382882..c6980454efb0 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostsRedeployHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostsRedeployHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Redeploy operation. - /// public partial class DedicatedHostsRedeployHeaders { /// - /// Initializes a new instance of the DedicatedHostsRedeployHeaders - /// class. + /// Initializes a new instance of the DedicatedHostsRedeployHeaders class. /// public DedicatedHostsRedeployHeaders() { @@ -28,18 +18,19 @@ public DedicatedHostsRedeployHeaders() } /// - /// Initializes a new instance of the DedicatedHostsRedeployHeaders - /// class. + /// Initializes a new instance of the DedicatedHostsRedeployHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public DedicatedHostsRedeployHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public DedicatedHostsRedeployHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostsRestartHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostsRestartHeaders.cs index d020597d6393..192272e2fa1f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostsRestartHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostsRestartHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Restart operation. - /// public partial class DedicatedHostsRestartHeaders { /// - /// Initializes a new instance of the DedicatedHostsRestartHeaders - /// class. + /// Initializes a new instance of the DedicatedHostsRestartHeaders class. /// public DedicatedHostsRestartHeaders() { @@ -28,18 +18,19 @@ public DedicatedHostsRestartHeaders() } /// - /// Initializes a new instance of the DedicatedHostsRestartHeaders - /// class. + /// Initializes a new instance of the DedicatedHostsRestartHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public DedicatedHostsRestartHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public DedicatedHostsRestartHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostsUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostsUpdateHeaders.cs index 7952d4c38ae7..5a15630cf9f1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostsUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DedicatedHostsUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Update operation. - /// public partial class DedicatedHostsUpdateHeaders { /// - /// Initializes a new instance of the DedicatedHostsUpdateHeaders - /// class. + /// Initializes a new instance of the DedicatedHostsUpdateHeaders class. /// public DedicatedHostsUpdateHeaders() { @@ -28,18 +18,19 @@ public DedicatedHostsUpdateHeaders() } /// - /// Initializes a new instance of the DedicatedHostsUpdateHeaders - /// class. + /// Initializes a new instance of the DedicatedHostsUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public DedicatedHostsUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public DedicatedHostsUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DefaultVirtualMachineScaleSetInfo.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DefaultVirtualMachineScaleSetInfo.cs index 6e4fd884866f..a58702de41ac 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DefaultVirtualMachineScaleSetInfo.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DefaultVirtualMachineScaleSetInfo.cs @@ -1,28 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Indicates the target Virtual Machine ScaleSet properties upon - /// triggering a seamless migration without downtime of the VMs via the + /// Indicates the target Virtual Machine ScaleSet properties upon triggering a + /// seamless migration without downtime of the VMs via the /// ConvertToVirtualMachineScaleSet API. /// public partial class DefaultVirtualMachineScaleSetInfo { /// - /// Initializes a new instance of the DefaultVirtualMachineScaleSetInfo - /// class. + /// Initializes a new instance of the DefaultVirtualMachineScaleSetInfo class. /// public DefaultVirtualMachineScaleSetInfo() { @@ -30,21 +23,23 @@ public DefaultVirtualMachineScaleSetInfo() } /// - /// Initializes a new instance of the DefaultVirtualMachineScaleSetInfo - /// class. + /// Initializes a new instance of the DefaultVirtualMachineScaleSetInfo class. /// - /// Indicates if the the - /// maximum capacity of the default migrated Virtual Machine Scale Set - /// after its migration will be constrained to a limited number of - /// VMs. - /// The default Virtual - /// Machine ScaleSet Uri that the Availability Set will be moved to - /// upon triggering a seamless migration via the - /// ConvertToVirtualMachineScaleSet API. + + /// Indicates if the the maximum capacity of the default migrated Virtual + /// Machine Scale Set after its migration will be constrained to a limited + /// number of VMs. + /// + + /// The default Virtual Machine ScaleSet Uri that the Availability Set will be + /// moved to upon triggering a seamless migration via the + /// ConvertToVirtualMachineScaleSet API. + /// public DefaultVirtualMachineScaleSetInfo(bool? constrainedMaximumCapacity = default(bool?), SubResource defaultVirtualMachineScaleSet = default(SubResource)) + { - ConstrainedMaximumCapacity = constrainedMaximumCapacity; - DefaultVirtualMachineScaleSet = defaultVirtualMachineScaleSet; + this.ConstrainedMaximumCapacity = constrainedMaximumCapacity; + this.DefaultVirtualMachineScaleSet = defaultVirtualMachineScaleSet; CustomInit(); } @@ -53,21 +48,21 @@ public DefaultVirtualMachineScaleSetInfo() /// partial void CustomInit(); + /// - /// Gets indicates if the the maximum capacity of the default migrated - /// Virtual Machine Scale Set after its migration will be constrained - /// to a limited number of VMs. + /// Gets indicates if the the maximum capacity of the default migrated Virtual + /// Machine Scale Set after its migration will be constrained to a limited + /// number of VMs. /// - [JsonProperty(PropertyName = "constrainedMaximumCapacity")] - public bool? ConstrainedMaximumCapacity { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "constrainedMaximumCapacity")] + public bool? ConstrainedMaximumCapacity {get; private set; } /// - /// Gets the default Virtual Machine ScaleSet Uri that the Availability - /// Set will be moved to upon triggering a seamless migration via the + /// Gets the default Virtual Machine ScaleSet Uri that the Availability Set + /// will be moved to upon triggering a seamless migration via the /// ConvertToVirtualMachineScaleSet API. /// - [JsonProperty(PropertyName = "defaultVirtualMachineScaleSet")] - public SubResource DefaultVirtualMachineScaleSet { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultVirtualMachineScaleSet")] + public SubResource DefaultVirtualMachineScaleSet {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DeleteOptions.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DeleteOptions.cs index defbb5d32537..77c26616d592 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DeleteOptions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DeleteOptions.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for DeleteOptions. /// + + public static class DeleteOptions { public const string Delete = "Delete"; public const string Detach = "Detach"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiagnosticsProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiagnosticsProfile.cs index 682f24c59a9b..375dd5d36098 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiagnosticsProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiagnosticsProfile.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -30,16 +24,18 @@ public DiagnosticsProfile() /// /// Initializes a new instance of the DiagnosticsProfile class. /// - /// Boot Diagnostics is a debugging - /// feature which allows you to view Console Output and Screenshot to - /// diagnose VM status. **NOTE**: If storageUri is being specified then - /// ensure that the storage account is in the same region and - /// subscription as the VM. You can easily view the output of your - /// console log. Azure also enables you to see a screenshot of the VM - /// from the hypervisor. + + /// Boot Diagnostics is a debugging feature which allows you to view Console + /// Output and Screenshot to diagnose VM status. **NOTE**: If storageUri is + /// being specified then ensure that the storage account is in the same region + /// and subscription as the VM. You can easily view the output of your console + /// log. Azure also enables you to see a screenshot of the VM from the + /// hypervisor. + /// public DiagnosticsProfile(BootDiagnostics bootDiagnostics = default(BootDiagnostics)) + { - BootDiagnostics = bootDiagnostics; + this.BootDiagnostics = bootDiagnostics; CustomInit(); } @@ -48,16 +44,16 @@ public DiagnosticsProfile() /// partial void CustomInit(); + /// - /// Gets or sets boot Diagnostics is a debugging feature which allows - /// you to view Console Output and Screenshot to diagnose VM status. - /// **NOTE**: If storageUri is being specified then ensure that the - /// storage account is in the same region and subscription as the VM. - /// You can easily view the output of your console log. Azure also - /// enables you to see a screenshot of the VM from the hypervisor. + /// Gets or sets boot Diagnostics is a debugging feature which allows you to + /// view Console Output and Screenshot to diagnose VM status. **NOTE**: If + /// storageUri is being specified then ensure that the storage account is in + /// the same region and subscription as the VM. You can easily view the output + /// of your console log. Azure also enables you to see a screenshot of the VM + /// from the hypervisor. /// - [JsonProperty(PropertyName = "bootDiagnostics")] - public BootDiagnostics BootDiagnostics { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "bootDiagnostics")] + public BootDiagnostics BootDiagnostics {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiffDiskOptions.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiffDiskOptions.cs index 09c09a620cb3..37410d6c506c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiffDiskOptions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiffDiskOptions.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for DiffDiskOptions. /// + + public static class DiffDiskOptions { public const string Local = "Local"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiffDiskPlacement.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiffDiskPlacement.cs index f0ac290053ce..05df0d793fe7 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiffDiskPlacement.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiffDiskPlacement.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for DiffDiskPlacement. /// + + public static class DiffDiskPlacement { public const string CacheDisk = "CacheDisk"; public const string ResourceDisk = "ResourceDisk"; public const string NvmeDisk = "NvmeDisk"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiffDiskSettings.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiffDiskSettings.cs index cbacaf19e368..f8d4ae2ed10a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiffDiskSettings.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiffDiskSettings.cs @@ -1,22 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Describes the parameters of ephemeral disk settings that can be - /// specified for operating system disk. **Note:** The ephemeral disk - /// settings can only be specified for managed disk. + /// Describes the parameters of ephemeral disk settings that can be specified + /// for operating system disk. **Note:** The ephemeral disk settings can only + /// be specified for managed disk. /// public partial class DiffDiskSettings { @@ -31,24 +25,25 @@ public DiffDiskSettings() /// /// Initializes a new instance of the DiffDiskSettings class. /// - /// Specifies the ephemeral disk settings for - /// operating system disk. Possible values include: 'Local' - /// Specifies the ephemeral disk placement for - /// operating system disk. Possible values are: **CacheDisk,** - /// **ResourceDisk,** **NvmeDisk.** The defaulting behavior is: - /// **CacheDisk** if one is configured for the VM size otherwise + + /// Specifies the ephemeral disk settings for operating system disk. + /// Possible values include: 'Local' + + /// Specifies the ephemeral disk placement for operating system disk. Possible + /// values are: **CacheDisk,** **ResourceDisk,** **NvmeDisk.** The defaulting + /// behavior is: **CacheDisk** if one is configured for the VM size otherwise /// **ResourceDisk** or **NvmeDisk** is used. Refer to the VM size /// documentation for Windows VM at - /// https://docs.microsoft.com/azure/virtual-machines/windows/sizes and - /// Linux VM at - /// https://docs.microsoft.com/azure/virtual-machines/linux/sizes to + /// https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux + /// VM at https://docs.microsoft.com/azure/virtual-machines/linux/sizes to /// check which VM sizes exposes a cache disk. Minimum api-version for - /// NvmeDisk: 2024-03-01. Possible values include: 'CacheDisk', - /// 'ResourceDisk', 'NvmeDisk' + /// NvmeDisk: 2024-03-01. + /// Possible values include: 'CacheDisk', 'ResourceDisk', 'NvmeDisk' public DiffDiskSettings(string option = default(string), string placement = default(string)) + { - Option = option; - Placement = placement; + this.Option = option; + this.Placement = placement; CustomInit(); } @@ -57,29 +52,26 @@ public DiffDiskSettings() /// partial void CustomInit(); + /// - /// Gets or sets specifies the ephemeral disk settings for operating - /// system disk. Possible values include: 'Local' + /// Gets or sets specifies the ephemeral disk settings for operating system + /// disk. Possible values include: 'Local' /// - [JsonProperty(PropertyName = "option")] - public string Option { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "option")] + public string Option {get; set; } /// - /// Gets or sets specifies the ephemeral disk placement for operating - /// system disk. Possible values are: **CacheDisk,** **ResourceDisk,** - /// **NvmeDisk.** The defaulting behavior is: **CacheDisk** if one is - /// configured for the VM size otherwise **ResourceDisk** or - /// **NvmeDisk** is used. Refer to the VM size documentation for - /// Windows VM at - /// https://docs.microsoft.com/azure/virtual-machines/windows/sizes and - /// Linux VM at - /// https://docs.microsoft.com/azure/virtual-machines/linux/sizes to + /// Gets or sets specifies the ephemeral disk placement for operating system + /// disk. Possible values are: **CacheDisk,** **ResourceDisk,** **NvmeDisk.** + /// The defaulting behavior is: **CacheDisk** if one is configured for the VM + /// size otherwise **ResourceDisk** or **NvmeDisk** is used. Refer to the VM + /// size documentation for Windows VM at + /// https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux + /// VM at https://docs.microsoft.com/azure/virtual-machines/linux/sizes to /// check which VM sizes exposes a cache disk. Minimum api-version for - /// NvmeDisk: 2024-03-01. Possible values include: 'CacheDisk', - /// 'ResourceDisk', 'NvmeDisk' + /// NvmeDisk: 2024-03-01. Possible values include: 'CacheDisk', 'ResourceDisk', 'NvmeDisk' /// - [JsonProperty(PropertyName = "placement")] - public string Placement { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "placement")] + public string Placement {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Disallowed.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Disallowed.cs index 19df1e283280..b700f8de4865 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Disallowed.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/Disallowed.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public Disallowed() /// /// Initializes a new instance of the Disallowed class. /// - /// A list of disk types. - public Disallowed(IList diskTypes = default(IList)) + + /// A list of disk types. + /// + public Disallowed(System.Collections.Generic.IList diskTypes = default(System.Collections.Generic.IList)) + { - DiskTypes = diskTypes; + this.DiskTypes = diskTypes; CustomInit(); } @@ -43,11 +38,11 @@ public Disallowed() /// partial void CustomInit(); + /// /// Gets or sets a list of disk types. /// - [JsonProperty(PropertyName = "diskTypes")] - public IList DiskTypes { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "diskTypes")] + public System.Collections.Generic.IList DiskTypes {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DisallowedConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DisallowedConfiguration.cs index cc640a3e69db..7cb9dc75d648 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DisallowedConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DisallowedConfiguration.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public DisallowedConfiguration() /// /// Initializes a new instance of the DisallowedConfiguration class. /// + /// VM disk types which are disallowed. - /// Possible values include: 'None', 'Unmanaged' + /// Possible values include: 'None', 'Unmanaged' public DisallowedConfiguration(string vmDiskType = default(string)) + { - VmDiskType = vmDiskType; + this.VMDiskType = vmDiskType; CustomInit(); } @@ -42,12 +38,11 @@ public DisallowedConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets VM disk types which are disallowed. Possible values - /// include: 'None', 'Unmanaged' + /// Gets or sets vM disk types which are disallowed. Possible values include: 'None', 'Unmanaged' /// - [JsonProperty(PropertyName = "vmDiskType")] - public string VmDiskType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "vmDiskType")] + public string VMDiskType {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Disk.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Disk.cs index 44c2d93233d9..eb927c90fe4e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Disk.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/Disk.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Disk resource. /// - [Rest.Serialization.JsonTransformation] - public partial class Disk : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class Disk : TrackedResource { /// /// Initializes a new instance of the Disk class. @@ -34,164 +24,215 @@ public Disk() /// /// Initializes a new instance of the Disk class. /// - /// Resource location - /// Disk source information. CreationData - /// information cannot be changed after the disk has been - /// created. - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The time when the disk was - /// created. - /// The Operating System type. Possible values - /// include: 'Windows', 'Linux' - /// The hypervisor generation of the - /// Virtual Machine. Applicable to OS disks only. Possible values - /// include: 'V1', 'V2' - /// Purchase plan information for the the - /// image from which the OS disk was created. E.g. - {name: - /// 2019-Datacenter, publisher: MicrosoftWindowsServer, product: - /// WindowsServer} - /// List of supported capabilities - /// for the image from which the OS disk was created. - /// If creationData.createOption is Empty, - /// this field is mandatory and it indicates the size of the disk to - /// create. If this field is present for updates or creation with other - /// options, it indicates a resize. Resizes are only allowed if the - /// disk is not attached to a running VM, and can only increase the - /// disk's size. - /// The size of the disk in bytes. This - /// field is read only. - /// Unique Guid identifying the - /// resource. - /// Encryption settings - /// collection used for Azure Disk Encryption, can contain multiple - /// encryption settings per disk or snapshot. - /// The disk provisioning - /// state. - /// The number of IOPS allowed for this - /// disk; only settable for UltraSSD disks. One operation can transfer - /// between 4k and 256k bytes. - /// The bandwidth allowed for this - /// disk; only settable for UltraSSD disks. MBps means millions of - /// bytes per second - MB here uses the ISO notation, of powers of - /// 10. - /// The total number of IOPS that will - /// be allowed across all VMs mounting the shared disk as ReadOnly. One - /// operation can transfer between 4k and 256k bytes. - /// The total throughput (MBps) that - /// will be allowed across all VMs mounting the shared disk as - /// ReadOnly. MBps means millions of bytes per second - MB here uses - /// the ISO notation, of powers of 10. - /// The state of the disk. Possible values - /// include: 'Unattached', 'Attached', 'Reserved', 'Frozen', - /// 'ActiveSAS', 'ActiveSASFrozen', 'ReadyToUpload', - /// 'ActiveUpload' - /// Encryption property can be used to encrypt - /// data at rest with customer managed keys or platform managed - /// keys. - /// The maximum number of VMs that can attach - /// to the disk at the same time. Value greater than one indicates a - /// disk that can be mounted on multiple VMs at the same time. - /// Details of the list of all VMs that have - /// the disk attached. maxShares should be set to a value greater than - /// one for disks to allow attaching them to multiple VMs. - /// Policy for accessing the disk via - /// network. Possible values include: 'AllowAll', 'AllowPrivate', - /// 'DenyAll' - /// ARM id of the DiskAccess resource for - /// using private endpoints on disks. - /// Latest time when bursting was - /// last enabled on a disk. - /// Performance tier of the disk (e.g, P4, S10) as - /// described here: - /// https://azure.microsoft.com/en-us/pricing/details/managed-disks/. - /// Does not apply to Ultra disks. - /// Set to true to enable bursting beyond - /// the provisioned performance target of the disk. Bursting is - /// disabled by default. Does not apply to Ultra disks. - /// Properties of the disk for - /// which update is pending. - /// Indicates the OS on a disk - /// supports hibernation. - /// Contains the security related - /// information for the resource. - /// Percentage complete for the - /// background copy when a resource is created via the CopyStart - /// operation. - /// Policy for controlling export on - /// the disk. Possible values include: 'Enabled', 'Disabled' - /// Additional authentication - /// requirements when exporting or uploading to a disk or snapshot. - /// Possible values include: 'AzureActiveDirectory', 'None' - /// Setting this property to - /// true improves reliability and performance of data disks that are - /// frequently (more than 5 times a day) by detached from one virtual - /// machine and attached to another. This property should not be set - /// for disks that are not detached and attached frequently as it - /// causes the disks to not align with the fault domain of the virtual - /// machine. - /// The UTC time when the - /// ownership state of the disk was last changed i.e., the time the - /// disk was last attached or detached from a VM or the time when the - /// VM to which the disk was attached was deallocated or - /// started. - /// Determines how platform treats - /// disk failures - /// A relative URI containing the ID of the VM - /// that has the disk attached. - /// List of relative URIs containing - /// the IDs of the VMs that have the disk attached. maxShares should be - /// set to a value greater than one for disks to allow attaching them - /// to multiple VMs. - /// The disks sku name. Can be Standard_LRS, - /// Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, - /// StandardSSD_ZRS, or PremiumV2_LRS. - /// The Logical zone list for Disk. - /// The extended location where the disk - /// will be created. Extended location cannot be changed. - public Disk(string location, CreationData creationData, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), System.DateTime? timeCreated = default(System.DateTime?), OperatingSystemTypes? osType = default(OperatingSystemTypes?), string hyperVGeneration = default(string), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), int? diskSizeGB = default(int?), long? diskSizeBytes = default(long?), string uniqueId = default(string), EncryptionSettingsCollection encryptionSettingsCollection = default(EncryptionSettingsCollection), string provisioningState = default(string), long? diskIOPSReadWrite = default(long?), long? diskMBpsReadWrite = default(long?), long? diskIOPSReadOnly = default(long?), long? diskMBpsReadOnly = default(long?), string diskState = default(string), Encryption encryption = default(Encryption), int? maxShares = default(int?), IList shareInfo = default(IList), string networkAccessPolicy = default(string), string diskAccessId = default(string), System.DateTime? burstingEnabledTime = default(System.DateTime?), string tier = default(string), bool? burstingEnabled = default(bool?), PropertyUpdatesInProgress propertyUpdatesInProgress = default(PropertyUpdatesInProgress), bool? supportsHibernation = default(bool?), DiskSecurityProfile securityProfile = default(DiskSecurityProfile), double? completionPercent = default(double?), string publicNetworkAccess = default(string), string dataAccessAuthMode = default(string), bool? optimizedForFrequentAttach = default(bool?), System.DateTime? lastOwnershipUpdateTime = default(System.DateTime?), AvailabilityPolicy availabilityPolicy = default(AvailabilityPolicy), string managedBy = default(string), IList managedByExtended = default(IList), DiskSku sku = default(DiskSku), IList zones = default(IList), ExtendedLocation extendedLocation = default(ExtendedLocation)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// A relative URI containing the ID of the VM that has the disk attached. + /// + + /// List of relative URIs containing the IDs of the VMs that have the disk + /// attached. maxShares should be set to a value greater than one for disks to + /// allow attaching them to multiple VMs. + /// + + /// The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, + /// UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. + /// + + /// The Logical zone list for Disk. + /// + + /// The extended location where the disk will be created. Extended location + /// cannot be changed. + /// + + /// Purchase plan information for the the image from which the OS disk was + /// created. E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, + /// product: WindowsServer} + /// + + /// List of supported capabilities for the image from which the OS disk was + /// created. + /// + + /// Disk source information. CreationData information cannot be changed after + /// the disk has been created. + /// + + /// The state of the disk. + /// Possible values include: 'Unattached', 'Attached', 'Reserved', 'Frozen', + /// 'ActiveSAS', 'ActiveSASFrozen', 'ReadyToUpload', 'ActiveUpload' + + /// Encryption property can be used to encrypt data at rest with customer + /// managed keys or platform managed keys. + /// + + /// Determines how platform treats disk failures + /// + + /// The time when the disk was created. + /// + + /// The Operating System type. + /// Possible values include: 'Windows', 'Linux' + + /// The hypervisor generation of the Virtual Machine. Applicable to OS disks + /// only. + /// Possible values include: 'V1', 'V2' + + /// If creationData.createOption is Empty, this field is mandatory and it + /// indicates the size of the disk to create. If this field is present for + /// updates or creation with other options, it indicates a resize. Resizes are + /// only allowed if the disk is not attached to a running VM, and can only + /// increase the disk's size. + /// + + /// The size of the disk in bytes. This field is read only. + /// + + /// Unique Guid identifying the resource. + /// + + /// Encryption settings collection used for Azure Disk Encryption, can contain + /// multiple encryption settings per disk or snapshot. + /// + + /// The disk provisioning state. + /// + + /// The number of IOPS allowed for this disk; only settable for UltraSSD disks. + /// One operation can transfer between 4k and 256k bytes. + /// + + /// The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps + /// means millions of bytes per second - MB here uses the ISO notation, of + /// powers of 10. + /// + + /// The total number of IOPS that will be allowed across all VMs mounting the + /// shared disk as ReadOnly. One operation can transfer between 4k and 256k + /// bytes. + /// + + /// The total throughput (MBps) that will be allowed across all VMs mounting + /// the shared disk as ReadOnly. MBps means millions of bytes per second - MB + /// here uses the ISO notation, of powers of 10. + /// + + /// The maximum number of VMs that can attach to the disk at the same time. + /// Value greater than one indicates a disk that can be mounted on multiple VMs + /// at the same time. + /// + + /// Details of the list of all VMs that have the disk attached. maxShares + /// should be set to a value greater than one for disks to allow attaching them + /// to multiple VMs. + /// + + /// Policy for accessing the disk via network. + /// Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + + /// ARM id of the DiskAccess resource for using private endpoints on disks. + /// + + /// Latest time when bursting was last enabled on a disk. + /// + + /// Performance tier of the disk (e.g, P4, S10) as described here: + /// https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not + /// apply to Ultra disks. + /// + + /// Set to true to enable bursting beyond the provisioned performance target of + /// the disk. Bursting is disabled by default. Does not apply to Ultra disks. + /// + + /// Properties of the disk for which update is pending. + /// + + /// Indicates the OS on a disk supports hibernation. + /// + + /// Contains the security related information for the resource. + /// + + /// Percentage complete for the background copy when a resource is created via + /// the CopyStart operation. + /// + + /// Policy for controlling export on the disk. + /// Possible values include: 'Enabled', 'Disabled' + + /// Additional authentication requirements when exporting or uploading to a + /// disk or snapshot. + /// Possible values include: 'AzureActiveDirectory', 'None' + + /// Setting this property to true improves reliability and performance of data + /// disks that are frequently (more than 5 times a day) by detached from one + /// virtual machine and attached to another. This property should not be set + /// for disks that are not detached and attached frequently as it causes the + /// disks to not align with the fault domain of the virtual machine. + /// + + /// The UTC time when the ownership state of the disk was last changed i.e., + /// the time the disk was last attached or detached from a VM or the time when + /// the VM to which the disk was attached was deallocated or started. + /// + public Disk(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string managedBy = default(string), System.Collections.Generic.IList managedByExtended = default(System.Collections.Generic.IList), DiskSku sku = default(DiskSku), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), ExtendedLocation extendedLocation = default(ExtendedLocation), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), CreationData creationData = default(CreationData), string diskState = default(string), Encryption encryption = default(Encryption), AvailabilityPolicy availabilityPolicy = default(AvailabilityPolicy), System.DateTime? timeCreated = default(System.DateTime?), OperatingSystemTypes? osType = default(OperatingSystemTypes?), string hyperVGeneration = default(string), int? diskSizeGb = default(int?), long? diskSizeBytes = default(long?), string uniqueId = default(string), EncryptionSettingsCollection encryptionSettingsCollection = default(EncryptionSettingsCollection), string provisioningState = default(string), long? diskIopsReadWrite = default(long?), long? diskMBpsReadWrite = default(long?), long? diskIopsReadOnly = default(long?), long? diskMBpsReadOnly = default(long?), int? maxShares = default(int?), System.Collections.Generic.IList shareInfo = default(System.Collections.Generic.IList), string networkAccessPolicy = default(string), string diskAccessId = default(string), System.DateTime? burstingEnabledTime = default(System.DateTime?), string tier = default(string), bool? burstingEnabled = default(bool?), PropertyUpdatesInProgress propertyUpdatesInProgress = default(PropertyUpdatesInProgress), bool? supportsHibernation = default(bool?), DiskSecurityProfile securityProfile = default(DiskSecurityProfile), double? completionPercent = default(double?), string publicNetworkAccess = default(string), string dataAccessAuthMode = default(string), bool? optimizedForFrequentAttach = default(bool?), System.DateTime? lastOwnershipUpdateTime = default(System.DateTime?)) + + : base(location, id, name, type, tags) { - TimeCreated = timeCreated; - OsType = osType; - HyperVGeneration = hyperVGeneration; - PurchasePlan = purchasePlan; - SupportedCapabilities = supportedCapabilities; - CreationData = creationData; - DiskSizeGB = diskSizeGB; - DiskSizeBytes = diskSizeBytes; - UniqueId = uniqueId; - EncryptionSettingsCollection = encryptionSettingsCollection; - ProvisioningState = provisioningState; - DiskIOPSReadWrite = diskIOPSReadWrite; - DiskMBpsReadWrite = diskMBpsReadWrite; - DiskIOPSReadOnly = diskIOPSReadOnly; - DiskMBpsReadOnly = diskMBpsReadOnly; - DiskState = diskState; - Encryption = encryption; - MaxShares = maxShares; - ShareInfo = shareInfo; - NetworkAccessPolicy = networkAccessPolicy; - DiskAccessId = diskAccessId; - BurstingEnabledTime = burstingEnabledTime; - Tier = tier; - BurstingEnabled = burstingEnabled; - PropertyUpdatesInProgress = propertyUpdatesInProgress; - SupportsHibernation = supportsHibernation; - SecurityProfile = securityProfile; - CompletionPercent = completionPercent; - PublicNetworkAccess = publicNetworkAccess; - DataAccessAuthMode = dataAccessAuthMode; - OptimizedForFrequentAttach = optimizedForFrequentAttach; - LastOwnershipUpdateTime = lastOwnershipUpdateTime; - AvailabilityPolicy = availabilityPolicy; - ManagedBy = managedBy; - ManagedByExtended = managedByExtended; - Sku = sku; - Zones = zones; - ExtendedLocation = extendedLocation; + this.ManagedBy = managedBy; + this.ManagedByExtended = managedByExtended; + this.Sku = sku; + this.Zones = zones; + this.ExtendedLocation = extendedLocation; + this.PurchasePlan = purchasePlan; + this.SupportedCapabilities = supportedCapabilities; + this.CreationData = creationData; + this.DiskState = diskState; + this.Encryption = encryption; + this.AvailabilityPolicy = availabilityPolicy; + this.TimeCreated = timeCreated; + this.OsType = osType; + this.HyperVGeneration = hyperVGeneration; + this.DiskSizeGB = diskSizeGb; + this.DiskSizeBytes = diskSizeBytes; + this.UniqueId = uniqueId; + this.EncryptionSettingsCollection = encryptionSettingsCollection; + this.ProvisioningState = provisioningState; + this.DiskIOPSReadWrite = diskIopsReadWrite; + this.DiskMBpsReadWrite = diskMBpsReadWrite; + this.DiskIopsReadOnly = diskIopsReadOnly; + this.DiskMBpsReadOnly = diskMBpsReadOnly; + this.MaxShares = maxShares; + this.ShareInfo = shareInfo; + this.NetworkAccessPolicy = networkAccessPolicy; + this.DiskAccessId = diskAccessId; + this.BurstingEnabledTime = burstingEnabledTime; + this.Tier = tier; + this.BurstingEnabled = burstingEnabled; + this.PropertyUpdatesInProgress = propertyUpdatesInProgress; + this.SupportsHibernation = supportsHibernation; + this.SecurityProfile = securityProfile; + this.CompletionPercent = completionPercent; + this.PublicNetworkAccess = publicNetworkAccess; + this.DataAccessAuthMode = dataAccessAuthMode; + this.OptimizedForFrequentAttach = optimizedForFrequentAttach; + this.LastOwnershipUpdateTime = lastOwnershipUpdateTime; CustomInit(); } @@ -200,313 +241,317 @@ public Disk() /// partial void CustomInit(); + /// - /// Gets the time when the disk was created. + /// Gets a relative URI containing the ID of the VM that has the disk attached. /// - [JsonProperty(PropertyName = "properties.timeCreated")] - public System.DateTime? TimeCreated { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managedBy")] + public string ManagedBy {get; private set; } /// - /// Gets or sets the Operating System type. Possible values include: - /// 'Windows', 'Linux' + /// Gets list of relative URIs containing the IDs of the VMs that have the disk + /// attached. maxShares should be set to a value greater than one for disks to + /// allow attaching them to multiple VMs. /// - [JsonProperty(PropertyName = "properties.osType")] - public OperatingSystemTypes? OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managedByExtended")] + public System.Collections.Generic.IList ManagedByExtended {get; private set; } /// - /// Gets or sets the hypervisor generation of the Virtual Machine. - /// Applicable to OS disks only. Possible values include: 'V1', 'V2' + /// Gets or sets the disks sku name. Can be Standard_LRS, Premium_LRS, + /// StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or + /// PremiumV2_LRS. /// - [JsonProperty(PropertyName = "properties.hyperVGeneration")] - public string HyperVGeneration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public DiskSku Sku {get; set; } /// - /// Gets or sets purchase plan information for the the image from which - /// the OS disk was created. E.g. - {name: 2019-Datacenter, publisher: - /// MicrosoftWindowsServer, product: WindowsServer} + /// Gets or sets the Logical zone list for Disk. /// - [JsonProperty(PropertyName = "properties.purchasePlan")] - public PurchasePlan PurchasePlan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } /// - /// Gets or sets list of supported capabilities for the image from - /// which the OS disk was created. + /// Gets or sets the extended location where the disk will be created. Extended + /// location cannot be changed. /// - [JsonProperty(PropertyName = "properties.supportedCapabilities")] - public SupportedCapabilities SupportedCapabilities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation {get; set; } /// - /// Gets or sets disk source information. CreationData information - /// cannot be changed after the disk has been created. + /// Gets or sets purchase plan information for the the image from which the OS + /// disk was created. E.g. - {name: 2019-Datacenter, publisher: + /// MicrosoftWindowsServer, product: WindowsServer} /// - [JsonProperty(PropertyName = "properties.creationData")] - public CreationData CreationData { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.purchasePlan")] + public PurchasePlan PurchasePlan {get; set; } /// - /// Gets or sets if creationData.createOption is Empty, this field is - /// mandatory and it indicates the size of the disk to create. If this - /// field is present for updates or creation with other options, it - /// indicates a resize. Resizes are only allowed if the disk is not - /// attached to a running VM, and can only increase the disk's size. + /// Gets or sets list of supported capabilities for the image from which the OS + /// disk was created. /// - [JsonProperty(PropertyName = "properties.diskSizeGB")] - public int? DiskSizeGB { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.supportedCapabilities")] + public SupportedCapabilities SupportedCapabilities {get; set; } /// - /// Gets the size of the disk in bytes. This field is read only. + /// Gets or sets disk source information. CreationData information cannot be + /// changed after the disk has been created. /// - [JsonProperty(PropertyName = "properties.diskSizeBytes")] - public long? DiskSizeBytes { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.creationData")] + public CreationData CreationData {get; set; } /// - /// Gets unique Guid identifying the resource. + /// Gets the state of the disk. Possible values include: 'Unattached', 'Attached', 'Reserved', 'Frozen', 'ActiveSAS', 'ActiveSASFrozen', 'ReadyToUpload', 'ActiveUpload' /// - [JsonProperty(PropertyName = "properties.uniqueId")] - public string UniqueId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskState")] + public string DiskState {get; private set; } /// - /// Gets or sets encryption settings collection used for Azure Disk - /// Encryption, can contain multiple encryption settings per disk or - /// snapshot. + /// Gets or sets encryption property can be used to encrypt data at rest with + /// customer managed keys or platform managed keys. /// - [JsonProperty(PropertyName = "properties.encryptionSettingsCollection")] - public EncryptionSettingsCollection EncryptionSettingsCollection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryption")] + public Encryption Encryption {get; set; } /// - /// Gets the disk provisioning state. + /// Gets or sets determines how platform treats disk failures /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.availabilityPolicy")] + public AvailabilityPolicy AvailabilityPolicy {get; set; } /// - /// Gets or sets the number of IOPS allowed for this disk; only - /// settable for UltraSSD disks. One operation can transfer between 4k - /// and 256k bytes. + /// Gets the time when the disk was created. /// - [JsonProperty(PropertyName = "properties.diskIOPSReadWrite")] - public long? DiskIOPSReadWrite { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeCreated")] + public System.DateTime? TimeCreated {get; private set; } /// - /// Gets or sets the bandwidth allowed for this disk; only settable for - /// UltraSSD disks. MBps means millions of bytes per second - MB here - /// uses the ISO notation, of powers of 10. + /// Gets or sets the Operating System type. Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "properties.diskMBpsReadWrite")] - public long? DiskMBpsReadWrite { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osType")] + public OperatingSystemTypes? OsType {get; set; } /// - /// Gets or sets the total number of IOPS that will be allowed across - /// all VMs mounting the shared disk as ReadOnly. One operation can - /// transfer between 4k and 256k bytes. + /// Gets or sets the hypervisor generation of the Virtual Machine. Applicable + /// to OS disks only. Possible values include: 'V1', 'V2' /// - [JsonProperty(PropertyName = "properties.diskIOPSReadOnly")] - public long? DiskIOPSReadOnly { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hyperVGeneration")] + public string HyperVGeneration {get; set; } /// - /// Gets or sets the total throughput (MBps) that will be allowed - /// across all VMs mounting the shared disk as ReadOnly. MBps means - /// millions of bytes per second - MB here uses the ISO notation, of - /// powers of 10. + /// Gets or sets if creationData.createOption is Empty, this field is mandatory + /// and it indicates the size of the disk to create. If this field is present + /// for updates or creation with other options, it indicates a resize. Resizes + /// are only allowed if the disk is not attached to a running VM, and can only + /// increase the disk's size. /// - [JsonProperty(PropertyName = "properties.diskMBpsReadOnly")] - public long? DiskMBpsReadOnly { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskSizeGB")] + public int? DiskSizeGB {get; set; } /// - /// Gets the state of the disk. Possible values include: 'Unattached', - /// 'Attached', 'Reserved', 'Frozen', 'ActiveSAS', 'ActiveSASFrozen', - /// 'ReadyToUpload', 'ActiveUpload' + /// Gets the size of the disk in bytes. This field is read only. /// - [JsonProperty(PropertyName = "properties.diskState")] - public string DiskState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskSizeBytes")] + public long? DiskSizeBytes {get; private set; } /// - /// Gets or sets encryption property can be used to encrypt data at - /// rest with customer managed keys or platform managed keys. + /// Gets unique Guid identifying the resource. /// - [JsonProperty(PropertyName = "properties.encryption")] - public Encryption Encryption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueId")] + public string UniqueId {get; private set; } /// - /// Gets or sets the maximum number of VMs that can attach to the disk - /// at the same time. Value greater than one indicates a disk that can - /// be mounted on multiple VMs at the same time. + /// Gets or sets encryption settings collection used for Azure Disk Encryption, + /// can contain multiple encryption settings per disk or snapshot. /// - [JsonProperty(PropertyName = "properties.maxShares")] - public int? MaxShares { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryptionSettingsCollection")] + public EncryptionSettingsCollection EncryptionSettingsCollection {get; set; } /// - /// Gets details of the list of all VMs that have the disk attached. - /// maxShares should be set to a value greater than one for disks to - /// allow attaching them to multiple VMs. + /// Gets the disk provisioning state. /// - [JsonProperty(PropertyName = "properties.shareInfo")] - public IList ShareInfo { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets policy for accessing the disk via network. Possible - /// values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + /// Gets or sets the number of IOPS allowed for this disk; only settable for + /// UltraSSD disks. One operation can transfer between 4k and 256k bytes. /// - [JsonProperty(PropertyName = "properties.networkAccessPolicy")] - public string NetworkAccessPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskIOPSReadWrite")] + public long? DiskIOPSReadWrite {get; set; } /// - /// Gets or sets ARM id of the DiskAccess resource for using private - /// endpoints on disks. + /// Gets or sets the bandwidth allowed for this disk; only settable for + /// UltraSSD disks. MBps means millions of bytes per second - MB here uses the + /// ISO notation, of powers of 10. /// - [JsonProperty(PropertyName = "properties.diskAccessId")] - public string DiskAccessId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskMBpsReadWrite")] + public long? DiskMBpsReadWrite {get; set; } /// - /// Gets latest time when bursting was last enabled on a disk. + /// Gets or sets the total number of IOPS that will be allowed across all VMs + /// mounting the shared disk as ReadOnly. One operation can transfer between 4k + /// and 256k bytes. /// - [JsonProperty(PropertyName = "properties.burstingEnabledTime")] - public System.DateTime? BurstingEnabledTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskIOPSReadOnly")] + public long? DiskIopsReadOnly {get; set; } /// - /// Gets or sets performance tier of the disk (e.g, P4, S10) as - /// described here: - /// https://azure.microsoft.com/en-us/pricing/details/managed-disks/. - /// Does not apply to Ultra disks. + /// Gets or sets the total throughput (MBps) that will be allowed across all + /// VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per + /// second - MB here uses the ISO notation, of powers of 10. /// - [JsonProperty(PropertyName = "properties.tier")] - public string Tier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskMBpsReadOnly")] + public long? DiskMBpsReadOnly {get; set; } /// - /// Gets or sets set to true to enable bursting beyond the provisioned - /// performance target of the disk. Bursting is disabled by default. - /// Does not apply to Ultra disks. + /// Gets or sets the maximum number of VMs that can attach to the disk at the + /// same time. Value greater than one indicates a disk that can be mounted on + /// multiple VMs at the same time. /// - [JsonProperty(PropertyName = "properties.burstingEnabled")] - public bool? BurstingEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.maxShares")] + public int? MaxShares {get; set; } /// - /// Gets properties of the disk for which update is pending. + /// Gets details of the list of all VMs that have the disk attached. maxShares + /// should be set to a value greater than one for disks to allow attaching them + /// to multiple VMs. /// - [JsonProperty(PropertyName = "properties.propertyUpdatesInProgress")] - public PropertyUpdatesInProgress PropertyUpdatesInProgress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.shareInfo")] + public System.Collections.Generic.IList ShareInfo {get; private set; } /// - /// Gets or sets indicates the OS on a disk supports hibernation. + /// Gets or sets policy for accessing the disk via network. Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' /// - [JsonProperty(PropertyName = "properties.supportsHibernation")] - public bool? SupportsHibernation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkAccessPolicy")] + public string NetworkAccessPolicy {get; set; } /// - /// Gets or sets contains the security related information for the - /// resource. + /// Gets or sets aRM id of the DiskAccess resource for using private endpoints + /// on disks. /// - [JsonProperty(PropertyName = "properties.securityProfile")] - public DiskSecurityProfile SecurityProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskAccessId")] + public string DiskAccessId {get; set; } /// - /// Gets or sets percentage complete for the background copy when a - /// resource is created via the CopyStart operation. + /// Gets latest time when bursting was last enabled on a disk. /// - [JsonProperty(PropertyName = "properties.completionPercent")] - public double? CompletionPercent { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.burstingEnabledTime")] + public System.DateTime? BurstingEnabledTime {get; private set; } /// - /// Gets or sets policy for controlling export on the disk. Possible - /// values include: 'Enabled', 'Disabled' + /// Gets or sets performance tier of the disk (e.g, P4, S10) as described here: + /// https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not + /// apply to Ultra disks. /// - [JsonProperty(PropertyName = "properties.publicNetworkAccess")] - public string PublicNetworkAccess { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.tier")] + public string Tier {get; set; } /// - /// Gets or sets additional authentication requirements when exporting - /// or uploading to a disk or snapshot. Possible values include: - /// 'AzureActiveDirectory', 'None' + /// Gets or sets set to true to enable bursting beyond the provisioned + /// performance target of the disk. Bursting is disabled by default. Does not + /// apply to Ultra disks. /// - [JsonProperty(PropertyName = "properties.dataAccessAuthMode")] - public string DataAccessAuthMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.burstingEnabled")] + public bool? BurstingEnabled {get; set; } /// - /// Gets or sets setting this property to true improves reliability and - /// performance of data disks that are frequently (more than 5 times a - /// day) by detached from one virtual machine and attached to another. - /// This property should not be set for disks that are not detached and - /// attached frequently as it causes the disks to not align with the - /// fault domain of the virtual machine. + /// Gets properties of the disk for which update is pending. /// - [JsonProperty(PropertyName = "properties.optimizedForFrequentAttach")] - public bool? OptimizedForFrequentAttach { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.propertyUpdatesInProgress")] + public PropertyUpdatesInProgress PropertyUpdatesInProgress {get; private set; } /// - /// Gets the UTC time when the ownership state of the disk was last - /// changed i.e., the time the disk was last attached or detached from - /// a VM or the time when the VM to which the disk was attached was - /// deallocated or started. + /// Gets or sets indicates the OS on a disk supports hibernation. /// - [JsonProperty(PropertyName = "properties.LastOwnershipUpdateTime")] - public System.DateTime? LastOwnershipUpdateTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.supportsHibernation")] + public bool? SupportsHibernation {get; set; } /// - /// Gets or sets determines how platform treats disk failures + /// Gets or sets contains the security related information for the resource. /// - [JsonProperty(PropertyName = "properties.availabilityPolicy")] - public AvailabilityPolicy AvailabilityPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityProfile")] + public DiskSecurityProfile SecurityProfile {get; set; } /// - /// Gets a relative URI containing the ID of the VM that has the disk - /// attached. + /// Gets or sets percentage complete for the background copy when a resource is + /// created via the CopyStart operation. /// - [JsonProperty(PropertyName = "managedBy")] - public string ManagedBy { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.completionPercent")] + public double? CompletionPercent {get; set; } /// - /// Gets list of relative URIs containing the IDs of the VMs that have - /// the disk attached. maxShares should be set to a value greater than - /// one for disks to allow attaching them to multiple VMs. + /// Gets or sets policy for controlling export on the disk. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "managedByExtended")] - public IList ManagedByExtended { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicNetworkAccess")] + public string PublicNetworkAccess {get; set; } /// - /// Gets or sets the disks sku name. Can be Standard_LRS, Premium_LRS, - /// StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or - /// PremiumV2_LRS. + /// Gets or sets additional authentication requirements when exporting or + /// uploading to a disk or snapshot. Possible values include: 'AzureActiveDirectory', 'None' /// - [JsonProperty(PropertyName = "sku")] - public DiskSku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dataAccessAuthMode")] + public string DataAccessAuthMode {get; set; } /// - /// Gets or sets the Logical zone list for Disk. + /// Gets or sets setting this property to true improves reliability and + /// performance of data disks that are frequently (more than 5 times a day) by + /// detached from one virtual machine and attached to another. This property + /// should not be set for disks that are not detached and attached frequently + /// as it causes the disks to not align with the fault domain of the virtual + /// machine. /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.optimizedForFrequentAttach")] + public bool? OptimizedForFrequentAttach {get; set; } /// - /// Gets or sets the extended location where the disk will be created. - /// Extended location cannot be changed. + /// Gets the UTC time when the ownership state of the disk was last changed + /// i.e., the time the disk was last attached or detached from a VM or the time + /// when the VM to which the disk was attached was deallocated or started. /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.LastOwnershipUpdateTime")] + public System.DateTime? LastOwnershipUpdateTime {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (CreationData == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "CreationData"); - } - if (PurchasePlan != null) + + + + + + if (this.PurchasePlan != null) { - PurchasePlan.Validate(); + this.PurchasePlan.Validate(); } - if (CreationData != null) + + if (this.CreationData != null) { - CreationData.Validate(); + this.CreationData.Validate(); } - if (EncryptionSettingsCollection != null) + + + + + + + if (this.EncryptionSettingsCollection != null) { - EncryptionSettingsCollection.Validate(); + this.EncryptionSettingsCollection.Validate(); } + + + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskAccess.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskAccess.cs index e87d9e148ca8..e773dc4fe450 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskAccess.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskAccess.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// disk access resource. /// - [Rest.Serialization.JsonTransformation] - public partial class DiskAccess : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class DiskAccess : TrackedResource { /// /// Initializes a new instance of the DiskAccess class. @@ -34,28 +24,43 @@ public DiskAccess() /// /// Initializes a new instance of the DiskAccess class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// A readonly collection of - /// private endpoint connections created on the disk. Currently only - /// one endpoint connection is supported. - /// The disk access resource - /// provisioning state. - /// The time when the disk access was - /// created. - /// The extended location where the disk - /// access will be created. Extended location cannot be - /// changed. - public DiskAccess(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IList privateEndpointConnections = default(IList), string provisioningState = default(string), System.DateTime? timeCreated = default(System.DateTime?), ExtendedLocation extendedLocation = default(ExtendedLocation)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// The extended location where the disk access will be created. Extended + /// location cannot be changed. + /// + + /// A readonly collection of private endpoint connections created on the disk. + /// Currently only one endpoint connection is supported. + /// + + /// The disk access resource provisioning state. + /// + + /// The time when the disk access was created. + /// + public DiskAccess(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), System.Collections.Generic.IList privateEndpointConnections = default(System.Collections.Generic.IList), string provisioningState = default(string), System.DateTime? timeCreated = default(System.DateTime?)) + + : base(location, id, name, type, tags) { - PrivateEndpointConnections = privateEndpointConnections; - ProvisioningState = provisioningState; - TimeCreated = timeCreated; - ExtendedLocation = extendedLocation; + this.ExtendedLocation = extendedLocation; + this.PrivateEndpointConnections = privateEndpointConnections; + this.ProvisioningState = provisioningState; + this.TimeCreated = timeCreated; CustomInit(); } @@ -64,51 +69,44 @@ public DiskAccess() /// partial void CustomInit(); + /// - /// Gets a readonly collection of private endpoint connections created - /// on the disk. Currently only one endpoint connection is supported. + /// Gets or sets the extended location where the disk access will be created. + /// Extended location cannot be changed. /// - [JsonProperty(PropertyName = "properties.privateEndpointConnections")] - public IList PrivateEndpointConnections { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation {get; set; } /// - /// Gets the disk access resource provisioning state. + /// Gets a readonly collection of private endpoint connections created on the + /// disk. Currently only one endpoint connection is supported. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateEndpointConnections")] + public System.Collections.Generic.IList PrivateEndpointConnections {get; private set; } /// - /// Gets the time when the disk access was created. + /// Gets the disk access resource provisioning state. /// - [JsonProperty(PropertyName = "properties.timeCreated")] - public System.DateTime? TimeCreated { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the extended location where the disk access will be - /// created. Extended location cannot be changed. + /// Gets the time when the disk access was created. /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeCreated")] + public System.DateTime? TimeCreated {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (PrivateEndpointConnections != null) - { - foreach (var element in PrivateEndpointConnections) - { - if (element != null) - { - element.Validate(); - } - } - } + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskAccessProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskAccessProperties.cs new file mode 100644 index 000000000000..3cf28abaa1e1 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskAccessProperties.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + public partial class DiskAccessProperties + { + /// + /// Initializes a new instance of the DiskAccessProperties class. + /// + public DiskAccessProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiskAccessProperties class. + /// + + /// A readonly collection of private endpoint connections created on the disk. + /// Currently only one endpoint connection is supported. + /// + + /// The disk access resource provisioning state. + /// + + /// The time when the disk access was created. + /// + public DiskAccessProperties(System.Collections.Generic.IList privateEndpointConnections = default(System.Collections.Generic.IList), string provisioningState = default(string), System.DateTime? timeCreated = default(System.DateTime?)) + + { + this.PrivateEndpointConnections = privateEndpointConnections; + this.ProvisioningState = provisioningState; + this.TimeCreated = timeCreated; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets a readonly collection of private endpoint connections created on the + /// disk. Currently only one endpoint connection is supported. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateEndpointConnections")] + public System.Collections.Generic.IList PrivateEndpointConnections {get; private set; } + + /// + /// Gets the disk access resource provisioning state. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the time when the disk access was created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeCreated")] + public System.DateTime? TimeCreated {get; private set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskAccessUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskAccessUpdate.cs index eb626405e5bb..8d6ad6a85ba5 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskAccessUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskAccessUpdate.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public DiskAccessUpdate() /// /// Initializes a new instance of the DiskAccessUpdate class. /// - /// Resource tags - public DiskAccessUpdate(IDictionary tags = default(IDictionary)) + + /// Resource tags + /// + public DiskAccessUpdate(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { - Tags = tags; + this.Tags = tags; CustomInit(); } @@ -43,11 +38,11 @@ public DiskAccessUpdate() /// partial void CustomInit(); + /// /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskControllerTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskControllerTypes.cs index 7f1ec2e2cfd5..0696c30a6e22 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskControllerTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskControllerTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for DiskControllerTypes. /// + + public static class DiskControllerTypes { - public const string SCSI = "SCSI"; + public const string Scsi = "SCSI"; public const string NVMe = "NVMe"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskCreateOption.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskCreateOption.cs index 346eb1519c01..01709517875d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskCreateOption.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskCreateOption.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for DiskCreateOption. /// + + public static class DiskCreateOption { /// @@ -30,13 +27,13 @@ public static class DiskCreateOption /// public const string FromImage = "FromImage"; /// - /// Create a disk by importing from a blob specified by a sourceUri in - /// a storage account specified by storageAccountId. + /// Create a disk by importing from a blob specified by a sourceUri in a + /// storage account specified by storageAccountId. /// public const string Import = "Import"; /// - /// Create a new disk or snapshot by copying from a disk or snapshot - /// specified by the given sourceResourceId. + /// Create a new disk or snapshot by copying from a disk or snapshot specified + /// by the given sourceResourceId. /// public const string Copy = "Copy"; /// @@ -44,32 +41,30 @@ public static class DiskCreateOption /// public const string Restore = "Restore"; /// - /// Create a new disk by obtaining a write token and using it to - /// directly upload the contents of the disk. + /// Create a new disk by obtaining a write token and using it to directly + /// upload the contents of the disk. /// public const string Upload = "Upload"; /// - /// Create a new disk by using a deep copy process, where the resource - /// creation is considered complete only after all data has been copied - /// from the source. + /// Create a new disk by using a deep copy process, where the resource creation + /// is considered complete only after all data has been copied from the source. /// public const string CopyStart = "CopyStart"; /// /// Similar to Import create option. Create a new Trusted Launch VM or - /// Confidential VM supported disk by importing additional blobs for VM - /// guest state specified by securityDataUri and VM metadata specified - /// by securityMetadataUri in storage account specified by - /// storageAccountId. The VM metadata is optional and only required for - /// certain Confidential VM configurations and not required for Trusted - /// Launch VM. + /// Confidential VM supported disk by importing additional blobs for VM guest + /// state specified by securityDataUri and VM metadata specified by + /// securityMetadataUri in storage account specified by storageAccountId. The + /// VM metadata is optional and only required for certain Confidential VM + /// configurations and not required for Trusted Launch VM. /// public const string ImportSecure = "ImportSecure"; /// /// Similar to Upload create option. Create a new Trusted Launch VM or - /// Confidential VM supported disk and upload using write token in - /// disk, VM guest state and VM metadata. The VM metadata is optional - /// and only required for certain Confidential VM configurations and - /// not required for Trusted Launch VM. + /// Confidential VM supported disk and upload using write token in disk, VM + /// guest state and VM metadata. The VM metadata is optional and only required + /// for certain Confidential VM configurations and not required for Trusted + /// Launch VM. /// public const string UploadPreparedSecure = "UploadPreparedSecure"; /// @@ -77,4 +72,4 @@ public static class DiskCreateOption /// public const string CopyFromSanSnapshot = "CopyFromSanSnapshot"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskCreateOptionTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskCreateOptionTypes.cs index 9743cdca8e94..41f63347ca58 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskCreateOptionTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskCreateOptionTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for DiskCreateOptionTypes. /// + + public static class DiskCreateOptionTypes { public const string FromImage = "FromImage"; @@ -22,4 +19,4 @@ public static class DiskCreateOptionTypes public const string Copy = "Copy"; public const string Restore = "Restore"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskDeleteOptionTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskDeleteOptionTypes.cs index 084e59e2d667..c9e96fbb2434 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskDeleteOptionTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskDeleteOptionTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for DiskDeleteOptionTypes. /// + + public static class DiskDeleteOptionTypes { public const string Delete = "Delete"; public const string Detach = "Detach"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskDetachOptionTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskDetachOptionTypes.cs index 9244426d7ec0..40b37d6a0ef7 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskDetachOptionTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskDetachOptionTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for DiskDetachOptionTypes. /// + + public static class DiskDetachOptionTypes { public const string ForceDetach = "ForceDetach"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSet.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSet.cs index 6a0d72bb2f6c..c518fce695d8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSet.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSet.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// disk encryption set resource. /// - [Rest.Serialization.JsonTransformation] - public partial class DiskEncryptionSet : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class DiskEncryptionSet : TrackedResource { /// /// Initializes a new instance of the DiskEncryptionSet class. @@ -34,51 +24,70 @@ public DiskEncryptionSet() /// /// Initializes a new instance of the DiskEncryptionSet class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The type of key used to encrypt the - /// data of the disk. Possible values include: - /// 'EncryptionAtRestWithCustomerKey', - /// 'EncryptionAtRestWithPlatformAndCustomerKeys', - /// 'ConfidentialVmEncryptedWithCustomerKey' - /// The key vault key which is currently used - /// by this disk encryption set. - /// A readonly collection of key vault keys - /// previously used by this disk encryption set while a key rotation is - /// in progress. It will be empty if there is no ongoing key - /// rotation. - /// The disk encryption set - /// provisioning state. - /// Set this flag to - /// true to enable auto-updating of this disk encryption set to the - /// latest key version. - /// The time when the active key - /// of this disk encryption set was updated. - /// The error that was encountered - /// during auto-key rotation. If an error is present, then auto-key - /// rotation will not be attempted until the error on this disk - /// encryption set is fixed. - /// Multi-tenant application client id - /// to access key vault in a different tenant. Setting the value to - /// 'None' will clear the property. - /// The managed identity for the disk encryption - /// set. It should be given permission on the key vault before it can - /// be used to encrypt disks. - public DiskEncryptionSet(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string encryptionType = default(string), KeyForDiskEncryptionSet activeKey = default(KeyForDiskEncryptionSet), IList previousKeys = default(IList), string provisioningState = default(string), bool? rotationToLatestKeyVersionEnabled = default(bool?), System.DateTime? lastKeyRotationTimestamp = default(System.DateTime?), ApiError autoKeyRotationError = default(ApiError), string federatedClientId = default(string), EncryptionSetIdentity identity = default(EncryptionSetIdentity)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// The managed identity for the disk encryption set. It should be given + /// permission on the key vault before it can be used to encrypt disks. + /// + + /// The type of key used to encrypt the data of the disk. + /// Possible values include: 'EncryptionAtRestWithCustomerKey', + /// 'EncryptionAtRestWithPlatformAndCustomerKeys', + /// 'ConfidentialVmEncryptedWithCustomerKey' + + /// The key vault key which is currently used by this disk encryption set. + /// + + /// A readonly collection of key vault keys previously used by this disk + /// encryption set while a key rotation is in progress. It will be empty if + /// there is no ongoing key rotation. + /// + + /// The disk encryption set provisioning state. + /// + + /// Set this flag to true to enable auto-updating of this disk encryption set + /// to the latest key version. + /// + + /// The time when the active key of this disk encryption set was updated. + /// + + /// The error that was encountered during auto-key rotation. If an error is + /// present, then auto-key rotation will not be attempted until the error on + /// this disk encryption set is fixed. + /// + + /// Multi-tenant application client id to access key vault in a different + /// tenant. Setting the value to 'None' will clear the property. + /// + public DiskEncryptionSet(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), EncryptionSetIdentity identity = default(EncryptionSetIdentity), string encryptionType = default(string), KeyForDiskEncryptionSet activeKey = default(KeyForDiskEncryptionSet), System.Collections.Generic.IList previousKeys = default(System.Collections.Generic.IList), string provisioningState = default(string), bool? rotationToLatestKeyVersionEnabled = default(bool?), System.DateTime? lastKeyRotationTimestamp = default(System.DateTime?), ApiError autoKeyRotationError = default(ApiError), string federatedClientId = default(string)) + + : base(location, id, name, type, tags) { - EncryptionType = encryptionType; - ActiveKey = activeKey; - PreviousKeys = previousKeys; - ProvisioningState = provisioningState; - RotationToLatestKeyVersionEnabled = rotationToLatestKeyVersionEnabled; - LastKeyRotationTimestamp = lastKeyRotationTimestamp; - AutoKeyRotationError = autoKeyRotationError; - FederatedClientId = federatedClientId; - Identity = identity; + this.Identity = identity; + this.EncryptionType = encryptionType; + this.ActiveKey = activeKey; + this.PreviousKeys = previousKeys; + this.ProvisioningState = provisioningState; + this.RotationToLatestKeyVersionEnabled = rotationToLatestKeyVersionEnabled; + this.LastKeyRotationTimestamp = lastKeyRotationTimestamp; + this.AutoKeyRotationError = autoKeyRotationError; + this.FederatedClientId = federatedClientId; CustomInit(); } @@ -87,90 +96,86 @@ public DiskEncryptionSet() /// partial void CustomInit(); + /// - /// Gets or sets the type of key used to encrypt the data of the disk. - /// Possible values include: 'EncryptionAtRestWithCustomerKey', - /// 'EncryptionAtRestWithPlatformAndCustomerKeys', - /// 'ConfidentialVmEncryptedWithCustomerKey' + /// Gets or sets the managed identity for the disk encryption set. It should be + /// given permission on the key vault before it can be used to encrypt disks. /// - [JsonProperty(PropertyName = "properties.encryptionType")] - public string EncryptionType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public EncryptionSetIdentity Identity {get; set; } /// - /// Gets or sets the key vault key which is currently used by this disk - /// encryption set. + /// Gets or sets the type of key used to encrypt the data of the disk. Possible values include: 'EncryptionAtRestWithCustomerKey', 'EncryptionAtRestWithPlatformAndCustomerKeys', 'ConfidentialVmEncryptedWithCustomerKey' /// - [JsonProperty(PropertyName = "properties.activeKey")] - public KeyForDiskEncryptionSet ActiveKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryptionType")] + public string EncryptionType {get; set; } /// - /// Gets a readonly collection of key vault keys previously used by - /// this disk encryption set while a key rotation is in progress. It - /// will be empty if there is no ongoing key rotation. + /// Gets or sets the key vault key which is currently used by this disk + /// encryption set. /// - [JsonProperty(PropertyName = "properties.previousKeys")] - public IList PreviousKeys { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.activeKey")] + public KeyForDiskEncryptionSet ActiveKey {get; set; } /// - /// Gets the disk encryption set provisioning state. + /// Gets a readonly collection of key vault keys previously used by this disk + /// encryption set while a key rotation is in progress. It will be empty if + /// there is no ongoing key rotation. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.previousKeys")] + public System.Collections.Generic.IList PreviousKeys {get; private set; } /// - /// Gets or sets set this flag to true to enable auto-updating of this - /// disk encryption set to the latest key version. + /// Gets the disk encryption set provisioning state. /// - [JsonProperty(PropertyName = "properties.rotationToLatestKeyVersionEnabled")] - public bool? RotationToLatestKeyVersionEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets the time when the active key of this disk encryption set was - /// updated. + /// Gets or sets set this flag to true to enable auto-updating of this disk + /// encryption set to the latest key version. /// - [JsonProperty(PropertyName = "properties.lastKeyRotationTimestamp")] - public System.DateTime? LastKeyRotationTimestamp { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.rotationToLatestKeyVersionEnabled")] + public bool? RotationToLatestKeyVersionEnabled {get; set; } /// - /// Gets the error that was encountered during auto-key rotation. If an - /// error is present, then auto-key rotation will not be attempted - /// until the error on this disk encryption set is fixed. + /// Gets the time when the active key of this disk encryption set was updated. /// - [JsonProperty(PropertyName = "properties.autoKeyRotationError")] - public ApiError AutoKeyRotationError { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.lastKeyRotationTimestamp")] + public System.DateTime? LastKeyRotationTimestamp {get; private set; } /// - /// Gets or sets multi-tenant application client id to access key vault - /// in a different tenant. Setting the value to 'None' will clear the - /// property. + /// Gets the error that was encountered during auto-key rotation. If an error + /// is present, then auto-key rotation will not be attempted until the error on + /// this disk encryption set is fixed. /// - [JsonProperty(PropertyName = "properties.federatedClientId")] - public string FederatedClientId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoKeyRotationError")] + public ApiError AutoKeyRotationError {get; private set; } /// - /// Gets or sets the managed identity for the disk encryption set. It - /// should be given permission on the key vault before it can be used - /// to encrypt disks. + /// Gets or sets multi-tenant application client id to access key vault in a + /// different tenant. Setting the value to 'None' will clear the property. /// - [JsonProperty(PropertyName = "identity")] - public EncryptionSetIdentity Identity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.federatedClientId")] + public string FederatedClientId {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (ActiveKey != null) + + + if (this.ActiveKey != null) { - ActiveKey.Validate(); + this.ActiveKey.Validate(); } - if (PreviousKeys != null) + if (this.PreviousKeys != null) { - foreach (var element in PreviousKeys) + foreach (var element in this.PreviousKeys) { if (element != null) { @@ -178,6 +183,9 @@ public override void Validate() } } } + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetIdentityType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetIdentityType.cs index dae3e3996f18..41801b6c0a18 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetIdentityType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetIdentityType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for DiskEncryptionSetIdentityType. /// + + public static class DiskEncryptionSetIdentityType { public const string SystemAssigned = "SystemAssigned"; @@ -21,4 +18,4 @@ public static class DiskEncryptionSetIdentityType public const string SystemAssignedUserAssigned = "SystemAssigned, UserAssigned"; public const string None = "None"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetParameters.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetParameters.cs index 11ab87456efa..ccda37640dd4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetParameters.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetParameters.cs @@ -1,28 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { using System.Linq; /// - /// Describes the parameter of customer managed disk encryption set - /// resource id that can be specified for disk. **Note:** The disk - /// encryption set resource id can only be specified for managed disk. - /// Please refer https://aka.ms/mdssewithcmkoverview for more details. + /// Describes the parameter of customer managed disk encryption set resource id + /// that can be specified for disk. **Note:** The disk encryption set resource + /// id can only be specified for managed disk. Please refer + /// https://aka.ms/mdssewithcmkoverview for more details. /// public partial class DiskEncryptionSetParameters : SubResource { /// - /// Initializes a new instance of the DiskEncryptionSetParameters - /// class. + /// Initializes a new instance of the DiskEncryptionSetParameters class. /// public DiskEncryptionSetParameters() { @@ -30,12 +24,14 @@ public DiskEncryptionSetParameters() } /// - /// Initializes a new instance of the DiskEncryptionSetParameters - /// class. + /// Initializes a new instance of the DiskEncryptionSetParameters class. /// - /// Resource Id + + /// Resource Id + /// public DiskEncryptionSetParameters(string id = default(string)) - : base(id) + + : base(id) { CustomInit(); } @@ -46,4 +42,4 @@ public DiskEncryptionSetParameters() partial void CustomInit(); } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetType.cs index 8b65f1b98568..2a1a452b9a06 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,23 +9,25 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for DiskEncryptionSetType. /// + + public static class DiskEncryptionSetType { /// - /// Resource using diskEncryptionSet would be encrypted at rest with - /// Customer managed key that can be changed and revoked by a customer. + /// Resource using diskEncryptionSet would be encrypted at rest with Customer + /// managed key that can be changed and revoked by a customer. /// public const string EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey"; /// - /// Resource using diskEncryptionSet would be encrypted at rest with - /// two layers of encryption. One of the keys is Customer managed and - /// the other key is Platform managed. + /// Resource using diskEncryptionSet would be encrypted at rest with two layers + /// of encryption. One of the keys is Customer managed and the other key is + /// Platform managed. /// public const string EncryptionAtRestWithPlatformAndCustomerKeys = "EncryptionAtRestWithPlatformAndCustomerKeys"; /// - /// Confidential VM supported disk and VM guest state would be - /// encrypted with customer managed key. + /// Confidential VM supported disk and VM guest state would be encrypted with + /// customer managed key. /// public const string ConfidentialVmEncryptedWithCustomerKey = "ConfidentialVmEncryptedWithCustomerKey"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetUpdate.cs index 8ff8bce3a2de..cfc6afd67480 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetUpdate.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// disk encryption set update resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class DiskEncryptionSetUpdate { /// @@ -34,31 +24,39 @@ public DiskEncryptionSetUpdate() /// /// Initializes a new instance of the DiskEncryptionSetUpdate class. /// - /// The type of key used to encrypt the - /// data of the disk. Possible values include: - /// 'EncryptionAtRestWithCustomerKey', - /// 'EncryptionAtRestWithPlatformAndCustomerKeys', - /// 'ConfidentialVmEncryptedWithCustomerKey' - /// Key Vault Key Url to be used for server - /// side encryption of Managed Disks and Snapshots - /// Set this flag to - /// true to enable auto-updating of this disk encryption set to the - /// latest key version. - /// Multi-tenant application client id - /// to access key vault in a different tenant. Setting the value to - /// 'None' will clear the property. - /// Resource tags - /// The managed identity for the disk encryption - /// set. It should be given permission on the key vault before it can - /// be used to encrypt disks. - public DiskEncryptionSetUpdate(string encryptionType = default(string), KeyForDiskEncryptionSet activeKey = default(KeyForDiskEncryptionSet), bool? rotationToLatestKeyVersionEnabled = default(bool?), string federatedClientId = default(string), IDictionary tags = default(IDictionary), EncryptionSetIdentity identity = default(EncryptionSetIdentity)) + + /// Resource tags + /// + + /// The managed identity for the disk encryption set. It should be given + /// permission on the key vault before it can be used to encrypt disks. + /// + + /// The type of key used to encrypt the data of the disk. + /// Possible values include: 'EncryptionAtRestWithCustomerKey', + /// 'EncryptionAtRestWithPlatformAndCustomerKeys', + /// 'ConfidentialVmEncryptedWithCustomerKey' + + /// Key Vault Key Url to be used for server side encryption of Managed Disks + /// and Snapshots + /// + + /// Set this flag to true to enable auto-updating of this disk encryption set + /// to the latest key version. + /// + + /// Multi-tenant application client id to access key vault in a different + /// tenant. Setting the value to 'None' will clear the property. + /// + public DiskEncryptionSetUpdate(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), EncryptionSetIdentity identity = default(EncryptionSetIdentity), string encryptionType = default(string), KeyForDiskEncryptionSet activeKey = default(KeyForDiskEncryptionSet), bool? rotationToLatestKeyVersionEnabled = default(bool?), string federatedClientId = default(string)) + { - EncryptionType = encryptionType; - ActiveKey = activeKey; - RotationToLatestKeyVersionEnabled = rotationToLatestKeyVersionEnabled; - FederatedClientId = federatedClientId; - Tags = tags; - Identity = identity; + this.Tags = tags; + this.Identity = identity; + this.EncryptionType = encryptionType; + this.ActiveKey = activeKey; + this.RotationToLatestKeyVersionEnabled = rotationToLatestKeyVersionEnabled; + this.FederatedClientId = federatedClientId; CustomInit(); } @@ -67,63 +65,62 @@ public DiskEncryptionSetUpdate() /// partial void CustomInit(); + /// - /// Gets or sets the type of key used to encrypt the data of the disk. - /// Possible values include: 'EncryptionAtRestWithCustomerKey', - /// 'EncryptionAtRestWithPlatformAndCustomerKeys', - /// 'ConfidentialVmEncryptedWithCustomerKey' + /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "properties.encryptionType")] - public string EncryptionType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets or sets key Vault Key Url to be used for server side - /// encryption of Managed Disks and Snapshots + /// Gets or sets the managed identity for the disk encryption set. It should be + /// given permission on the key vault before it can be used to encrypt disks. /// - [JsonProperty(PropertyName = "properties.activeKey")] - public KeyForDiskEncryptionSet ActiveKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public EncryptionSetIdentity Identity {get; set; } /// - /// Gets or sets set this flag to true to enable auto-updating of this - /// disk encryption set to the latest key version. + /// Gets or sets the type of key used to encrypt the data of the disk. Possible values include: 'EncryptionAtRestWithCustomerKey', 'EncryptionAtRestWithPlatformAndCustomerKeys', 'ConfidentialVmEncryptedWithCustomerKey' /// - [JsonProperty(PropertyName = "properties.rotationToLatestKeyVersionEnabled")] - public bool? RotationToLatestKeyVersionEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryptionType")] + public string EncryptionType {get; set; } /// - /// Gets or sets multi-tenant application client id to access key vault - /// in a different tenant. Setting the value to 'None' will clear the - /// property. + /// Gets or sets key Vault Key Url to be used for server side encryption of + /// Managed Disks and Snapshots /// - [JsonProperty(PropertyName = "properties.federatedClientId")] - public string FederatedClientId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.activeKey")] + public KeyForDiskEncryptionSet ActiveKey {get; set; } /// - /// Gets or sets resource tags + /// Gets or sets set this flag to true to enable auto-updating of this disk + /// encryption set to the latest key version. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.rotationToLatestKeyVersionEnabled")] + public bool? RotationToLatestKeyVersionEnabled {get; set; } /// - /// Gets or sets the managed identity for the disk encryption set. It - /// should be given permission on the key vault before it can be used - /// to encrypt disks. + /// Gets or sets multi-tenant application client id to access key vault in a + /// different tenant. Setting the value to 'None' will clear the property. /// - [JsonProperty(PropertyName = "identity")] - public EncryptionSetIdentity Identity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.federatedClientId")] + public string FederatedClientId {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ActiveKey != null) + + + + if (this.ActiveKey != null) { - ActiveKey.Validate(); + this.ActiveKey.Validate(); } + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetUpdateProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetUpdateProperties.cs new file mode 100644 index 000000000000..0ed9dd0956f2 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSetUpdateProperties.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// disk encryption set resource update properties. + /// + public partial class DiskEncryptionSetUpdateProperties + { + /// + /// Initializes a new instance of the DiskEncryptionSetUpdateProperties class. + /// + public DiskEncryptionSetUpdateProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiskEncryptionSetUpdateProperties class. + /// + + /// The type of key used to encrypt the data of the disk. + /// Possible values include: 'EncryptionAtRestWithCustomerKey', + /// 'EncryptionAtRestWithPlatformAndCustomerKeys', + /// 'ConfidentialVmEncryptedWithCustomerKey' + + /// Key Vault Key Url to be used for server side encryption of Managed Disks + /// and Snapshots + /// + + /// Set this flag to true to enable auto-updating of this disk encryption set + /// to the latest key version. + /// + + /// Multi-tenant application client id to access key vault in a different + /// tenant. Setting the value to 'None' will clear the property. + /// + public DiskEncryptionSetUpdateProperties(string encryptionType = default(string), KeyForDiskEncryptionSet activeKey = default(KeyForDiskEncryptionSet), bool? rotationToLatestKeyVersionEnabled = default(bool?), string federatedClientId = default(string)) + + { + this.EncryptionType = encryptionType; + this.ActiveKey = activeKey; + this.RotationToLatestKeyVersionEnabled = rotationToLatestKeyVersionEnabled; + this.FederatedClientId = federatedClientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the type of key used to encrypt the data of the disk. Possible values include: 'EncryptionAtRestWithCustomerKey', 'EncryptionAtRestWithPlatformAndCustomerKeys', 'ConfidentialVmEncryptedWithCustomerKey' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptionType")] + public string EncryptionType {get; set; } + + /// + /// Gets or sets key Vault Key Url to be used for server side encryption of + /// Managed Disks and Snapshots + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "activeKey")] + public KeyForDiskEncryptionSet ActiveKey {get; set; } + + /// + /// Gets or sets set this flag to true to enable auto-updating of this disk + /// encryption set to the latest key version. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "rotationToLatestKeyVersionEnabled")] + public bool? RotationToLatestKeyVersionEnabled {get; set; } + + /// + /// Gets or sets multi-tenant application client id to access key vault in a + /// different tenant. Setting the value to 'None' will clear the property. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "federatedClientId")] + public string FederatedClientId {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + if (this.ActiveKey != null) + { + this.ActiveKey.Validate(); + } + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSettings.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSettings.cs index b12e55e04b9e..fd3014025264 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSettings.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskEncryptionSettings.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,22 @@ public DiskEncryptionSettings() /// /// Initializes a new instance of the DiskEncryptionSettings class. /// - /// Specifies the location of the disk - /// encryption key, which is a Key Vault Secret. - /// Specifies the location of the key - /// encryption key in Key Vault. - /// Specifies whether disk encryption should be - /// enabled on the virtual machine. + + /// Specifies the location of the disk encryption key, which is a Key Vault + /// Secret. + /// + + /// Specifies the location of the key encryption key in Key Vault. + /// + + /// Specifies whether disk encryption should be enabled on the virtual machine. + /// public DiskEncryptionSettings(KeyVaultSecretReference diskEncryptionKey = default(KeyVaultSecretReference), KeyVaultKeyReference keyEncryptionKey = default(KeyVaultKeyReference), bool? enabled = default(bool?)) + { - DiskEncryptionKey = diskEncryptionKey; - KeyEncryptionKey = keyEncryptionKey; - Enabled = enabled; + this.DiskEncryptionKey = diskEncryptionKey; + this.KeyEncryptionKey = keyEncryptionKey; + this.Enabled = enabled; CustomInit(); } @@ -48,43 +47,42 @@ public DiskEncryptionSettings() /// partial void CustomInit(); + /// - /// Gets or sets specifies the location of the disk encryption key, - /// which is a Key Vault Secret. + /// Gets or sets specifies the location of the disk encryption key, which is a + /// Key Vault Secret. /// - [JsonProperty(PropertyName = "diskEncryptionKey")] - public KeyVaultSecretReference DiskEncryptionKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskEncryptionKey")] + public KeyVaultSecretReference DiskEncryptionKey {get; set; } /// - /// Gets or sets specifies the location of the key encryption key in - /// Key Vault. + /// Gets or sets specifies the location of the key encryption key in Key Vault. /// - [JsonProperty(PropertyName = "keyEncryptionKey")] - public KeyVaultKeyReference KeyEncryptionKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "keyEncryptionKey")] + public KeyVaultKeyReference KeyEncryptionKey {get; set; } /// - /// Gets or sets specifies whether disk encryption should be enabled on - /// the virtual machine. + /// Gets or sets specifies whether disk encryption should be enabled on the + /// virtual machine. /// - [JsonProperty(PropertyName = "enabled")] - public bool? Enabled { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (DiskEncryptionKey != null) + if (this.DiskEncryptionKey != null) { - DiskEncryptionKey.Validate(); + this.DiskEncryptionKey.Validate(); } - if (KeyEncryptionKey != null) + if (this.KeyEncryptionKey != null) { - KeyEncryptionKey.Validate(); + this.KeyEncryptionKey.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskImageEncryption.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskImageEncryption.cs index ce3330d1cfc7..417e011539ed 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskImageEncryption.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskImageEncryption.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public DiskImageEncryption() /// /// Initializes a new instance of the DiskImageEncryption class. /// - /// A relative URI containing the - /// resource ID of the disk encryption set. + + /// A relative URI containing the resource ID of the disk encryption set. + /// public DiskImageEncryption(string diskEncryptionSetId = default(string)) + { - DiskEncryptionSetId = diskEncryptionSetId; + this.DiskEncryptionSetId = diskEncryptionSetId; CustomInit(); } @@ -42,12 +38,12 @@ public DiskImageEncryption() /// partial void CustomInit(); + /// /// Gets or sets a relative URI containing the resource ID of the disk /// encryption set. /// - [JsonProperty(PropertyName = "diskEncryptionSetId")] - public string DiskEncryptionSetId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "diskEncryptionSetId")] + public string DiskEncryptionSetId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskInstanceView.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskInstanceView.cs index a1a45d7a1d23..c2beacf87bbc 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskInstanceView.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskInstanceView.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,16 +23,22 @@ public DiskInstanceView() /// /// Initializes a new instance of the DiskInstanceView class. /// - /// The disk name. - /// Specifies the encryption settings - /// for the OS Disk. <br><br> Minimum api-version: - /// 2015-06-15 - /// The resource status information. - public DiskInstanceView(string name = default(string), IList encryptionSettings = default(IList), IList statuses = default(IList)) + + /// The disk name. + /// + + /// Specifies the encryption settings for the OS Disk. <br><br> Minimum + /// api-version: 2015-06-15 + /// + + /// The resource status information. + /// + public DiskInstanceView(string name = default(string), System.Collections.Generic.IList encryptionSettings = default(System.Collections.Generic.IList), System.Collections.Generic.IList statuses = default(System.Collections.Generic.IList)) + { - Name = name; - EncryptionSettings = encryptionSettings; - Statuses = statuses; + this.Name = name; + this.EncryptionSettings = encryptionSettings; + this.Statuses = statuses; CustomInit(); } @@ -49,25 +47,24 @@ public DiskInstanceView() /// partial void CustomInit(); + /// /// Gets or sets the disk name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets specifies the encryption settings for the OS Disk. - /// &lt;br&gt;&lt;br&gt; Minimum api-version: - /// 2015-06-15 + /// Gets or sets specifies the encryption settings for the OS Disk. <br><br> + /// Minimum api-version: 2015-06-15 /// - [JsonProperty(PropertyName = "encryptionSettings")] - public IList EncryptionSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptionSettings")] + public System.Collections.Generic.IList EncryptionSettings {get; set; } /// /// Gets or sets the resource status information. /// - [JsonProperty(PropertyName = "statuses")] - public IList Statuses { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "statuses")] + public System.Collections.Generic.IList Statuses {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskProperties.cs new file mode 100644 index 000000000000..9919d3b9d970 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskProperties.cs @@ -0,0 +1,479 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Disk resource properties. + /// + public partial class DiskProperties + { + /// + /// Initializes a new instance of the DiskProperties class. + /// + public DiskProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiskProperties class. + /// + + /// The time when the disk was created. + /// + + /// The Operating System type. + /// Possible values include: 'Windows', 'Linux' + + /// The hypervisor generation of the Virtual Machine. Applicable to OS disks + /// only. + /// Possible values include: 'V1', 'V2' + + /// Purchase plan information for the the image from which the OS disk was + /// created. E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, + /// product: WindowsServer} + /// + + /// List of supported capabilities for the image from which the OS disk was + /// created. + /// + + /// Disk source information. CreationData information cannot be changed after + /// the disk has been created. + /// + + /// If creationData.createOption is Empty, this field is mandatory and it + /// indicates the size of the disk to create. If this field is present for + /// updates or creation with other options, it indicates a resize. Resizes are + /// only allowed if the disk is not attached to a running VM, and can only + /// increase the disk's size. + /// + + /// The size of the disk in bytes. This field is read only. + /// + + /// Unique Guid identifying the resource. + /// + + /// Encryption settings collection used for Azure Disk Encryption, can contain + /// multiple encryption settings per disk or snapshot. + /// + + /// The disk provisioning state. + /// + + /// The number of IOPS allowed for this disk; only settable for UltraSSD disks. + /// One operation can transfer between 4k and 256k bytes. + /// + + /// The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps + /// means millions of bytes per second - MB here uses the ISO notation, of + /// powers of 10. + /// + + /// The total number of IOPS that will be allowed across all VMs mounting the + /// shared disk as ReadOnly. One operation can transfer between 4k and 256k + /// bytes. + /// + + /// The total throughput (MBps) that will be allowed across all VMs mounting + /// the shared disk as ReadOnly. MBps means millions of bytes per second - MB + /// here uses the ISO notation, of powers of 10. + /// + + /// The state of the disk. + /// Possible values include: 'Unattached', 'Attached', 'Reserved', 'Frozen', + /// 'ActiveSAS', 'ActiveSASFrozen', 'ReadyToUpload', 'ActiveUpload' + + /// Encryption property can be used to encrypt data at rest with customer + /// managed keys or platform managed keys. + /// + + /// The maximum number of VMs that can attach to the disk at the same time. + /// Value greater than one indicates a disk that can be mounted on multiple VMs + /// at the same time. + /// + + /// Details of the list of all VMs that have the disk attached. maxShares + /// should be set to a value greater than one for disks to allow attaching them + /// to multiple VMs. + /// + + /// Policy for accessing the disk via network. + /// Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + + /// ARM id of the DiskAccess resource for using private endpoints on disks. + /// + + /// Latest time when bursting was last enabled on a disk. + /// + + /// Performance tier of the disk (e.g, P4, S10) as described here: + /// https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not + /// apply to Ultra disks. + /// + + /// Set to true to enable bursting beyond the provisioned performance target of + /// the disk. Bursting is disabled by default. Does not apply to Ultra disks. + /// + + /// Properties of the disk for which update is pending. + /// + + /// Indicates the OS on a disk supports hibernation. + /// + + /// Contains the security related information for the resource. + /// + + /// Percentage complete for the background copy when a resource is created via + /// the CopyStart operation. + /// + + /// Policy for controlling export on the disk. + /// Possible values include: 'Enabled', 'Disabled' + + /// Additional authentication requirements when exporting or uploading to a + /// disk or snapshot. + /// Possible values include: 'AzureActiveDirectory', 'None' + + /// Setting this property to true improves reliability and performance of data + /// disks that are frequently (more than 5 times a day) by detached from one + /// virtual machine and attached to another. This property should not be set + /// for disks that are not detached and attached frequently as it causes the + /// disks to not align with the fault domain of the virtual machine. + /// + + /// The UTC time when the ownership state of the disk was last changed i.e., + /// the time the disk was last attached or detached from a VM or the time when + /// the VM to which the disk was attached was deallocated or started. + /// + + /// Determines how platform treats disk failures + /// + public DiskProperties(CreationData creationData, System.DateTime? timeCreated = default(System.DateTime?), OperatingSystemTypes? osType = default(OperatingSystemTypes?), string hyperVGeneration = default(string), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), int? diskSizeGb = default(int?), long? diskSizeBytes = default(long?), string uniqueId = default(string), EncryptionSettingsCollection encryptionSettingsCollection = default(EncryptionSettingsCollection), string provisioningState = default(string), long? diskIopsReadWrite = default(long?), long? diskMBpsReadWrite = default(long?), long? diskIopsReadOnly = default(long?), long? diskMBpsReadOnly = default(long?), string diskState = default(string), Encryption encryption = default(Encryption), int? maxShares = default(int?), System.Collections.Generic.IList shareInfo = default(System.Collections.Generic.IList), string networkAccessPolicy = default(string), string diskAccessId = default(string), System.DateTime? burstingEnabledTime = default(System.DateTime?), string tier = default(string), bool? burstingEnabled = default(bool?), PropertyUpdatesInProgress propertyUpdatesInProgress = default(PropertyUpdatesInProgress), bool? supportsHibernation = default(bool?), DiskSecurityProfile securityProfile = default(DiskSecurityProfile), double? completionPercent = default(double?), string publicNetworkAccess = default(string), string dataAccessAuthMode = default(string), bool? optimizedForFrequentAttach = default(bool?), System.DateTime? lastOwnershipUpdateTime = default(System.DateTime?), AvailabilityPolicy availabilityPolicy = default(AvailabilityPolicy)) + + { + this.TimeCreated = timeCreated; + this.OsType = osType; + this.HyperVGeneration = hyperVGeneration; + this.PurchasePlan = purchasePlan; + this.SupportedCapabilities = supportedCapabilities; + this.CreationData = creationData; + this.DiskSizeGB = diskSizeGb; + this.DiskSizeBytes = diskSizeBytes; + this.UniqueId = uniqueId; + this.EncryptionSettingsCollection = encryptionSettingsCollection; + this.ProvisioningState = provisioningState; + this.DiskIOPSReadWrite = diskIopsReadWrite; + this.DiskMBpsReadWrite = diskMBpsReadWrite; + this.DiskIopsReadOnly = diskIopsReadOnly; + this.DiskMBpsReadOnly = diskMBpsReadOnly; + this.DiskState = diskState; + this.Encryption = encryption; + this.MaxShares = maxShares; + this.ShareInfo = shareInfo; + this.NetworkAccessPolicy = networkAccessPolicy; + this.DiskAccessId = diskAccessId; + this.BurstingEnabledTime = burstingEnabledTime; + this.Tier = tier; + this.BurstingEnabled = burstingEnabled; + this.PropertyUpdatesInProgress = propertyUpdatesInProgress; + this.SupportsHibernation = supportsHibernation; + this.SecurityProfile = securityProfile; + this.CompletionPercent = completionPercent; + this.PublicNetworkAccess = publicNetworkAccess; + this.DataAccessAuthMode = dataAccessAuthMode; + this.OptimizedForFrequentAttach = optimizedForFrequentAttach; + this.LastOwnershipUpdateTime = lastOwnershipUpdateTime; + this.AvailabilityPolicy = availabilityPolicy; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the time when the disk was created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeCreated")] + public System.DateTime? TimeCreated {get; private set; } + + /// + /// Gets or sets the Operating System type. Possible values include: 'Windows', 'Linux' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public OperatingSystemTypes? OsType {get; set; } + + /// + /// Gets or sets the hypervisor generation of the Virtual Machine. Applicable + /// to OS disks only. Possible values include: 'V1', 'V2' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hyperVGeneration")] + public string HyperVGeneration {get; set; } + + /// + /// Gets or sets purchase plan information for the the image from which the OS + /// disk was created. E.g. - {name: 2019-Datacenter, publisher: + /// MicrosoftWindowsServer, product: WindowsServer} + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "purchasePlan")] + public PurchasePlan PurchasePlan {get; set; } + + /// + /// Gets or sets list of supported capabilities for the image from which the OS + /// disk was created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "supportedCapabilities")] + public SupportedCapabilities SupportedCapabilities {get; set; } + + /// + /// Gets or sets disk source information. CreationData information cannot be + /// changed after the disk has been created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "creationData")] + public CreationData CreationData {get; set; } + + /// + /// Gets or sets if creationData.createOption is Empty, this field is mandatory + /// and it indicates the size of the disk to create. If this field is present + /// for updates or creation with other options, it indicates a resize. Resizes + /// are only allowed if the disk is not attached to a running VM, and can only + /// increase the disk's size. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeGB")] + public int? DiskSizeGB {get; set; } + + /// + /// Gets the size of the disk in bytes. This field is read only. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeBytes")] + public long? DiskSizeBytes {get; private set; } + + /// + /// Gets unique Guid identifying the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueId")] + public string UniqueId {get; private set; } + + /// + /// Gets or sets encryption settings collection used for Azure Disk Encryption, + /// can contain multiple encryption settings per disk or snapshot. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptionSettingsCollection")] + public EncryptionSettingsCollection EncryptionSettingsCollection {get; set; } + + /// + /// Gets the disk provisioning state. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the number of IOPS allowed for this disk; only settable for + /// UltraSSD disks. One operation can transfer between 4k and 256k bytes. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskIOPSReadWrite")] + public long? DiskIOPSReadWrite {get; set; } + + /// + /// Gets or sets the bandwidth allowed for this disk; only settable for + /// UltraSSD disks. MBps means millions of bytes per second - MB here uses the + /// ISO notation, of powers of 10. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskMBpsReadWrite")] + public long? DiskMBpsReadWrite {get; set; } + + /// + /// Gets or sets the total number of IOPS that will be allowed across all VMs + /// mounting the shared disk as ReadOnly. One operation can transfer between 4k + /// and 256k bytes. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskIOPSReadOnly")] + public long? DiskIopsReadOnly {get; set; } + + /// + /// Gets or sets the total throughput (MBps) that will be allowed across all + /// VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per + /// second - MB here uses the ISO notation, of powers of 10. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskMBpsReadOnly")] + public long? DiskMBpsReadOnly {get; set; } + + /// + /// Gets the state of the disk. Possible values include: 'Unattached', 'Attached', 'Reserved', 'Frozen', 'ActiveSAS', 'ActiveSASFrozen', 'ReadyToUpload', 'ActiveUpload' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskState")] + public string DiskState {get; private set; } + + /// + /// Gets or sets encryption property can be used to encrypt data at rest with + /// customer managed keys or platform managed keys. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encryption")] + public Encryption Encryption {get; set; } + + /// + /// Gets or sets the maximum number of VMs that can attach to the disk at the + /// same time. Value greater than one indicates a disk that can be mounted on + /// multiple VMs at the same time. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "maxShares")] + public int? MaxShares {get; set; } + + /// + /// Gets details of the list of all VMs that have the disk attached. maxShares + /// should be set to a value greater than one for disks to allow attaching them + /// to multiple VMs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "shareInfo")] + public System.Collections.Generic.IList ShareInfo {get; private set; } + + /// + /// Gets or sets policy for accessing the disk via network. Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkAccessPolicy")] + public string NetworkAccessPolicy {get; set; } + + /// + /// Gets or sets aRM id of the DiskAccess resource for using private endpoints + /// on disks. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskAccessId")] + public string DiskAccessId {get; set; } + + /// + /// Gets latest time when bursting was last enabled on a disk. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "burstingEnabledTime")] + public System.DateTime? BurstingEnabledTime {get; private set; } + + /// + /// Gets or sets performance tier of the disk (e.g, P4, S10) as described here: + /// https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not + /// apply to Ultra disks. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + public string Tier {get; set; } + + /// + /// Gets or sets set to true to enable bursting beyond the provisioned + /// performance target of the disk. Bursting is disabled by default. Does not + /// apply to Ultra disks. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "burstingEnabled")] + public bool? BurstingEnabled {get; set; } + + /// + /// Gets properties of the disk for which update is pending. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "propertyUpdatesInProgress")] + public PropertyUpdatesInProgress PropertyUpdatesInProgress {get; private set; } + + /// + /// Gets or sets indicates the OS on a disk supports hibernation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "supportsHibernation")] + public bool? SupportsHibernation {get; set; } + + /// + /// Gets or sets contains the security related information for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "securityProfile")] + public DiskSecurityProfile SecurityProfile {get; set; } + + /// + /// Gets or sets percentage complete for the background copy when a resource is + /// created via the CopyStart operation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "completionPercent")] + public double? CompletionPercent {get; set; } + + /// + /// Gets or sets policy for controlling export on the disk. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicNetworkAccess")] + public string PublicNetworkAccess {get; set; } + + /// + /// Gets or sets additional authentication requirements when exporting or + /// uploading to a disk or snapshot. Possible values include: 'AzureActiveDirectory', 'None' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataAccessAuthMode")] + public string DataAccessAuthMode {get; set; } + + /// + /// Gets or sets setting this property to true improves reliability and + /// performance of data disks that are frequently (more than 5 times a day) by + /// detached from one virtual machine and attached to another. This property + /// should not be set for disks that are not detached and attached frequently + /// as it causes the disks to not align with the fault domain of the virtual + /// machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "optimizedForFrequentAttach")] + public bool? OptimizedForFrequentAttach {get; set; } + + /// + /// Gets the UTC time when the ownership state of the disk was last changed + /// i.e., the time the disk was last attached or detached from a VM or the time + /// when the VM to which the disk was attached was deallocated or started. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "LastOwnershipUpdateTime")] + public System.DateTime? LastOwnershipUpdateTime {get; private set; } + + /// + /// Gets or sets determines how platform treats disk failures + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "availabilityPolicy")] + public AvailabilityPolicy AvailabilityPolicy {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.CreationData == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CreationData"); + } + + + if (this.PurchasePlan != null) + { + this.PurchasePlan.Validate(); + } + + if (this.CreationData != null) + { + this.CreationData.Validate(); + } + + if (this.EncryptionSettingsCollection != null) + { + this.EncryptionSettingsCollection.Validate(); + } + + + + + + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePoint.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePoint.cs index a1277de01303..82d9df6b6188 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePoint.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePoint.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Properties of disk restore point /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class DiskRestorePoint : ProxyResource { /// @@ -32,72 +24,100 @@ public DiskRestorePoint() /// /// Initializes a new instance of the DiskRestorePoint class. /// - /// Resource Id - /// Resource name - /// Resource type - /// The timestamp of restorePoint - /// creation - /// arm id of source disk or source disk - /// restore point. - /// The Operating System type. Possible values - /// include: 'Windows', 'Linux' - /// The hypervisor generation of the - /// Virtual Machine. Applicable to OS disks only. Possible values - /// include: 'V1', 'V2' - /// Purchase plan information for the the - /// image from which the OS disk was created. - /// List of supported capabilities - /// for the image from which the OS disk was created. - /// id of the backing snapshot's MIS - /// family - /// unique incarnation id of the source - /// disk - /// Encryption property can be used to encrypt - /// data at rest with customer managed keys or platform managed - /// keys. - /// Indicates the OS on a disk - /// supports hibernation. - /// Policy for accessing the disk via - /// network. Possible values include: 'AllowAll', 'AllowPrivate', - /// 'DenyAll' - /// Policy for controlling export on - /// the disk. Possible values include: 'Enabled', 'Disabled' - /// ARM id of the DiskAccess resource for - /// using private endpoints on disks. - /// Percentage complete for the - /// background copy of disk restore point when source resource is from - /// a different region. - /// Replication state of disk restore - /// point when source resource is from a different region. - /// Location of source disk or - /// source disk restore point when source resource is from a different - /// region. - /// Contains the security related - /// information for the resource. - /// Logical sector size in bytes for - /// disk restore points of UltraSSD_LRS and PremiumV2_LRS disks. - /// Supported values are 512 and 4096. 4096 is the default. - public DiskRestorePoint(string id = default(string), string name = default(string), string type = default(string), System.DateTime? timeCreated = default(System.DateTime?), string sourceResourceId = default(string), OperatingSystemTypes? osType = default(OperatingSystemTypes?), string hyperVGeneration = default(string), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), string familyId = default(string), string sourceUniqueId = default(string), Encryption encryption = default(Encryption), bool? supportsHibernation = default(bool?), string networkAccessPolicy = default(string), string publicNetworkAccess = default(string), string diskAccessId = default(string), double? completionPercent = default(double?), string replicationState = default(string), string sourceResourceLocation = default(string), DiskSecurityProfile securityProfile = default(DiskSecurityProfile), int? logicalSectorSize = default(int?)) - : base(id, name, type) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Purchase plan information for the the image from which the OS disk was + /// created. + /// + + /// List of supported capabilities for the image from which the OS disk was + /// created. + /// + + /// Encryption property can be used to encrypt data at rest with customer + /// managed keys or platform managed keys. + /// + + /// The timestamp of restorePoint creation + /// + + /// arm id of source disk or source disk restore point. + /// + + /// The Operating System type. + /// Possible values include: 'Windows', 'Linux' + + /// The hypervisor generation of the Virtual Machine. Applicable to OS disks + /// only. + /// Possible values include: 'V1', 'V2' + + /// id of the backing snapshot's MIS family + /// + + /// unique incarnation id of the source disk + /// + + /// Indicates the OS on a disk supports hibernation. + /// + + /// Policy for accessing the disk via network. + /// Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + + /// Policy for controlling export on the disk. + /// Possible values include: 'Enabled', 'Disabled' + + /// ARM id of the DiskAccess resource for using private endpoints on disks. + /// + + /// Percentage complete for the background copy of disk restore point when + /// source resource is from a different region. + /// + + /// Replication state of disk restore point when source resource is from a + /// different region. + /// + + /// Location of source disk or source disk restore point when source resource + /// is from a different region. + /// + + /// Contains the security related information for the resource. + /// + + /// Logical sector size in bytes for disk restore points of UltraSSD_LRS and + /// PremiumV2_LRS disks. Supported values are 512 and 4096. 4096 is the + /// default. + /// + public DiskRestorePoint(string id = default(string), string name = default(string), string type = default(string), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), Encryption encryption = default(Encryption), System.DateTime? timeCreated = default(System.DateTime?), string sourceResourceId = default(string), OperatingSystemTypes? osType = default(OperatingSystemTypes?), string hyperVGeneration = default(string), string familyId = default(string), string sourceUniqueId = default(string), bool? supportsHibernation = default(bool?), string networkAccessPolicy = default(string), string publicNetworkAccess = default(string), string diskAccessId = default(string), double? completionPercent = default(double?), string replicationState = default(string), string sourceResourceLocation = default(string), DiskSecurityProfile securityProfile = default(DiskSecurityProfile), int? logicalSectorSize = default(int?)) + + : base(id, name, type) { - TimeCreated = timeCreated; - SourceResourceId = sourceResourceId; - OsType = osType; - HyperVGeneration = hyperVGeneration; - PurchasePlan = purchasePlan; - SupportedCapabilities = supportedCapabilities; - FamilyId = familyId; - SourceUniqueId = sourceUniqueId; - Encryption = encryption; - SupportsHibernation = supportsHibernation; - NetworkAccessPolicy = networkAccessPolicy; - PublicNetworkAccess = publicNetworkAccess; - DiskAccessId = diskAccessId; - CompletionPercent = completionPercent; - ReplicationState = replicationState; - SourceResourceLocation = sourceResourceLocation; - SecurityProfile = securityProfile; - LogicalSectorSize = logicalSectorSize; + this.PurchasePlan = purchasePlan; + this.SupportedCapabilities = supportedCapabilities; + this.Encryption = encryption; + this.TimeCreated = timeCreated; + this.SourceResourceId = sourceResourceId; + this.OsType = osType; + this.HyperVGeneration = hyperVGeneration; + this.FamilyId = familyId; + this.SourceUniqueId = sourceUniqueId; + this.SupportsHibernation = supportsHibernation; + this.NetworkAccessPolicy = networkAccessPolicy; + this.PublicNetworkAccess = publicNetworkAccess; + this.DiskAccessId = diskAccessId; + this.CompletionPercent = completionPercent; + this.ReplicationState = replicationState; + this.SourceResourceLocation = sourceResourceLocation; + this.SecurityProfile = securityProfile; + this.LogicalSectorSize = logicalSectorSize; CustomInit(); } @@ -106,140 +126,149 @@ public DiskRestorePoint() /// partial void CustomInit(); + /// - /// Gets the timestamp of restorePoint creation + /// Gets or sets purchase plan information for the the image from which the OS + /// disk was created. /// - [JsonProperty(PropertyName = "properties.timeCreated")] - public System.DateTime? TimeCreated { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.purchasePlan")] + public PurchasePlan PurchasePlan {get; set; } /// - /// Gets arm id of source disk or source disk restore point. + /// Gets or sets list of supported capabilities for the image from which the OS + /// disk was created. /// - [JsonProperty(PropertyName = "properties.sourceResourceId")] - public string SourceResourceId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.supportedCapabilities")] + public SupportedCapabilities SupportedCapabilities {get; set; } /// - /// Gets the Operating System type. Possible values include: 'Windows', - /// 'Linux' + /// Gets encryption property can be used to encrypt data at rest with customer + /// managed keys or platform managed keys. /// - [JsonProperty(PropertyName = "properties.osType")] - public OperatingSystemTypes? OsType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryption")] + public Encryption Encryption {get; private set; } /// - /// Gets or sets the hypervisor generation of the Virtual Machine. - /// Applicable to OS disks only. Possible values include: 'V1', 'V2' + /// Gets the timestamp of restorePoint creation /// - [JsonProperty(PropertyName = "properties.hyperVGeneration")] - public string HyperVGeneration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeCreated")] + public System.DateTime? TimeCreated {get; private set; } /// - /// Gets or sets purchase plan information for the the image from which - /// the OS disk was created. + /// Gets arm id of source disk or source disk restore point. /// - [JsonProperty(PropertyName = "properties.purchasePlan")] - public PurchasePlan PurchasePlan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourceResourceId")] + public string SourceResourceId {get; private set; } /// - /// Gets or sets list of supported capabilities for the image from - /// which the OS disk was created. + /// Gets the Operating System type. Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "properties.supportedCapabilities")] - public SupportedCapabilities SupportedCapabilities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osType")] + public OperatingSystemTypes? OsType {get; private set; } /// - /// Gets id of the backing snapshot's MIS family + /// Gets or sets the hypervisor generation of the Virtual Machine. Applicable + /// to OS disks only. Possible values include: 'V1', 'V2' /// - [JsonProperty(PropertyName = "properties.familyId")] - public string FamilyId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hyperVGeneration")] + public string HyperVGeneration {get; set; } /// - /// Gets unique incarnation id of the source disk + /// Gets id of the backing snapshot's MIS family /// - [JsonProperty(PropertyName = "properties.sourceUniqueId")] - public string SourceUniqueId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.familyId")] + public string FamilyId {get; private set; } /// - /// Gets encryption property can be used to encrypt data at rest with - /// customer managed keys or platform managed keys. + /// Gets unique incarnation id of the source disk /// - [JsonProperty(PropertyName = "properties.encryption")] - public Encryption Encryption { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourceUniqueId")] + public string SourceUniqueId {get; private set; } /// /// Gets or sets indicates the OS on a disk supports hibernation. /// - [JsonProperty(PropertyName = "properties.supportsHibernation")] - public bool? SupportsHibernation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.supportsHibernation")] + public bool? SupportsHibernation {get; set; } /// - /// Gets or sets policy for accessing the disk via network. Possible - /// values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + /// Gets or sets policy for accessing the disk via network. Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' /// - [JsonProperty(PropertyName = "properties.networkAccessPolicy")] - public string NetworkAccessPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkAccessPolicy")] + public string NetworkAccessPolicy {get; set; } /// - /// Gets or sets policy for controlling export on the disk. Possible - /// values include: 'Enabled', 'Disabled' + /// Gets or sets policy for controlling export on the disk. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.publicNetworkAccess")] - public string PublicNetworkAccess { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicNetworkAccess")] + public string PublicNetworkAccess {get; set; } /// - /// Gets or sets ARM id of the DiskAccess resource for using private - /// endpoints on disks. + /// Gets or sets aRM id of the DiskAccess resource for using private endpoints + /// on disks. /// - [JsonProperty(PropertyName = "properties.diskAccessId")] - public string DiskAccessId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskAccessId")] + public string DiskAccessId {get; set; } /// - /// Gets or sets percentage complete for the background copy of disk - /// restore point when source resource is from a different region. + /// Gets or sets percentage complete for the background copy of disk restore + /// point when source resource is from a different region. /// - [JsonProperty(PropertyName = "properties.completionPercent")] - public double? CompletionPercent { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.completionPercent")] + public double? CompletionPercent {get; set; } /// - /// Gets replication state of disk restore point when source resource - /// is from a different region. + /// Gets replication state of disk restore point when source resource is from a + /// different region. /// - [JsonProperty(PropertyName = "properties.replicationState")] - public string ReplicationState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.replicationState")] + public string ReplicationState {get; private set; } /// - /// Gets location of source disk or source disk restore point when - /// source resource is from a different region. + /// Gets location of source disk or source disk restore point when source + /// resource is from a different region. /// - [JsonProperty(PropertyName = "properties.sourceResourceLocation")] - public string SourceResourceLocation { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourceResourceLocation")] + public string SourceResourceLocation {get; private set; } /// - /// Gets or sets contains the security related information for the - /// resource. + /// Gets or sets contains the security related information for the resource. /// - [JsonProperty(PropertyName = "properties.securityProfile")] - public DiskSecurityProfile SecurityProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityProfile")] + public DiskSecurityProfile SecurityProfile {get; set; } /// - /// Gets logical sector size in bytes for disk restore points of - /// UltraSSD_LRS and PremiumV2_LRS disks. Supported values are 512 and - /// 4096. 4096 is the default. + /// Gets logical sector size in bytes for disk restore points of UltraSSD_LRS + /// and PremiumV2_LRS disks. Supported values are 512 and 4096. 4096 is the + /// default. /// - [JsonProperty(PropertyName = "properties.logicalSectorSize")] - public int? LogicalSectorSize { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.logicalSectorSize")] + public int? LogicalSectorSize {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (PurchasePlan != null) + if (this.PurchasePlan != null) { - PurchasePlan.Validate(); + this.PurchasePlan.Validate(); } + + + + + + + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointAttributes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointAttributes.cs index c9d6ad197ffa..a514145e8c74 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointAttributes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointAttributes.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,22 @@ public DiskRestorePointAttributes() /// /// Initializes a new instance of the DiskRestorePointAttributes class. /// - /// Resource Id - /// Encryption at rest settings for disk - /// restore point. It is an optional property that can be specified in - /// the input while creating a restore point. - /// Resource Id of the source disk - /// restore point. + + /// Resource Id + /// + + /// Encryption at rest settings for disk restore point. It is an optional + /// property that can be specified in the input while creating a restore point. + /// + + /// Resource Id of the source disk restore point. + /// public DiskRestorePointAttributes(string id = default(string), RestorePointEncryption encryption = default(RestorePointEncryption), ApiEntityReference sourceDiskRestorePoint = default(ApiEntityReference)) - : base(id) + + : base(id) { - Encryption = encryption; - SourceDiskRestorePoint = sourceDiskRestorePoint; + this.Encryption = encryption; + this.SourceDiskRestorePoint = sourceDiskRestorePoint; CustomInit(); } @@ -48,19 +47,19 @@ public DiskRestorePointAttributes() /// partial void CustomInit(); + /// - /// Gets or sets encryption at rest settings for disk restore point. It - /// is an optional property that can be specified in the input while - /// creating a restore point. + /// Gets or sets encryption at rest settings for disk restore point. It is an + /// optional property that can be specified in the input while creating a + /// restore point. /// - [JsonProperty(PropertyName = "encryption")] - public RestorePointEncryption Encryption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "encryption")] + public RestorePointEncryption Encryption {get; set; } /// /// Gets or sets resource Id of the source disk restore point. /// - [JsonProperty(PropertyName = "sourceDiskRestorePoint")] - public ApiEntityReference SourceDiskRestorePoint { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceDiskRestorePoint")] + public ApiEntityReference SourceDiskRestorePoint {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointInstanceView.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointInstanceView.cs index 75bb938480f2..3585943583c4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointInstanceView.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointInstanceView.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class DiskRestorePointInstanceView { /// - /// Initializes a new instance of the DiskRestorePointInstanceView - /// class. + /// Initializes a new instance of the DiskRestorePointInstanceView class. /// public DiskRestorePointInstanceView() { @@ -28,16 +21,19 @@ public DiskRestorePointInstanceView() } /// - /// Initializes a new instance of the DiskRestorePointInstanceView - /// class. + /// Initializes a new instance of the DiskRestorePointInstanceView class. /// - /// Disk restore point Id. - /// The disk restore point replication - /// status information. + + /// Disk restore point Id. + /// + + /// The disk restore point replication status information. + /// public DiskRestorePointInstanceView(string id = default(string), DiskRestorePointReplicationStatus replicationStatus = default(DiskRestorePointReplicationStatus)) + { - Id = id; - ReplicationStatus = replicationStatus; + this.Id = id; + this.ReplicationStatus = replicationStatus; CustomInit(); } @@ -46,17 +42,17 @@ public DiskRestorePointInstanceView() /// partial void CustomInit(); + /// /// Gets or sets disk restore point Id. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets the disk restore point replication status information. /// - [JsonProperty(PropertyName = "replicationStatus")] - public DiskRestorePointReplicationStatus ReplicationStatus { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "replicationStatus")] + public DiskRestorePointReplicationStatus ReplicationStatus {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointProperties.cs new file mode 100644 index 000000000000..683d38d1f686 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointProperties.cs @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Properties of an incremental disk restore point + /// + public partial class DiskRestorePointProperties + { + /// + /// Initializes a new instance of the DiskRestorePointProperties class. + /// + public DiskRestorePointProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiskRestorePointProperties class. + /// + + /// The timestamp of restorePoint creation + /// + + /// arm id of source disk or source disk restore point. + /// + + /// The Operating System type. + /// Possible values include: 'Windows', 'Linux' + + /// The hypervisor generation of the Virtual Machine. Applicable to OS disks + /// only. + /// Possible values include: 'V1', 'V2' + + /// Purchase plan information for the the image from which the OS disk was + /// created. + /// + + /// List of supported capabilities for the image from which the OS disk was + /// created. + /// + + /// id of the backing snapshot's MIS family + /// + + /// unique incarnation id of the source disk + /// + + /// Encryption property can be used to encrypt data at rest with customer + /// managed keys or platform managed keys. + /// + + /// Indicates the OS on a disk supports hibernation. + /// + + /// Policy for accessing the disk via network. + /// Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + + /// Policy for controlling export on the disk. + /// Possible values include: 'Enabled', 'Disabled' + + /// ARM id of the DiskAccess resource for using private endpoints on disks. + /// + + /// Percentage complete for the background copy of disk restore point when + /// source resource is from a different region. + /// + + /// Replication state of disk restore point when source resource is from a + /// different region. + /// + + /// Location of source disk or source disk restore point when source resource + /// is from a different region. + /// + + /// Contains the security related information for the resource. + /// + + /// Logical sector size in bytes for disk restore points of UltraSSD_LRS and + /// PremiumV2_LRS disks. Supported values are 512 and 4096. 4096 is the + /// default. + /// + public DiskRestorePointProperties(System.DateTime? timeCreated = default(System.DateTime?), string sourceResourceId = default(string), OperatingSystemTypes? osType = default(OperatingSystemTypes?), string hyperVGeneration = default(string), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), string familyId = default(string), string sourceUniqueId = default(string), Encryption encryption = default(Encryption), bool? supportsHibernation = default(bool?), string networkAccessPolicy = default(string), string publicNetworkAccess = default(string), string diskAccessId = default(string), double? completionPercent = default(double?), string replicationState = default(string), string sourceResourceLocation = default(string), DiskSecurityProfile securityProfile = default(DiskSecurityProfile), int? logicalSectorSize = default(int?)) + + { + this.TimeCreated = timeCreated; + this.SourceResourceId = sourceResourceId; + this.OsType = osType; + this.HyperVGeneration = hyperVGeneration; + this.PurchasePlan = purchasePlan; + this.SupportedCapabilities = supportedCapabilities; + this.FamilyId = familyId; + this.SourceUniqueId = sourceUniqueId; + this.Encryption = encryption; + this.SupportsHibernation = supportsHibernation; + this.NetworkAccessPolicy = networkAccessPolicy; + this.PublicNetworkAccess = publicNetworkAccess; + this.DiskAccessId = diskAccessId; + this.CompletionPercent = completionPercent; + this.ReplicationState = replicationState; + this.SourceResourceLocation = sourceResourceLocation; + this.SecurityProfile = securityProfile; + this.LogicalSectorSize = logicalSectorSize; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the timestamp of restorePoint creation + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeCreated")] + public System.DateTime? TimeCreated {get; private set; } + + /// + /// Gets arm id of source disk or source disk restore point. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceResourceId")] + public string SourceResourceId {get; private set; } + + /// + /// Gets the Operating System type. Possible values include: 'Windows', 'Linux' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public OperatingSystemTypes? OsType {get; private set; } + + /// + /// Gets or sets the hypervisor generation of the Virtual Machine. Applicable + /// to OS disks only. Possible values include: 'V1', 'V2' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hyperVGeneration")] + public string HyperVGeneration {get; set; } + + /// + /// Gets or sets purchase plan information for the the image from which the OS + /// disk was created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "purchasePlan")] + public PurchasePlan PurchasePlan {get; set; } + + /// + /// Gets or sets list of supported capabilities for the image from which the OS + /// disk was created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "supportedCapabilities")] + public SupportedCapabilities SupportedCapabilities {get; set; } + + /// + /// Gets id of the backing snapshot's MIS family + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "familyId")] + public string FamilyId {get; private set; } + + /// + /// Gets unique incarnation id of the source disk + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceUniqueId")] + public string SourceUniqueId {get; private set; } + + /// + /// Gets encryption property can be used to encrypt data at rest with customer + /// managed keys or platform managed keys. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encryption")] + public Encryption Encryption {get; private set; } + + /// + /// Gets or sets indicates the OS on a disk supports hibernation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "supportsHibernation")] + public bool? SupportsHibernation {get; set; } + + /// + /// Gets or sets policy for accessing the disk via network. Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkAccessPolicy")] + public string NetworkAccessPolicy {get; set; } + + /// + /// Gets or sets policy for controlling export on the disk. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicNetworkAccess")] + public string PublicNetworkAccess {get; set; } + + /// + /// Gets or sets aRM id of the DiskAccess resource for using private endpoints + /// on disks. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskAccessId")] + public string DiskAccessId {get; set; } + + /// + /// Gets or sets percentage complete for the background copy of disk restore + /// point when source resource is from a different region. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "completionPercent")] + public double? CompletionPercent {get; set; } + + /// + /// Gets replication state of disk restore point when source resource is from a + /// different region. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "replicationState")] + public string ReplicationState {get; private set; } + + /// + /// Gets location of source disk or source disk restore point when source + /// resource is from a different region. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceResourceLocation")] + public string SourceResourceLocation {get; private set; } + + /// + /// Gets or sets contains the security related information for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "securityProfile")] + public DiskSecurityProfile SecurityProfile {get; set; } + + /// + /// Gets logical sector size in bytes for disk restore points of UltraSSD_LRS + /// and PremiumV2_LRS disks. Supported values are 512 and 4096. 4096 is the + /// default. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "logicalSectorSize")] + public int? LogicalSectorSize {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + if (this.PurchasePlan != null) + { + this.PurchasePlan.Validate(); + } + + + + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointReplicationStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointReplicationStatus.cs index 5ab6ff044d13..45c5f491c74c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointReplicationStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskRestorePointReplicationStatus.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class DiskRestorePointReplicationStatus { /// - /// Initializes a new instance of the DiskRestorePointReplicationStatus - /// class. + /// Initializes a new instance of the DiskRestorePointReplicationStatus class. /// public DiskRestorePointReplicationStatus() { @@ -28,16 +21,19 @@ public DiskRestorePointReplicationStatus() } /// - /// Initializes a new instance of the DiskRestorePointReplicationStatus - /// class. + /// Initializes a new instance of the DiskRestorePointReplicationStatus class. /// - /// The resource status information. - /// Replication completion - /// percentage. + + /// The resource status information. + /// + + /// Replication completion percentage. + /// public DiskRestorePointReplicationStatus(InstanceViewStatus status = default(InstanceViewStatus), int? completionPercent = default(int?)) + { - Status = status; - CompletionPercent = completionPercent; + this.Status = status; + this.CompletionPercent = completionPercent; CustomInit(); } @@ -46,17 +42,17 @@ public DiskRestorePointReplicationStatus() /// partial void CustomInit(); + /// /// Gets or sets the resource status information. /// - [JsonProperty(PropertyName = "status")] - public InstanceViewStatus Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public InstanceViewStatus Status {get; set; } /// /// Gets or sets replication completion percentage. /// - [JsonProperty(PropertyName = "completionPercent")] - public int? CompletionPercent { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "completionPercent")] + public int? CompletionPercent {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskSecurityProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskSecurityProfile.cs index 985d1790ce60..8e77b1e71d49 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskSecurityProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskSecurityProfile.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,20 +23,22 @@ public DiskSecurityProfile() /// /// Initializes a new instance of the DiskSecurityProfile class. /// - /// Specifies the SecurityType of the VM. - /// Applicable for OS disks only. Possible values include: - /// 'TrustedLaunch', - /// 'ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey', - /// 'ConfidentialVM_DiskEncryptedWithPlatformKey', - /// 'ConfidentialVM_DiskEncryptedWithCustomerKey', - /// 'ConfidentialVM_NonPersistedTPM' - /// ResourceId of the disk - /// encryption set associated to Confidential VM supported disk - /// encrypted with customer managed key + + /// Specifies the SecurityType of the VM. Applicable for OS disks only. + /// Possible values include: 'TrustedLaunch', + /// 'ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey', + /// 'ConfidentialVM_DiskEncryptedWithPlatformKey', + /// 'ConfidentialVM_DiskEncryptedWithCustomerKey', + /// 'ConfidentialVM_NonPersistedTPM' + + /// ResourceId of the disk encryption set associated to Confidential VM + /// supported disk encrypted with customer managed key + /// public DiskSecurityProfile(string securityType = default(string), string secureVMDiskEncryptionSetId = default(string)) + { - SecurityType = securityType; - SecureVMDiskEncryptionSetId = secureVMDiskEncryptionSetId; + this.SecurityType = securityType; + this.SecureVMDiskEncryptionSetId = secureVMDiskEncryptionSetId; CustomInit(); } @@ -51,23 +47,19 @@ public DiskSecurityProfile() /// partial void CustomInit(); + /// - /// Gets or sets specifies the SecurityType of the VM. Applicable for - /// OS disks only. Possible values include: 'TrustedLaunch', - /// 'ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey', - /// 'ConfidentialVM_DiskEncryptedWithPlatformKey', - /// 'ConfidentialVM_DiskEncryptedWithCustomerKey', - /// 'ConfidentialVM_NonPersistedTPM' + /// Gets or sets specifies the SecurityType of the VM. Applicable for OS disks + /// only. Possible values include: 'TrustedLaunch', 'ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey', 'ConfidentialVM_DiskEncryptedWithPlatformKey', 'ConfidentialVM_DiskEncryptedWithCustomerKey', 'ConfidentialVM_NonPersistedTPM' /// - [JsonProperty(PropertyName = "securityType")] - public string SecurityType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "securityType")] + public string SecurityType {get; set; } /// /// Gets or sets resourceId of the disk encryption set associated to /// Confidential VM supported disk encrypted with customer managed key /// - [JsonProperty(PropertyName = "secureVMDiskEncryptionSetId")] - public string SecureVMDiskEncryptionSetId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "secureVMDiskEncryptionSetId")] + public string SecureVMDiskEncryptionSetId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskSecurityTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskSecurityTypes.cs index e521660702e5..824ad8bc16cd 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskSecurityTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskSecurityTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,17 +9,19 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for DiskSecurityTypes. /// + + public static class DiskSecurityTypes { /// - /// Trusted Launch provides security features such as secure boot and - /// virtual Trusted Platform Module (vTPM) + /// Trusted Launch provides security features such as secure boot and virtual + /// Trusted Platform Module (vTPM) /// public const string TrustedLaunch = "TrustedLaunch"; /// /// Indicates Confidential VM disk with only VM guest state encrypted /// - public const string ConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey"; + public const string ConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey"; /// /// Indicates Confidential VM disk with both OS disk and VM guest state /// encrypted with a platform managed key @@ -36,9 +33,9 @@ public static class DiskSecurityTypes /// public const string ConfidentialVMDiskEncryptedWithCustomerKey = "ConfidentialVM_DiskEncryptedWithCustomerKey"; /// - /// Indicates Confidential VM disk with a ephemeral vTPM. vTPM state is - /// not persisted across VM reboots. + /// Indicates Confidential VM disk with a ephemeral vTPM. vTPM state is not + /// persisted across VM reboots. /// public const string ConfidentialVMNonPersistedTPM = "ConfidentialVM_NonPersistedTPM"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskSku.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskSku.cs index 19e3d33ddedf..df7500e445e1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskSku.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskSku.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -30,14 +24,18 @@ public DiskSku() /// /// Initializes a new instance of the DiskSku class. /// - /// The sku name. Possible values include: - /// 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS', - /// 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' - /// The sku tier. + + /// The sku name. + /// Possible values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + /// 'UltraSSD_LRS', 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' + + /// The sku tier. + /// public DiskSku(string name = default(string), string tier = default(string)) + { - Name = name; - Tier = tier; + this.Name = name; + this.Tier = tier; CustomInit(); } @@ -46,19 +44,17 @@ public DiskSku() /// partial void CustomInit(); + /// - /// Gets or sets the sku name. Possible values include: 'Standard_LRS', - /// 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS', 'Premium_ZRS', - /// 'StandardSSD_ZRS', 'PremiumV2_LRS' + /// Gets or sets the sku name. Possible values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS', 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets the sku tier. /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + public string Tier {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskState.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskState.cs index c1c3c4072ec0..2c6f25599339 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskState.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for DiskState. /// + + public static class DiskState { /// @@ -37,13 +34,12 @@ public static class DiskState /// public const string ActiveSAS = "ActiveSAS"; /// - /// The disk is attached to a VM in hibernated state and has an active - /// SAS URI associated with it. + /// The disk is attached to a VM in hibernated state and has an active SAS URI + /// associated with it. /// public const string ActiveSASFrozen = "ActiveSASFrozen"; /// - /// A disk is ready to be created by upload by requesting a write - /// token. + /// A disk is ready to be created by upload by requesting a write token. /// public const string ReadyToUpload = "ReadyToUpload"; /// @@ -52,4 +48,4 @@ public static class DiskState /// public const string ActiveUpload = "ActiveUpload"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskStorageAccountTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskStorageAccountTypes.cs index 9832862b6cc0..55234ae7525b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskStorageAccountTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskStorageAccountTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,45 +9,47 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for DiskStorageAccountTypes. /// + + public static class DiskStorageAccountTypes { /// - /// Standard HDD locally redundant storage. Best for backup, - /// non-critical, and infrequent access. + /// Standard HDD locally redundant storage. Best for backup, non-critical, and + /// infrequent access. /// public const string StandardLRS = "Standard_LRS"; /// - /// Premium SSD locally redundant storage. Best for production and - /// performance sensitive workloads. + /// Premium SSD locally redundant storage. Best for production and performance + /// sensitive workloads. /// public const string PremiumLRS = "Premium_LRS"; /// - /// Standard SSD locally redundant storage. Best for web servers, - /// lightly used enterprise applications and dev/test. + /// Standard SSD locally redundant storage. Best for web servers, lightly used + /// enterprise applications and dev/test. /// public const string StandardSSDLRS = "StandardSSD_LRS"; /// - /// Ultra SSD locally redundant storage. Best for IO-intensive - /// workloads such as SAP HANA, top tier databases (for example, SQL, - /// Oracle), and other transaction-heavy workloads. + /// Ultra SSD locally redundant storage. Best for IO-intensive workloads such + /// as SAP HANA, top tier databases (for example, SQL, Oracle), and other + /// transaction-heavy workloads. /// public const string UltraSSDLRS = "UltraSSD_LRS"; /// - /// Premium SSD zone redundant storage. Best for the production - /// workloads that need storage resiliency against zone failures. + /// Premium SSD zone redundant storage. Best for the production workloads that + /// need storage resiliency against zone failures. /// public const string PremiumZRS = "Premium_ZRS"; /// - /// Standard SSD zone redundant storage. Best for web servers, lightly - /// used enterprise applications and dev/test that need storage - /// resiliency against zone failures. + /// Standard SSD zone redundant storage. Best for web servers, lightly used + /// enterprise applications and dev/test that need storage resiliency against + /// zone failures. /// public const string StandardSSDZRS = "StandardSSD_ZRS"; /// /// Premium SSD v2 locally redundant storage. Best for production and - /// performance-sensitive workloads that consistently require low - /// latency and high IOPS and throughput. + /// performance-sensitive workloads that consistently require low latency and + /// high IOPS and throughput. /// public const string PremiumV2LRS = "PremiumV2_LRS"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskUpdate.cs index 4868c02a788e..7bb3dbfdd8ca 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskUpdate.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Disk update resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class DiskUpdate { /// @@ -34,100 +24,125 @@ public DiskUpdate() /// /// Initializes a new instance of the DiskUpdate class. /// - /// the Operating System type. Possible values - /// include: 'Windows', 'Linux' - /// If creationData.createOption is Empty, - /// this field is mandatory and it indicates the size of the disk to - /// create. If this field is present for updates or creation with other - /// options, it indicates a resize. Resizes are only allowed if the - /// disk is not attached to a running VM, and can only increase the - /// disk's size. - /// Encryption settings - /// collection used be Azure Disk Encryption, can contain multiple - /// encryption settings per disk or snapshot. - /// The number of IOPS allowed for this - /// disk; only settable for UltraSSD disks. One operation can transfer - /// between 4k and 256k bytes. - /// The bandwidth allowed for this - /// disk; only settable for UltraSSD disks. MBps means millions of - /// bytes per second - MB here uses the ISO notation, of powers of - /// 10. - /// The total number of IOPS that will - /// be allowed across all VMs mounting the shared disk as ReadOnly. One - /// operation can transfer between 4k and 256k bytes. - /// The total throughput (MBps) that - /// will be allowed across all VMs mounting the shared disk as - /// ReadOnly. MBps means millions of bytes per second - MB here uses - /// the ISO notation, of powers of 10. - /// The maximum number of VMs that can attach - /// to the disk at the same time. Value greater than one indicates a - /// disk that can be mounted on multiple VMs at the same time. - /// Encryption property can be used to encrypt - /// data at rest with customer managed keys or platform managed - /// keys. - /// Policy for accessing the disk via - /// network. Possible values include: 'AllowAll', 'AllowPrivate', - /// 'DenyAll' - /// ARM id of the DiskAccess resource for - /// using private endpoints on disks. - /// Performance tier of the disk (e.g, P4, S10) as - /// described here: - /// https://azure.microsoft.com/en-us/pricing/details/managed-disks/. - /// Does not apply to Ultra disks. - /// Set to true to enable bursting beyond - /// the provisioned performance target of the disk. Bursting is - /// disabled by default. Does not apply to Ultra disks. - /// Purchase plan information to be added on - /// the OS disk - /// List of supported capabilities - /// to be added on the OS disk. - /// Properties of the disk for - /// which update is pending. - /// Indicates the OS on a disk - /// supports hibernation. - /// Policy for controlling export on - /// the disk. Possible values include: 'Enabled', 'Disabled' - /// Additional authentication - /// requirements when exporting or uploading to a disk or snapshot. - /// Possible values include: 'AzureActiveDirectory', 'None' - /// Setting this property to - /// true improves reliability and performance of data disks that are - /// frequently (more than 5 times a day) by detached from one virtual - /// machine and attached to another. This property should not be set - /// for disks that are not detached and attached frequently as it - /// causes the disks to not align with the fault domain of the virtual - /// machine. - /// Determines how platform treats - /// disk failures - /// Resource tags - /// The disks sku name. Can be Standard_LRS, - /// Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, - /// StandardSSD_ZRS, or PremiumV2_LRS. - public DiskUpdate(OperatingSystemTypes? osType = default(OperatingSystemTypes?), int? diskSizeGB = default(int?), EncryptionSettingsCollection encryptionSettingsCollection = default(EncryptionSettingsCollection), long? diskIOPSReadWrite = default(long?), long? diskMBpsReadWrite = default(long?), long? diskIOPSReadOnly = default(long?), long? diskMBpsReadOnly = default(long?), int? maxShares = default(int?), Encryption encryption = default(Encryption), string networkAccessPolicy = default(string), string diskAccessId = default(string), string tier = default(string), bool? burstingEnabled = default(bool?), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), PropertyUpdatesInProgress propertyUpdatesInProgress = default(PropertyUpdatesInProgress), bool? supportsHibernation = default(bool?), string publicNetworkAccess = default(string), string dataAccessAuthMode = default(string), bool? optimizedForFrequentAttach = default(bool?), AvailabilityPolicy availabilityPolicy = default(AvailabilityPolicy), IDictionary tags = default(IDictionary), DiskSku sku = default(DiskSku)) + + /// Resource tags + /// + + /// The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, + /// UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. + /// + + /// Encryption property can be used to encrypt data at rest with customer + /// managed keys or platform managed keys. + /// + + /// Purchase plan information to be added on the OS disk + /// + + /// List of supported capabilities to be added on the OS disk. + /// + + /// Determines how platform treats disk failures + /// + + /// the Operating System type. + /// Possible values include: 'Windows', 'Linux' + + /// If creationData.createOption is Empty, this field is mandatory and it + /// indicates the size of the disk to create. If this field is present for + /// updates or creation with other options, it indicates a resize. Resizes are + /// only allowed if the disk is not attached to a running VM, and can only + /// increase the disk's size. + /// + + /// Encryption settings collection used be Azure Disk Encryption, can contain + /// multiple encryption settings per disk or snapshot. + /// + + /// The number of IOPS allowed for this disk; only settable for UltraSSD disks. + /// One operation can transfer between 4k and 256k bytes. + /// + + /// The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps + /// means millions of bytes per second - MB here uses the ISO notation, of + /// powers of 10. + /// + + /// The total number of IOPS that will be allowed across all VMs mounting the + /// shared disk as ReadOnly. One operation can transfer between 4k and 256k + /// bytes. + /// + + /// The total throughput (MBps) that will be allowed across all VMs mounting + /// the shared disk as ReadOnly. MBps means millions of bytes per second - MB + /// here uses the ISO notation, of powers of 10. + /// + + /// The maximum number of VMs that can attach to the disk at the same time. + /// Value greater than one indicates a disk that can be mounted on multiple VMs + /// at the same time. + /// + + /// Policy for accessing the disk via network. + /// Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + + /// ARM id of the DiskAccess resource for using private endpoints on disks. + /// + + /// Performance tier of the disk (e.g, P4, S10) as described here: + /// https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not + /// apply to Ultra disks. + /// + + /// Set to true to enable bursting beyond the provisioned performance target of + /// the disk. Bursting is disabled by default. Does not apply to Ultra disks. + /// + + /// Properties of the disk for which update is pending. + /// + + /// Indicates the OS on a disk supports hibernation. + /// + + /// Policy for controlling export on the disk. + /// Possible values include: 'Enabled', 'Disabled' + + /// Additional authentication requirements when exporting or uploading to a + /// disk or snapshot. + /// Possible values include: 'AzureActiveDirectory', 'None' + + /// Setting this property to true improves reliability and performance of data + /// disks that are frequently (more than 5 times a day) by detached from one + /// virtual machine and attached to another. This property should not be set + /// for disks that are not detached and attached frequently as it causes the + /// disks to not align with the fault domain of the virtual machine. + /// + public DiskUpdate(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), DiskSku sku = default(DiskSku), Encryption encryption = default(Encryption), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), AvailabilityPolicy availabilityPolicy = default(AvailabilityPolicy), OperatingSystemTypes? osType = default(OperatingSystemTypes?), int? diskSizeGb = default(int?), EncryptionSettingsCollection encryptionSettingsCollection = default(EncryptionSettingsCollection), long? diskIopsReadWrite = default(long?), long? diskMBpsReadWrite = default(long?), long? diskIopsReadOnly = default(long?), long? diskMBpsReadOnly = default(long?), int? maxShares = default(int?), string networkAccessPolicy = default(string), string diskAccessId = default(string), string tier = default(string), bool? burstingEnabled = default(bool?), PropertyUpdatesInProgress propertyUpdatesInProgress = default(PropertyUpdatesInProgress), bool? supportsHibernation = default(bool?), string publicNetworkAccess = default(string), string dataAccessAuthMode = default(string), bool? optimizedForFrequentAttach = default(bool?)) + { - OsType = osType; - DiskSizeGB = diskSizeGB; - EncryptionSettingsCollection = encryptionSettingsCollection; - DiskIOPSReadWrite = diskIOPSReadWrite; - DiskMBpsReadWrite = diskMBpsReadWrite; - DiskIOPSReadOnly = diskIOPSReadOnly; - DiskMBpsReadOnly = diskMBpsReadOnly; - MaxShares = maxShares; - Encryption = encryption; - NetworkAccessPolicy = networkAccessPolicy; - DiskAccessId = diskAccessId; - Tier = tier; - BurstingEnabled = burstingEnabled; - PurchasePlan = purchasePlan; - SupportedCapabilities = supportedCapabilities; - PropertyUpdatesInProgress = propertyUpdatesInProgress; - SupportsHibernation = supportsHibernation; - PublicNetworkAccess = publicNetworkAccess; - DataAccessAuthMode = dataAccessAuthMode; - OptimizedForFrequentAttach = optimizedForFrequentAttach; - AvailabilityPolicy = availabilityPolicy; - Tags = tags; - Sku = sku; + this.Tags = tags; + this.Sku = sku; + this.Encryption = encryption; + this.PurchasePlan = purchasePlan; + this.SupportedCapabilities = supportedCapabilities; + this.AvailabilityPolicy = availabilityPolicy; + this.OsType = osType; + this.DiskSizeGB = diskSizeGb; + this.EncryptionSettingsCollection = encryptionSettingsCollection; + this.DiskIOPSReadWrite = diskIopsReadWrite; + this.DiskMBpsReadWrite = diskMBpsReadWrite; + this.DiskIopsReadOnly = diskIopsReadOnly; + this.DiskMBpsReadOnly = diskMBpsReadOnly; + this.MaxShares = maxShares; + this.NetworkAccessPolicy = networkAccessPolicy; + this.DiskAccessId = diskAccessId; + this.Tier = tier; + this.BurstingEnabled = burstingEnabled; + this.PropertyUpdatesInProgress = propertyUpdatesInProgress; + this.SupportsHibernation = supportsHibernation; + this.PublicNetworkAccess = publicNetworkAccess; + this.DataAccessAuthMode = dataAccessAuthMode; + this.OptimizedForFrequentAttach = optimizedForFrequentAttach; CustomInit(); } @@ -136,197 +151,200 @@ public DiskUpdate() /// partial void CustomInit(); + /// - /// Gets or sets the Operating System type. Possible values include: - /// 'Windows', 'Linux' + /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "properties.osType")] - public OperatingSystemTypes? OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets or sets if creationData.createOption is Empty, this field is - /// mandatory and it indicates the size of the disk to create. If this - /// field is present for updates or creation with other options, it - /// indicates a resize. Resizes are only allowed if the disk is not - /// attached to a running VM, and can only increase the disk's size. + /// Gets or sets the disks sku name. Can be Standard_LRS, Premium_LRS, + /// StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or + /// PremiumV2_LRS. /// - [JsonProperty(PropertyName = "properties.diskSizeGB")] - public int? DiskSizeGB { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public DiskSku Sku {get; set; } /// - /// Gets or sets encryption settings collection used be Azure Disk - /// Encryption, can contain multiple encryption settings per disk or - /// snapshot. + /// Gets or sets encryption property can be used to encrypt data at rest with + /// customer managed keys or platform managed keys. /// - [JsonProperty(PropertyName = "properties.encryptionSettingsCollection")] - public EncryptionSettingsCollection EncryptionSettingsCollection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryption")] + public Encryption Encryption {get; set; } /// - /// Gets or sets the number of IOPS allowed for this disk; only - /// settable for UltraSSD disks. One operation can transfer between 4k - /// and 256k bytes. + /// Gets or sets purchase plan information to be added on the OS disk /// - [JsonProperty(PropertyName = "properties.diskIOPSReadWrite")] - public long? DiskIOPSReadWrite { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.purchasePlan")] + public PurchasePlan PurchasePlan {get; set; } /// - /// Gets or sets the bandwidth allowed for this disk; only settable for - /// UltraSSD disks. MBps means millions of bytes per second - MB here - /// uses the ISO notation, of powers of 10. + /// Gets or sets list of supported capabilities to be added on the OS disk. /// - [JsonProperty(PropertyName = "properties.diskMBpsReadWrite")] - public long? DiskMBpsReadWrite { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.supportedCapabilities")] + public SupportedCapabilities SupportedCapabilities {get; set; } /// - /// Gets or sets the total number of IOPS that will be allowed across - /// all VMs mounting the shared disk as ReadOnly. One operation can - /// transfer between 4k and 256k bytes. + /// Gets or sets determines how platform treats disk failures /// - [JsonProperty(PropertyName = "properties.diskIOPSReadOnly")] - public long? DiskIOPSReadOnly { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.availabilityPolicy")] + public AvailabilityPolicy AvailabilityPolicy {get; set; } /// - /// Gets or sets the total throughput (MBps) that will be allowed - /// across all VMs mounting the shared disk as ReadOnly. MBps means - /// millions of bytes per second - MB here uses the ISO notation, of - /// powers of 10. + /// Gets or sets the Operating System type. Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "properties.diskMBpsReadOnly")] - public long? DiskMBpsReadOnly { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osType")] + public OperatingSystemTypes? OsType {get; set; } /// - /// Gets or sets the maximum number of VMs that can attach to the disk - /// at the same time. Value greater than one indicates a disk that can - /// be mounted on multiple VMs at the same time. + /// Gets or sets if creationData.createOption is Empty, this field is mandatory + /// and it indicates the size of the disk to create. If this field is present + /// for updates or creation with other options, it indicates a resize. Resizes + /// are only allowed if the disk is not attached to a running VM, and can only + /// increase the disk's size. /// - [JsonProperty(PropertyName = "properties.maxShares")] - public int? MaxShares { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskSizeGB")] + public int? DiskSizeGB {get; set; } /// - /// Gets or sets encryption property can be used to encrypt data at - /// rest with customer managed keys or platform managed keys. + /// Gets or sets encryption settings collection used be Azure Disk Encryption, + /// can contain multiple encryption settings per disk or snapshot. /// - [JsonProperty(PropertyName = "properties.encryption")] - public Encryption Encryption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryptionSettingsCollection")] + public EncryptionSettingsCollection EncryptionSettingsCollection {get; set; } /// - /// Gets or sets policy for accessing the disk via network. Possible - /// values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + /// Gets or sets the number of IOPS allowed for this disk; only settable for + /// UltraSSD disks. One operation can transfer between 4k and 256k bytes. /// - [JsonProperty(PropertyName = "properties.networkAccessPolicy")] - public string NetworkAccessPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskIOPSReadWrite")] + public long? DiskIOPSReadWrite {get; set; } /// - /// Gets or sets ARM id of the DiskAccess resource for using private - /// endpoints on disks. + /// Gets or sets the bandwidth allowed for this disk; only settable for + /// UltraSSD disks. MBps means millions of bytes per second - MB here uses the + /// ISO notation, of powers of 10. /// - [JsonProperty(PropertyName = "properties.diskAccessId")] - public string DiskAccessId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskMBpsReadWrite")] + public long? DiskMBpsReadWrite {get; set; } /// - /// Gets or sets performance tier of the disk (e.g, P4, S10) as - /// described here: - /// https://azure.microsoft.com/en-us/pricing/details/managed-disks/. - /// Does not apply to Ultra disks. + /// Gets or sets the total number of IOPS that will be allowed across all VMs + /// mounting the shared disk as ReadOnly. One operation can transfer between 4k + /// and 256k bytes. /// - [JsonProperty(PropertyName = "properties.tier")] - public string Tier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskIOPSReadOnly")] + public long? DiskIopsReadOnly {get; set; } /// - /// Gets or sets set to true to enable bursting beyond the provisioned - /// performance target of the disk. Bursting is disabled by default. - /// Does not apply to Ultra disks. + /// Gets or sets the total throughput (MBps) that will be allowed across all + /// VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per + /// second - MB here uses the ISO notation, of powers of 10. /// - [JsonProperty(PropertyName = "properties.burstingEnabled")] - public bool? BurstingEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskMBpsReadOnly")] + public long? DiskMBpsReadOnly {get; set; } /// - /// Gets or sets purchase plan information to be added on the OS disk + /// Gets or sets the maximum number of VMs that can attach to the disk at the + /// same time. Value greater than one indicates a disk that can be mounted on + /// multiple VMs at the same time. /// - [JsonProperty(PropertyName = "properties.purchasePlan")] - public PurchasePlan PurchasePlan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.maxShares")] + public int? MaxShares {get; set; } /// - /// Gets or sets list of supported capabilities to be added on the OS - /// disk. + /// Gets or sets policy for accessing the disk via network. Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' /// - [JsonProperty(PropertyName = "properties.supportedCapabilities")] - public SupportedCapabilities SupportedCapabilities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkAccessPolicy")] + public string NetworkAccessPolicy {get; set; } /// - /// Gets properties of the disk for which update is pending. + /// Gets or sets aRM id of the DiskAccess resource for using private endpoints + /// on disks. /// - [JsonProperty(PropertyName = "properties.propertyUpdatesInProgress")] - public PropertyUpdatesInProgress PropertyUpdatesInProgress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskAccessId")] + public string DiskAccessId {get; set; } /// - /// Gets or sets indicates the OS on a disk supports hibernation. + /// Gets or sets performance tier of the disk (e.g, P4, S10) as described here: + /// https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not + /// apply to Ultra disks. /// - [JsonProperty(PropertyName = "properties.supportsHibernation")] - public bool? SupportsHibernation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.tier")] + public string Tier {get; set; } /// - /// Gets or sets policy for controlling export on the disk. Possible - /// values include: 'Enabled', 'Disabled' + /// Gets or sets set to true to enable bursting beyond the provisioned + /// performance target of the disk. Bursting is disabled by default. Does not + /// apply to Ultra disks. /// - [JsonProperty(PropertyName = "properties.publicNetworkAccess")] - public string PublicNetworkAccess { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.burstingEnabled")] + public bool? BurstingEnabled {get; set; } /// - /// Gets or sets additional authentication requirements when exporting - /// or uploading to a disk or snapshot. Possible values include: - /// 'AzureActiveDirectory', 'None' + /// Gets properties of the disk for which update is pending. /// - [JsonProperty(PropertyName = "properties.dataAccessAuthMode")] - public string DataAccessAuthMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.propertyUpdatesInProgress")] + public PropertyUpdatesInProgress PropertyUpdatesInProgress {get; private set; } /// - /// Gets or sets setting this property to true improves reliability and - /// performance of data disks that are frequently (more than 5 times a - /// day) by detached from one virtual machine and attached to another. - /// This property should not be set for disks that are not detached and - /// attached frequently as it causes the disks to not align with the - /// fault domain of the virtual machine. + /// Gets or sets indicates the OS on a disk supports hibernation. /// - [JsonProperty(PropertyName = "properties.optimizedForFrequentAttach")] - public bool? OptimizedForFrequentAttach { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.supportsHibernation")] + public bool? SupportsHibernation {get; set; } /// - /// Gets or sets determines how platform treats disk failures + /// Gets or sets policy for controlling export on the disk. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.availabilityPolicy")] - public AvailabilityPolicy AvailabilityPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicNetworkAccess")] + public string PublicNetworkAccess {get; set; } /// - /// Gets or sets resource tags + /// Gets or sets additional authentication requirements when exporting or + /// uploading to a disk or snapshot. Possible values include: 'AzureActiveDirectory', 'None' /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dataAccessAuthMode")] + public string DataAccessAuthMode {get; set; } /// - /// Gets or sets the disks sku name. Can be Standard_LRS, Premium_LRS, - /// StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or - /// PremiumV2_LRS. + /// Gets or sets setting this property to true improves reliability and + /// performance of data disks that are frequently (more than 5 times a day) by + /// detached from one virtual machine and attached to another. This property + /// should not be set for disks that are not detached and attached frequently + /// as it causes the disks to not align with the fault domain of the virtual + /// machine. /// - [JsonProperty(PropertyName = "sku")] - public DiskSku Sku { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.optimizedForFrequentAttach")] + public bool? OptimizedForFrequentAttach {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (EncryptionSettingsCollection != null) + + + + if (this.PurchasePlan != null) { - EncryptionSettingsCollection.Validate(); + this.PurchasePlan.Validate(); } - if (PurchasePlan != null) + + + + if (this.EncryptionSettingsCollection != null) { - PurchasePlan.Validate(); + this.EncryptionSettingsCollection.Validate(); } + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DiskUpdateProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskUpdateProperties.cs new file mode 100644 index 000000000000..ce8b393cc0c5 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DiskUpdateProperties.cs @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Disk resource update properties. + /// + public partial class DiskUpdateProperties + { + /// + /// Initializes a new instance of the DiskUpdateProperties class. + /// + public DiskUpdateProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiskUpdateProperties class. + /// + + /// the Operating System type. + /// Possible values include: 'Windows', 'Linux' + + /// If creationData.createOption is Empty, this field is mandatory and it + /// indicates the size of the disk to create. If this field is present for + /// updates or creation with other options, it indicates a resize. Resizes are + /// only allowed if the disk is not attached to a running VM, and can only + /// increase the disk's size. + /// + + /// Encryption settings collection used be Azure Disk Encryption, can contain + /// multiple encryption settings per disk or snapshot. + /// + + /// The number of IOPS allowed for this disk; only settable for UltraSSD disks. + /// One operation can transfer between 4k and 256k bytes. + /// + + /// The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps + /// means millions of bytes per second - MB here uses the ISO notation, of + /// powers of 10. + /// + + /// The total number of IOPS that will be allowed across all VMs mounting the + /// shared disk as ReadOnly. One operation can transfer between 4k and 256k + /// bytes. + /// + + /// The total throughput (MBps) that will be allowed across all VMs mounting + /// the shared disk as ReadOnly. MBps means millions of bytes per second - MB + /// here uses the ISO notation, of powers of 10. + /// + + /// The maximum number of VMs that can attach to the disk at the same time. + /// Value greater than one indicates a disk that can be mounted on multiple VMs + /// at the same time. + /// + + /// Encryption property can be used to encrypt data at rest with customer + /// managed keys or platform managed keys. + /// + + /// Policy for accessing the disk via network. + /// Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + + /// ARM id of the DiskAccess resource for using private endpoints on disks. + /// + + /// Performance tier of the disk (e.g, P4, S10) as described here: + /// https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not + /// apply to Ultra disks. + /// + + /// Set to true to enable bursting beyond the provisioned performance target of + /// the disk. Bursting is disabled by default. Does not apply to Ultra disks. + /// + + /// Purchase plan information to be added on the OS disk + /// + + /// List of supported capabilities to be added on the OS disk. + /// + + /// Properties of the disk for which update is pending. + /// + + /// Indicates the OS on a disk supports hibernation. + /// + + /// Policy for controlling export on the disk. + /// Possible values include: 'Enabled', 'Disabled' + + /// Additional authentication requirements when exporting or uploading to a + /// disk or snapshot. + /// Possible values include: 'AzureActiveDirectory', 'None' + + /// Setting this property to true improves reliability and performance of data + /// disks that are frequently (more than 5 times a day) by detached from one + /// virtual machine and attached to another. This property should not be set + /// for disks that are not detached and attached frequently as it causes the + /// disks to not align with the fault domain of the virtual machine. + /// + + /// Determines how platform treats disk failures + /// + public DiskUpdateProperties(OperatingSystemTypes? osType = default(OperatingSystemTypes?), int? diskSizeGb = default(int?), EncryptionSettingsCollection encryptionSettingsCollection = default(EncryptionSettingsCollection), long? diskIopsReadWrite = default(long?), long? diskMBpsReadWrite = default(long?), long? diskIopsReadOnly = default(long?), long? diskMBpsReadOnly = default(long?), int? maxShares = default(int?), Encryption encryption = default(Encryption), string networkAccessPolicy = default(string), string diskAccessId = default(string), string tier = default(string), bool? burstingEnabled = default(bool?), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), PropertyUpdatesInProgress propertyUpdatesInProgress = default(PropertyUpdatesInProgress), bool? supportsHibernation = default(bool?), string publicNetworkAccess = default(string), string dataAccessAuthMode = default(string), bool? optimizedForFrequentAttach = default(bool?), AvailabilityPolicy availabilityPolicy = default(AvailabilityPolicy)) + + { + this.OsType = osType; + this.DiskSizeGB = diskSizeGb; + this.EncryptionSettingsCollection = encryptionSettingsCollection; + this.DiskIOPSReadWrite = diskIopsReadWrite; + this.DiskMBpsReadWrite = diskMBpsReadWrite; + this.DiskIopsReadOnly = diskIopsReadOnly; + this.DiskMBpsReadOnly = diskMBpsReadOnly; + this.MaxShares = maxShares; + this.Encryption = encryption; + this.NetworkAccessPolicy = networkAccessPolicy; + this.DiskAccessId = diskAccessId; + this.Tier = tier; + this.BurstingEnabled = burstingEnabled; + this.PurchasePlan = purchasePlan; + this.SupportedCapabilities = supportedCapabilities; + this.PropertyUpdatesInProgress = propertyUpdatesInProgress; + this.SupportsHibernation = supportsHibernation; + this.PublicNetworkAccess = publicNetworkAccess; + this.DataAccessAuthMode = dataAccessAuthMode; + this.OptimizedForFrequentAttach = optimizedForFrequentAttach; + this.AvailabilityPolicy = availabilityPolicy; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the Operating System type. Possible values include: 'Windows', 'Linux' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public OperatingSystemTypes? OsType {get; set; } + + /// + /// Gets or sets if creationData.createOption is Empty, this field is mandatory + /// and it indicates the size of the disk to create. If this field is present + /// for updates or creation with other options, it indicates a resize. Resizes + /// are only allowed if the disk is not attached to a running VM, and can only + /// increase the disk's size. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeGB")] + public int? DiskSizeGB {get; set; } + + /// + /// Gets or sets encryption settings collection used be Azure Disk Encryption, + /// can contain multiple encryption settings per disk or snapshot. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptionSettingsCollection")] + public EncryptionSettingsCollection EncryptionSettingsCollection {get; set; } + + /// + /// Gets or sets the number of IOPS allowed for this disk; only settable for + /// UltraSSD disks. One operation can transfer between 4k and 256k bytes. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskIOPSReadWrite")] + public long? DiskIOPSReadWrite {get; set; } + + /// + /// Gets or sets the bandwidth allowed for this disk; only settable for + /// UltraSSD disks. MBps means millions of bytes per second - MB here uses the + /// ISO notation, of powers of 10. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskMBpsReadWrite")] + public long? DiskMBpsReadWrite {get; set; } + + /// + /// Gets or sets the total number of IOPS that will be allowed across all VMs + /// mounting the shared disk as ReadOnly. One operation can transfer between 4k + /// and 256k bytes. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskIOPSReadOnly")] + public long? DiskIopsReadOnly {get; set; } + + /// + /// Gets or sets the total throughput (MBps) that will be allowed across all + /// VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per + /// second - MB here uses the ISO notation, of powers of 10. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskMBpsReadOnly")] + public long? DiskMBpsReadOnly {get; set; } + + /// + /// Gets or sets the maximum number of VMs that can attach to the disk at the + /// same time. Value greater than one indicates a disk that can be mounted on + /// multiple VMs at the same time. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "maxShares")] + public int? MaxShares {get; set; } + + /// + /// Gets or sets encryption property can be used to encrypt data at rest with + /// customer managed keys or platform managed keys. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encryption")] + public Encryption Encryption {get; set; } + + /// + /// Gets or sets policy for accessing the disk via network. Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkAccessPolicy")] + public string NetworkAccessPolicy {get; set; } + + /// + /// Gets or sets aRM id of the DiskAccess resource for using private endpoints + /// on disks. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskAccessId")] + public string DiskAccessId {get; set; } + + /// + /// Gets or sets performance tier of the disk (e.g, P4, S10) as described here: + /// https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not + /// apply to Ultra disks. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + public string Tier {get; set; } + + /// + /// Gets or sets set to true to enable bursting beyond the provisioned + /// performance target of the disk. Bursting is disabled by default. Does not + /// apply to Ultra disks. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "burstingEnabled")] + public bool? BurstingEnabled {get; set; } + + /// + /// Gets or sets purchase plan information to be added on the OS disk + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "purchasePlan")] + public PurchasePlan PurchasePlan {get; set; } + + /// + /// Gets or sets list of supported capabilities to be added on the OS disk. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "supportedCapabilities")] + public SupportedCapabilities SupportedCapabilities {get; set; } + + /// + /// Gets properties of the disk for which update is pending. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "propertyUpdatesInProgress")] + public PropertyUpdatesInProgress PropertyUpdatesInProgress {get; private set; } + + /// + /// Gets or sets indicates the OS on a disk supports hibernation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "supportsHibernation")] + public bool? SupportsHibernation {get; set; } + + /// + /// Gets or sets policy for controlling export on the disk. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicNetworkAccess")] + public string PublicNetworkAccess {get; set; } + + /// + /// Gets or sets additional authentication requirements when exporting or + /// uploading to a disk or snapshot. Possible values include: 'AzureActiveDirectory', 'None' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataAccessAuthMode")] + public string DataAccessAuthMode {get; set; } + + /// + /// Gets or sets setting this property to true improves reliability and + /// performance of data disks that are frequently (more than 5 times a day) by + /// detached from one virtual machine and attached to another. This property + /// should not be set for disks that are not detached and attached frequently + /// as it causes the disks to not align with the fault domain of the virtual + /// machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "optimizedForFrequentAttach")] + public bool? OptimizedForFrequentAttach {get; set; } + + /// + /// Gets or sets determines how platform treats disk failures + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "availabilityPolicy")] + public AvailabilityPolicy AvailabilityPolicy {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + if (this.EncryptionSettingsCollection != null) + { + this.EncryptionSettingsCollection.Validate(); + } + + + + + if (this.PurchasePlan != null) + { + this.PurchasePlan.Validate(); + } + + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/DomainNameLabelScopeTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/DomainNameLabelScopeTypes.cs index 44f9b71b0a4a..e9d79d4145c4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/DomainNameLabelScopeTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/DomainNameLabelScopeTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for DomainNameLabelScopeTypes. /// + + public static class DomainNameLabelScopeTypes { public const string TenantReuse = "TenantReuse"; @@ -21,4 +18,4 @@ public static class DomainNameLabelScopeTypes public const string ResourceGroupReuse = "ResourceGroupReuse"; public const string NoReuse = "NoReuse"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/EdgeZoneStorageAccountType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/EdgeZoneStorageAccountType.cs index 858983d3aa61..5ada8ef258ef 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/EdgeZoneStorageAccountType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/EdgeZoneStorageAccountType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for EdgeZoneStorageAccountType. /// + + public static class EdgeZoneStorageAccountType { public const string StandardLRS = "Standard_LRS"; @@ -21,4 +18,4 @@ public static class EdgeZoneStorageAccountType public const string StandardSSDLRS = "StandardSSD_LRS"; public const string PremiumLRS = "Premium_LRS"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Encryption.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Encryption.cs index 917358980174..3be843643f19 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Encryption.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/Encryption.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,16 +23,20 @@ public Encryption() /// /// Initializes a new instance of the Encryption class. /// - /// ResourceId of the disk encryption - /// set to use for enabling encryption at rest. - /// The type of key used to encrypt the data of the - /// disk. Possible values include: 'EncryptionAtRestWithPlatformKey', - /// 'EncryptionAtRestWithCustomerKey', - /// 'EncryptionAtRestWithPlatformAndCustomerKeys' + + /// ResourceId of the disk encryption set to use for enabling encryption at + /// rest. + /// + + /// The type of key used to encrypt the data of the disk. + /// Possible values include: 'EncryptionAtRestWithPlatformKey', + /// 'EncryptionAtRestWithCustomerKey', + /// 'EncryptionAtRestWithPlatformAndCustomerKeys' public Encryption(string diskEncryptionSetId = default(string), string type = default(string)) + { - DiskEncryptionSetId = diskEncryptionSetId; - Type = type; + this.DiskEncryptionSetId = diskEncryptionSetId; + this.Type = type; CustomInit(); } @@ -47,21 +45,18 @@ public Encryption() /// partial void CustomInit(); + /// - /// Gets or sets resourceId of the disk encryption set to use for - /// enabling encryption at rest. + /// Gets or sets resourceId of the disk encryption set to use for enabling + /// encryption at rest. /// - [JsonProperty(PropertyName = "diskEncryptionSetId")] - public string DiskEncryptionSetId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskEncryptionSetId")] + public string DiskEncryptionSetId {get; set; } /// - /// Gets or sets the type of key used to encrypt the data of the disk. - /// Possible values include: 'EncryptionAtRestWithPlatformKey', - /// 'EncryptionAtRestWithCustomerKey', - /// 'EncryptionAtRestWithPlatformAndCustomerKeys' + /// Gets or sets the type of key used to encrypt the data of the disk. Possible values include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey', 'EncryptionAtRestWithPlatformAndCustomerKeys' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionIdentity.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionIdentity.cs index 500f6c91afba..d8f8f59ece38 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionIdentity.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionIdentity.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Specifies the Managed Identity used by ADE to get access token for - /// keyvault operations. + /// Specifies the Managed Identity used by ADE to get access token for keyvault + /// operations. /// public partial class EncryptionIdentity { @@ -30,11 +24,14 @@ public EncryptionIdentity() /// /// Initializes a new instance of the EncryptionIdentity class. /// - /// Specifies ARM Resource - /// ID of one of the user identities associated with the VM. + + /// Specifies ARM Resource ID of one of the user identities associated with the + /// VM. + /// public EncryptionIdentity(string userAssignedIdentityResourceId = default(string)) + { - UserAssignedIdentityResourceId = userAssignedIdentityResourceId; + this.UserAssignedIdentityResourceId = userAssignedIdentityResourceId; CustomInit(); } @@ -43,12 +40,12 @@ public EncryptionIdentity() /// partial void CustomInit(); + /// - /// Gets or sets specifies ARM Resource ID of one of the user - /// identities associated with the VM. + /// Gets or sets specifies ARM Resource ID of one of the user identities + /// associated with the VM. /// - [JsonProperty(PropertyName = "userAssignedIdentityResourceId")] - public string UserAssignedIdentityResourceId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "userAssignedIdentityResourceId")] + public string UserAssignedIdentityResourceId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionImages.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionImages.cs index 41607dd6fb71..96f2c17f09ce 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionImages.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionImages.cs @@ -1,23 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Optional. Allows users to provide customer managed keys for encrypting - /// the OS and data disks in the gallery artifact. + /// Optional. Allows users to provide customer managed keys for encrypting the + /// OS and data disks in the gallery artifact. /// public partial class EncryptionImages { @@ -32,14 +24,17 @@ public EncryptionImages() /// /// Initializes a new instance of the EncryptionImages class. /// - /// Contains encryption settings for an OS - /// disk image. - /// A list of encryption specifications - /// for data disk images. - public EncryptionImages(OSDiskImageEncryption osDiskImage = default(OSDiskImageEncryption), IList dataDiskImages = default(IList)) + + /// Contains encryption settings for an OS disk image. + /// + + /// A list of encryption specifications for data disk images. + /// + public EncryptionImages(OSDiskImageEncryption osDiskImage = default(OSDiskImageEncryption), System.Collections.Generic.IList dataDiskImages = default(System.Collections.Generic.IList)) + { - OsDiskImage = osDiskImage; - DataDiskImages = dataDiskImages; + this.OsDiskImage = osDiskImage; + this.DataDiskImages = dataDiskImages; CustomInit(); } @@ -48,18 +43,17 @@ public EncryptionImages() /// partial void CustomInit(); + /// /// Gets or sets contains encryption settings for an OS disk image. /// - [JsonProperty(PropertyName = "osDiskImage")] - public OSDiskImageEncryption OsDiskImage { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osDiskImage")] + public OSDiskImageEncryption OsDiskImage {get; set; } /// - /// Gets or sets a list of encryption specifications for data disk - /// images. + /// Gets or sets a list of encryption specifications for data disk images. /// - [JsonProperty(PropertyName = "dataDiskImages")] - public IList DataDiskImages { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDiskImages")] + public System.Collections.Generic.IList DataDiskImages {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionProperties.cs index 88cb9382309a..b89b79b26304 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionProperties.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public EncryptionProperties() /// /// Initializes a new instance of the EncryptionProperties class. /// - /// Indicates whether or not the encryption is - /// enabled for container registry. Possible values include: 'enabled', - /// 'disabled' - /// Key vault properties. + + /// Indicates whether or not the encryption is enabled for container registry. + /// Possible values include: 'enabled', 'disabled' + + /// Key vault properties. + /// public EncryptionProperties(string status = default(string), KeyVaultProperties keyVaultProperties = default(KeyVaultProperties)) + { - Status = status; - KeyVaultProperties = keyVaultProperties; + this.Status = status; + this.KeyVaultProperties = keyVaultProperties; CustomInit(); } @@ -45,18 +42,18 @@ public EncryptionProperties() /// partial void CustomInit(); + /// /// Gets or sets indicates whether or not the encryption is enabled for - /// container registry. Possible values include: 'enabled', 'disabled' + /// container registry. Possible values include: 'enabled', 'disabled' /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// /// Gets or sets key vault properties. /// - [JsonProperty(PropertyName = "keyVaultProperties")] - public KeyVaultProperties KeyVaultProperties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionSetIdentity.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionSetIdentity.cs index a0dbd9f9dcae..189e205a9269 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionSetIdentity.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionSetIdentity.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,31 +24,37 @@ public EncryptionSetIdentity() /// /// Initializes a new instance of the EncryptionSetIdentity class. /// - /// The type of Managed Identity used by the - /// DiskEncryptionSet. Only SystemAssigned is supported for new - /// creations. Disk Encryption Sets can be updated with Identity type - /// None during migration of subscription to a new Azure Active - /// Directory tenant; it will cause the encrypted resources to lose - /// access to the keys. Possible values include: 'SystemAssigned', - /// 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' - /// The object id of the Managed Identity - /// Resource. This will be sent to the RP from ARM via the - /// x-ms-identity-principal-id header in the PUT request if the - /// resource has a systemAssigned(implicit) identity - /// The tenant id of the Managed Identity - /// Resource. This will be sent to the RP from ARM via the - /// x-ms-client-tenant-id header in the PUT request if the resource has - /// a systemAssigned(implicit) identity - /// The list of user identities - /// associated with the disk encryption set. The user identity - /// dictionary key references will be ARM resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - public EncryptionSetIdentity(string type = default(string), string principalId = default(string), string tenantId = default(string), IDictionary userAssignedIdentities = default(IDictionary)) + + /// The type of Managed Identity used by the DiskEncryptionSet. Only + /// SystemAssigned is supported for new creations. Disk Encryption Sets can be + /// updated with Identity type None during migration of subscription to a new + /// Azure Active Directory tenant; it will cause the encrypted resources to + /// lose access to the keys. + /// Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + /// UserAssigned', 'None' + + /// The object id of the Managed Identity Resource. This will be sent to the RP + /// from ARM via the x-ms-identity-principal-id header in the PUT request if + /// the resource has a systemAssigned(implicit) identity + /// + + /// The tenant id of the Managed Identity Resource. This will be sent to the RP + /// from ARM via the x-ms-client-tenant-id header in the PUT request if the + /// resource has a systemAssigned(implicit) identity + /// + + /// The list of user identities associated with the disk encryption set. The + /// user identity dictionary key references will be ARM resource ids in the + /// form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + public EncryptionSetIdentity(string type = default(string), string principalId = default(string), string tenantId = default(string), System.Collections.Generic.IDictionary userAssignedIdentities = default(System.Collections.Generic.IDictionary)) + { - Type = type; - PrincipalId = principalId; - TenantId = tenantId; - UserAssignedIdentities = userAssignedIdentities; + this.Type = type; + this.PrincipalId = principalId; + this.TenantId = tenantId; + this.UserAssignedIdentities = userAssignedIdentities; CustomInit(); } @@ -65,43 +63,40 @@ public EncryptionSetIdentity() /// partial void CustomInit(); + /// - /// Gets or sets the type of Managed Identity used by the - /// DiskEncryptionSet. Only SystemAssigned is supported for new - /// creations. Disk Encryption Sets can be updated with Identity type - /// None during migration of subscription to a new Azure Active - /// Directory tenant; it will cause the encrypted resources to lose - /// access to the keys. Possible values include: 'SystemAssigned', - /// 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + /// Gets or sets the type of Managed Identity used by the DiskEncryptionSet. + /// Only SystemAssigned is supported for new creations. Disk Encryption Sets + /// can be updated with Identity type None during migration of subscription to + /// a new Azure Active Directory tenant; it will cause the encrypted resources + /// to lose access to the keys. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// - /// Gets the object id of the Managed Identity Resource. This will be - /// sent to the RP from ARM via the x-ms-identity-principal-id header - /// in the PUT request if the resource has a systemAssigned(implicit) - /// identity + /// Gets the object id of the Managed Identity Resource. This will be sent to + /// the RP from ARM via the x-ms-identity-principal-id header in the PUT + /// request if the resource has a systemAssigned(implicit) identity /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; private set; } /// - /// Gets the tenant id of the Managed Identity Resource. This will be - /// sent to the RP from ARM via the x-ms-client-tenant-id header in the - /// PUT request if the resource has a systemAssigned(implicit) identity + /// Gets the tenant id of the Managed Identity Resource. This will be sent to + /// the RP from ARM via the x-ms-client-tenant-id header in the PUT request if + /// the resource has a systemAssigned(implicit) identity /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; private set; } /// /// Gets or sets the list of user identities associated with the disk - /// encryption set. The user identity dictionary key references will be - /// ARM resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// encryption set. The user identity dictionary key references will be ARM + /// resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. /// - [JsonProperty(PropertyName = "userAssignedIdentities")] - public IDictionary UserAssignedIdentities { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "userAssignedIdentities")] + public System.Collections.Generic.IDictionary UserAssignedIdentities {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionSetProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionSetProperties.cs new file mode 100644 index 000000000000..e78c8cc82e13 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionSetProperties.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + public partial class EncryptionSetProperties + { + /// + /// Initializes a new instance of the EncryptionSetProperties class. + /// + public EncryptionSetProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EncryptionSetProperties class. + /// + + /// The type of key used to encrypt the data of the disk. + /// Possible values include: 'EncryptionAtRestWithCustomerKey', + /// 'EncryptionAtRestWithPlatformAndCustomerKeys', + /// 'ConfidentialVmEncryptedWithCustomerKey' + + /// The key vault key which is currently used by this disk encryption set. + /// + + /// A readonly collection of key vault keys previously used by this disk + /// encryption set while a key rotation is in progress. It will be empty if + /// there is no ongoing key rotation. + /// + + /// The disk encryption set provisioning state. + /// + + /// Set this flag to true to enable auto-updating of this disk encryption set + /// to the latest key version. + /// + + /// The time when the active key of this disk encryption set was updated. + /// + + /// The error that was encountered during auto-key rotation. If an error is + /// present, then auto-key rotation will not be attempted until the error on + /// this disk encryption set is fixed. + /// + + /// Multi-tenant application client id to access key vault in a different + /// tenant. Setting the value to 'None' will clear the property. + /// + public EncryptionSetProperties(string encryptionType = default(string), KeyForDiskEncryptionSet activeKey = default(KeyForDiskEncryptionSet), System.Collections.Generic.IList previousKeys = default(System.Collections.Generic.IList), string provisioningState = default(string), bool? rotationToLatestKeyVersionEnabled = default(bool?), System.DateTime? lastKeyRotationTimestamp = default(System.DateTime?), ApiError autoKeyRotationError = default(ApiError), string federatedClientId = default(string)) + + { + this.EncryptionType = encryptionType; + this.ActiveKey = activeKey; + this.PreviousKeys = previousKeys; + this.ProvisioningState = provisioningState; + this.RotationToLatestKeyVersionEnabled = rotationToLatestKeyVersionEnabled; + this.LastKeyRotationTimestamp = lastKeyRotationTimestamp; + this.AutoKeyRotationError = autoKeyRotationError; + this.FederatedClientId = federatedClientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the type of key used to encrypt the data of the disk. Possible values include: 'EncryptionAtRestWithCustomerKey', 'EncryptionAtRestWithPlatformAndCustomerKeys', 'ConfidentialVmEncryptedWithCustomerKey' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptionType")] + public string EncryptionType {get; set; } + + /// + /// Gets or sets the key vault key which is currently used by this disk + /// encryption set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "activeKey")] + public KeyForDiskEncryptionSet ActiveKey {get; set; } + + /// + /// Gets a readonly collection of key vault keys previously used by this disk + /// encryption set while a key rotation is in progress. It will be empty if + /// there is no ongoing key rotation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "previousKeys")] + public System.Collections.Generic.IList PreviousKeys {get; private set; } + + /// + /// Gets the disk encryption set provisioning state. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets set this flag to true to enable auto-updating of this disk + /// encryption set to the latest key version. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "rotationToLatestKeyVersionEnabled")] + public bool? RotationToLatestKeyVersionEnabled {get; set; } + + /// + /// Gets the time when the active key of this disk encryption set was updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastKeyRotationTimestamp")] + public System.DateTime? LastKeyRotationTimestamp {get; private set; } + + /// + /// Gets the error that was encountered during auto-key rotation. If an error + /// is present, then auto-key rotation will not be attempted until the error on + /// this disk encryption set is fixed. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "autoKeyRotationError")] + public ApiError AutoKeyRotationError {get; private set; } + + /// + /// Gets or sets multi-tenant application client id to access key vault in a + /// different tenant. Setting the value to 'None' will clear the property. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "federatedClientId")] + public string FederatedClientId {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + if (this.ActiveKey != null) + { + this.ActiveKey.Validate(); + } + if (this.PreviousKeys != null) + { + foreach (var element in this.PreviousKeys) + { + if (element != null) + { + element.Validate(); + } + } + } + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionSettingsCollection.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionSettingsCollection.cs index 3e942e2731b7..d0cb8168e5b1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionSettingsCollection.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionSettingsCollection.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class EncryptionSettingsCollection { /// - /// Initializes a new instance of the EncryptionSettingsCollection - /// class. + /// Initializes a new instance of the EncryptionSettingsCollection class. /// public EncryptionSettingsCollection() { @@ -30,26 +21,29 @@ public EncryptionSettingsCollection() } /// - /// Initializes a new instance of the EncryptionSettingsCollection - /// class. + /// Initializes a new instance of the EncryptionSettingsCollection class. /// - /// Set this flag to true and provide - /// DiskEncryptionKey and optional KeyEncryptionKey to enable - /// encryption. Set this flag to false and remove DiskEncryptionKey and - /// KeyEncryptionKey to disable encryption. If EncryptionSettings is - /// null in the request object, the existing settings remain - /// unchanged. - /// A collection of encryption - /// settings, one for each disk volume. - /// Describes what type of - /// encryption is used for the disks. Once this field is set, it cannot - /// be overwritten. '1.0' corresponds to Azure Disk Encryption with AAD - /// app.'1.1' corresponds to Azure Disk Encryption. - public EncryptionSettingsCollection(bool enabled, IList encryptionSettings = default(IList), string encryptionSettingsVersion = default(string)) + + /// Set this flag to true and provide DiskEncryptionKey and optional + /// KeyEncryptionKey to enable encryption. Set this flag to false and remove + /// DiskEncryptionKey and KeyEncryptionKey to disable encryption. If + /// EncryptionSettings is null in the request object, the existing settings + /// remain unchanged. + /// + + /// A collection of encryption settings, one for each disk volume. + /// + + /// Describes what type of encryption is used for the disks. Once this field is + /// set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption + /// with AAD app.'1.1' corresponds to Azure Disk Encryption. + /// + public EncryptionSettingsCollection(bool enabled, System.Collections.Generic.IList encryptionSettings = default(System.Collections.Generic.IList), string encryptionSettingsVersion = default(string)) + { - Enabled = enabled; - EncryptionSettings = encryptionSettings; - EncryptionSettingsVersion = encryptionSettingsVersion; + this.Enabled = enabled; + this.EncryptionSettings = encryptionSettings; + this.EncryptionSettingsVersion = encryptionSettingsVersion; CustomInit(); } @@ -58,43 +52,41 @@ public EncryptionSettingsCollection() /// partial void CustomInit(); + /// - /// Gets or sets set this flag to true and provide DiskEncryptionKey - /// and optional KeyEncryptionKey to enable encryption. Set this flag - /// to false and remove DiskEncryptionKey and KeyEncryptionKey to - /// disable encryption. If EncryptionSettings is null in the request - /// object, the existing settings remain unchanged. + /// Gets or sets set this flag to true and provide DiskEncryptionKey and + /// optional KeyEncryptionKey to enable encryption. Set this flag to false and + /// remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If + /// EncryptionSettings is null in the request object, the existing settings + /// remain unchanged. /// - [JsonProperty(PropertyName = "enabled")] - public bool Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool Enabled {get; set; } /// - /// Gets or sets a collection of encryption settings, one for each disk - /// volume. + /// Gets or sets a collection of encryption settings, one for each disk volume. /// - [JsonProperty(PropertyName = "encryptionSettings")] - public IList EncryptionSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptionSettings")] + public System.Collections.Generic.IList EncryptionSettings {get; set; } /// - /// Gets or sets describes what type of encryption is used for the - /// disks. Once this field is set, it cannot be overwritten. '1.0' - /// corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds - /// to Azure Disk Encryption. + /// Gets or sets describes what type of encryption is used for the disks. Once + /// this field is set, it cannot be overwritten. '1.0' corresponds to Azure + /// Disk Encryption with AAD app.'1.1' corresponds to Azure Disk Encryption. /// - [JsonProperty(PropertyName = "encryptionSettingsVersion")] - public string EncryptionSettingsVersion { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptionSettingsVersion")] + public string EncryptionSettingsVersion {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (EncryptionSettings != null) + if (this.EncryptionSettings != null) { - foreach (var element in EncryptionSettings) + foreach (var element in this.EncryptionSettings) { if (element != null) { @@ -102,6 +94,7 @@ public virtual void Validate() } } } + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionSettingsElement.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionSettingsElement.cs index 074af2eb92f0..56ceda366ac8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionSettingsElement.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionSettingsElement.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,15 +23,18 @@ public EncryptionSettingsElement() /// /// Initializes a new instance of the EncryptionSettingsElement class. /// - /// Key Vault Secret Url and vault id - /// of the disk encryption key - /// Key Vault Key Url and vault id of - /// the key encryption key. KeyEncryptionKey is optional and when - /// provided is used to unwrap the disk encryption key. + + /// Key Vault Secret Url and vault id of the disk encryption key + /// + + /// Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey + /// is optional and when provided is used to unwrap the disk encryption key. + /// public EncryptionSettingsElement(KeyVaultAndSecretReference diskEncryptionKey = default(KeyVaultAndSecretReference), KeyVaultAndKeyReference keyEncryptionKey = default(KeyVaultAndKeyReference)) + { - DiskEncryptionKey = diskEncryptionKey; - KeyEncryptionKey = keyEncryptionKey; + this.DiskEncryptionKey = diskEncryptionKey; + this.KeyEncryptionKey = keyEncryptionKey; CustomInit(); } @@ -46,37 +43,36 @@ public EncryptionSettingsElement() /// partial void CustomInit(); + /// - /// Gets or sets key Vault Secret Url and vault id of the disk - /// encryption key + /// Gets or sets key Vault Secret Url and vault id of the disk encryption key /// - [JsonProperty(PropertyName = "diskEncryptionKey")] - public KeyVaultAndSecretReference DiskEncryptionKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskEncryptionKey")] + public KeyVaultAndSecretReference DiskEncryptionKey {get; set; } /// - /// Gets or sets key Vault Key Url and vault id of the key encryption - /// key. KeyEncryptionKey is optional and when provided is used to - /// unwrap the disk encryption key. + /// Gets or sets key Vault Key Url and vault id of the key encryption key. + /// KeyEncryptionKey is optional and when provided is used to unwrap the disk + /// encryption key. /// - [JsonProperty(PropertyName = "keyEncryptionKey")] - public KeyVaultAndKeyReference KeyEncryptionKey { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "keyEncryptionKey")] + public KeyVaultAndKeyReference KeyEncryptionKey {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (DiskEncryptionKey != null) + if (this.DiskEncryptionKey != null) { - DiskEncryptionKey.Validate(); + this.DiskEncryptionKey.Validate(); } - if (KeyEncryptionKey != null) + if (this.KeyEncryptionKey != null) { - KeyEncryptionKey.Validate(); + this.KeyEncryptionKey.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionStatus.cs index d29669e36742..fda19b97f1af 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for EncryptionStatus. /// + + public static class EncryptionStatus { public const string Enabled = "enabled"; public const string Disabled = "disabled"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionType.cs index fd806754ff4e..8277cff68d6a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/EncryptionType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,23 +9,25 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for EncryptionType. /// + + public static class EncryptionType { /// - /// Disk is encrypted at rest with Platform managed key. It is the - /// default encryption type. This is not a valid encryption type for - /// disk encryption sets. + /// Disk is encrypted at rest with Platform managed key. It is the default + /// encryption type. This is not a valid encryption type for disk encryption + /// sets. /// public const string EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey"; /// - /// Disk is encrypted at rest with Customer managed key that can be - /// changed and revoked by a customer. + /// Disk is encrypted at rest with Customer managed key that can be changed and + /// revoked by a customer. /// public const string EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey"; /// - /// Disk is encrypted at rest with 2 layers of encryption. One of the - /// keys is Customer managed and the other key is Platform managed. + /// Disk is encrypted at rest with 2 layers of encryption. One of the keys is + /// Customer managed and the other key is Platform managed. /// public const string EncryptionAtRestWithPlatformAndCustomerKeys = "EncryptionAtRestWithPlatformAndCustomerKeys"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/EndpointAccess.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/EndpointAccess.cs index 6f528df5b888..e8f7d45c3e33 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/EndpointAccess.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/EndpointAccess.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for EndpointAccess. /// + + public static class EndpointAccess { public const string Allow = "Allow"; public const string Deny = "Deny"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/EndpointTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/EndpointTypes.cs index 61dfa2c01f7b..29105dafbabe 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/EndpointTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/EndpointTypes.cs @@ -1,30 +1,23 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for EndpointTypes. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum EndpointTypes { - [EnumMember(Value = "WireServer")] + [System.Runtime.Serialization.EnumMember(Value = "WireServer")] WireServer, - [EnumMember(Value = "IMDS")] - IMDS + [System.Runtime.Serialization.EnumMember(Value = "IMDS")] + Imds } internal static class EndpointTypesEnumExtension { @@ -32,19 +25,17 @@ internal static string ToSerializedValue(this EndpointTypes? value) { return value == null ? null : ((EndpointTypes)value).ToSerializedValue(); } - internal static string ToSerializedValue(this EndpointTypes value) { switch( value ) { case EndpointTypes.WireServer: return "WireServer"; - case EndpointTypes.IMDS: + case EndpointTypes.Imds: return "IMDS"; } return null; } - internal static EndpointTypes? ParseEndpointTypes(this string value) { switch( value ) @@ -52,9 +43,9 @@ internal static string ToSerializedValue(this EndpointTypes value) case "WireServer": return EndpointTypes.WireServer; case "IMDS": - return EndpointTypes.IMDS; + return EndpointTypes.Imds; } return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs index acd677d64f04..1ce18e262c7a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public ErrorAdditionalInfo() /// /// Initializes a new instance of the ErrorAdditionalInfo class. /// - /// The additional info type. - /// The additional info. + + /// The additional info type. + /// + + /// The additional info. + /// public ErrorAdditionalInfo(string type = default(string), object info = default(object)) + { - Type = type; - Info = info; + this.Type = type; + this.Info = info; CustomInit(); } @@ -43,17 +42,17 @@ public ErrorAdditionalInfo() /// partial void CustomInit(); + /// /// Gets the additional info type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets the additional info. /// - [JsonProperty(PropertyName = "info")] - public object Info { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "info")] + public object Info {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ErrorDetail.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ErrorDetail.cs index 216ee7a0231c..19792f665d0b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ErrorDetail.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ErrorDetail.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,18 +23,29 @@ public ErrorDetail() /// /// Initializes a new instance of the ErrorDetail class. /// - /// The error code. - /// The error message. - /// The error target. - /// The error details. - /// The error additional info. - public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + + /// The error code. + /// + + /// The error message. + /// + + /// The error target. + /// + + /// The error details. + /// + + /// The error additional info. + /// + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList), System.Collections.Generic.IList additionalInfo = default(System.Collections.Generic.IList)) + { - Code = code; - Message = message; - Target = target; - Details = details; - AdditionalInfo = additionalInfo; + this.Code = code; + this.Message = message; + this.Target = target; + this.Details = details; + this.AdditionalInfo = additionalInfo; CustomInit(); } @@ -51,35 +54,35 @@ public ErrorDetail() /// partial void CustomInit(); + /// /// Gets the error code. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; private set; } /// /// Gets the error message. /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; private set; } /// /// Gets the error target. /// - [JsonProperty(PropertyName = "target")] - public string Target { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; private set; } /// /// Gets the error details. /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details {get; private set; } /// /// Gets the error additional info. /// - [JsonProperty(PropertyName = "additionalInfo")] - public IList AdditionalInfo { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalInfo")] + public System.Collections.Generic.IList AdditionalInfo {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ErrorResponse.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ErrorResponse.cs index 69e72efcf26c..beab0d82f835 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ErrorResponse.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ErrorResponse.cs @@ -1,25 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Error response + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). /// /// - /// Common error response for all Azure Resource Manager APIs to return - /// error details for failed operations. (This also follows the OData error - /// response format.). + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). /// public partial class ErrorResponse { @@ -34,10 +30,13 @@ public ErrorResponse() /// /// Initializes a new instance of the ErrorResponse class. /// - /// The error object. + + /// The error object. + /// public ErrorResponse(ErrorDetail error = default(ErrorDetail)) + { - Error = error; + this.Error = error; CustomInit(); } @@ -46,11 +45,11 @@ public ErrorResponse() /// partial void CustomInit(); + /// /// Gets or sets the error object. /// - [JsonProperty(PropertyName = "error")] - public ErrorDetail Error { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorDetail Error {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ErrorResponseException.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ErrorResponseException.cs index 5bc5eb0986b4..27180711addc 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ErrorResponseException.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ErrorResponseException.cs @@ -1,32 +1,25 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; /// - /// Exception thrown for an invalid response with ErrorResponse - /// information. + /// Exception thrown for an invalid response with ErrorResponse information. /// - public partial class ErrorResponseException : RestException + public partial class ErrorResponseException : Microsoft.Rest.RestException { /// /// Gets information about the associated HTTP request. /// - public HttpRequestMessageWrapper Request { get; set; } + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } /// /// Gets information about the associated HTTP response. /// - public HttpResponseMessageWrapper Response { get; set; } + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } /// /// Gets or sets the body object. @@ -41,7 +34,7 @@ public ErrorResponseException() } /// - /// Initializes a new instance of the ErrorResponseException class. + /// Initializes a new instance of the ErrorResponse class. /// /// The exception message. public ErrorResponseException(string message) @@ -50,7 +43,7 @@ public ErrorResponseException(string message) } /// - /// Initializes a new instance of the ErrorResponseException class. + /// Initializes a new instance of the ErrorResponse class. /// /// The exception message. /// Inner exception. @@ -59,4 +52,4 @@ public ErrorResponseException(string message, System.Exception innerException) { } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/EventGridAndResourceGraph.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/EventGridAndResourceGraph.cs index 23e5258057b9..09cf106ff354 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/EventGridAndResourceGraph.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/EventGridAndResourceGraph.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -30,15 +24,19 @@ public EventGridAndResourceGraph() /// /// Initializes a new instance of the EventGridAndResourceGraph class. /// - /// Specifies if event grid and resource graph is - /// enabled for Scheduled event related configurations. - /// Specifies the api-version - /// to determine which Scheduled Events configuration schema version - /// will be delivered. + + /// Specifies if event grid and resource graph is enabled for Scheduled event + /// related configurations. + /// + + /// Specifies the api-version to determine which Scheduled Events configuration + /// schema version will be delivered. + /// public EventGridAndResourceGraph(bool? enable = default(bool?), string scheduledEventsApiVersion = default(string)) + { - Enable = enable; - ScheduledEventsApiVersion = scheduledEventsApiVersion; + this.Enable = enable; + this.ScheduledEventsApiVersion = scheduledEventsApiVersion; CustomInit(); } @@ -47,19 +45,19 @@ public EventGridAndResourceGraph() /// partial void CustomInit(); + /// - /// Gets or sets specifies if event grid and resource graph is enabled - /// for Scheduled event related configurations. + /// Gets or sets specifies if event grid and resource graph is enabled for + /// Scheduled event related configurations. /// - [JsonProperty(PropertyName = "enable")] - public bool? Enable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enable")] + public bool? Enable {get; set; } /// - /// Gets or sets specifies the api-version to determine which Scheduled - /// Events configuration schema version will be delivered. + /// Gets or sets specifies the api-version to determine which Scheduled Events + /// configuration schema version will be delivered. /// - [JsonProperty(PropertyName = "scheduledEventsApiVersion")] - public string ScheduledEventsApiVersion { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "scheduledEventsApiVersion")] + public string ScheduledEventsApiVersion {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ExecutedValidation.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ExecutedValidation.cs index f2cd02d20c0c..8ed14bc468ba 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ExecutedValidation.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ExecutedValidation.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,21 +23,26 @@ public ExecutedValidation() /// /// Initializes a new instance of the ExecutedValidation class. /// - /// This property specifies the type of image - /// version validation. - /// This property specifies the status of the - /// validationProfile of the image version. Possible values include: - /// 'Unknown', 'Failed', 'Succeeded' - /// This property specifies the valid version of - /// the validation. - /// This property specifies the starting - /// timestamp. + + /// This property specifies the type of image version validation. + /// + + /// This property specifies the status of the validationProfile of the image + /// version. + /// Possible values include: 'Unknown', 'Failed', 'Succeeded' + + /// This property specifies the valid version of the validation. + /// + + /// This property specifies the starting timestamp. + /// public ExecutedValidation(string type = default(string), string status = default(string), string version = default(string), System.DateTime? executionTime = default(System.DateTime?)) + { - Type = type; - Status = status; - Version = version; - ExecutionTime = executionTime; + this.Type = type; + this.Status = status; + this.Version = version; + this.ExecutionTime = executionTime; CustomInit(); } @@ -52,33 +51,30 @@ public ExecutedValidation() /// partial void CustomInit(); + /// - /// Gets or sets this property specifies the type of image version - /// validation. + /// Gets or sets this property specifies the type of image version validation. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// - /// Gets or sets this property specifies the status of the - /// validationProfile of the image version. Possible values include: - /// 'Unknown', 'Failed', 'Succeeded' + /// Gets or sets this property specifies the status of the validationProfile of + /// the image version. Possible values include: 'Unknown', 'Failed', 'Succeeded' /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// - /// Gets or sets this property specifies the valid version of the - /// validation. + /// Gets or sets this property specifies the valid version of the validation. /// - [JsonProperty(PropertyName = "version")] - public string Version { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "version")] + public string Version {get; set; } /// /// Gets or sets this property specifies the starting timestamp. /// - [JsonProperty(PropertyName = "executionTime")] - public System.DateTime? ExecutionTime { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "executionTime")] + public System.DateTime? ExecutionTime {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ExecutionState.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ExecutionState.cs index ccc2a5c844a1..54877afc65f4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ExecutionState.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ExecutionState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ExecutionState. /// + + public static class ExecutionState { public const string Unknown = "Unknown"; @@ -24,4 +21,4 @@ public static class ExecutionState public const string TimedOut = "TimedOut"; public const string Canceled = "Canceled"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ExpandTypeForListVMs.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ExpandTypeForListVMs.cs index 775973900455..f46c288ad9df 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ExpandTypeForListVMs.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ExpandTypeForListVMs.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ExpandTypeForListVMs. /// + + public static class ExpandTypeForListVMs { public const string InstanceView = "instanceView"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ExpandTypesForGetCapacityReservationGroups.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ExpandTypesForGetCapacityReservationGroups.cs index 4bc38cee587a..7b7e09f39ae7 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ExpandTypesForGetCapacityReservationGroups.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ExpandTypesForGetCapacityReservationGroups.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ExpandTypesForGetCapacityReservationGroups. /// + + public static class ExpandTypesForGetCapacityReservationGroups { public const string VirtualMachineScaleSetVMsRef = "virtualMachineScaleSetVMs/$ref"; public const string VirtualMachinesRef = "virtualMachines/$ref"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ExpandTypesForGetVMScaleSets.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ExpandTypesForGetVMScaleSets.cs index c408275aa4b7..91df561f6e06 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ExpandTypesForGetVMScaleSets.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ExpandTypesForGetVMScaleSets.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ExpandTypesForGetVMScaleSets. /// + + public static class ExpandTypesForGetVMScaleSets { public const string UserData = "userData"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ExpandTypesForListVMs.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ExpandTypesForListVMs.cs index 965d910a75f5..ea1dc53384cb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ExpandTypesForListVMs.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ExpandTypesForListVMs.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ExpandTypesForListVMs. /// + + public static class ExpandTypesForListVMs { public const string InstanceView = "instanceView"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ExtendedLocation.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ExtendedLocation.cs index d1b9f2912802..ac1c4c12dad4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ExtendedLocation.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ExtendedLocation.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public ExtendedLocation() /// /// Initializes a new instance of the ExtendedLocation class. /// - /// The name of the extended location. - /// The type of the extended location. Possible - /// values include: 'EdgeZone' + + /// The name of the extended location. + /// + + /// The type of the extended location. + /// Possible values include: 'EdgeZone' public ExtendedLocation(string name = default(string), string type = default(string)) + { - Name = name; - Type = type; + this.Name = name; + this.Type = type; CustomInit(); } @@ -44,18 +42,17 @@ public ExtendedLocation() /// partial void CustomInit(); + /// /// Gets or sets the name of the extended location. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the type of the extended location. Possible values - /// include: 'EdgeZone' + /// Gets or sets the type of the extended location. Possible values include: 'EdgeZone' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ExtendedLocationType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ExtendedLocationType.cs index ea68e664029e..802c9a0c6f01 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ExtendedLocationType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ExtendedLocationType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ExtendedLocationType. /// + + public static class ExtendedLocationType { public const string EdgeZone = "EdgeZone"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/FileFormat.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/FileFormat.cs index c96720425ff3..0f690e45132b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/FileFormat.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/FileFormat.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,17 +9,17 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for FileFormat. /// + + public static class FileFormat { /// - /// A VHD file is a disk image file in the Virtual Hard Disk file - /// format. + /// A VHD file is a disk image file in the Virtual Hard Disk file format. /// public const string VHD = "VHD"; /// - /// A VHDX file is a disk image file in the Virtual Hard Disk v2 file - /// format. + /// A VHDX file is a disk image file in the Virtual Hard Disk v2 file format. /// - public const string VHDX = "VHDX"; + public const string Vhdx = "VHDX"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleriesCreateOrUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleriesCreateOrUpdateHeaders.cs index 609a99470153..35efaf66ef83 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleriesCreateOrUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleriesCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class GalleriesCreateOrUpdateHeaders { /// - /// Initializes a new instance of the GalleriesCreateOrUpdateHeaders - /// class. + /// Initializes a new instance of the GalleriesCreateOrUpdateHeaders class. /// public GalleriesCreateOrUpdateHeaders() { @@ -28,18 +18,19 @@ public GalleriesCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the GalleriesCreateOrUpdateHeaders - /// class. + /// Initializes a new instance of the GalleriesCreateOrUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public GalleriesCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public GalleriesCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleriesUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleriesUpdateHeaders.cs index a03191e3aaa3..66897dc1d81d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleriesUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleriesUpdateHeaders.cs @@ -1,21 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Update operation. - /// public partial class GalleriesUpdateHeaders { /// @@ -29,15 +20,17 @@ public GalleriesUpdateHeaders() /// /// Initializes a new instance of the GalleriesUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public GalleriesUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -46,19 +39,17 @@ public GalleriesUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Gallery.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Gallery.cs index d6cad93bcf05..9b5177d94b19 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Gallery.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/Gallery.cs @@ -1,28 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specifies information about the Shared Image Gallery that you want to /// create or update. /// - [Rest.Serialization.JsonTransformation] - public partial class Gallery : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class Gallery : TrackedResource { /// /// Initializes a new instance of the Gallery class. @@ -35,35 +25,55 @@ public Gallery() /// /// Initializes a new instance of the Gallery class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The description of this Shared Image - /// Gallery resource. This property is updatable. - /// Describes the gallery unique name. - /// The provisioning state, which only - /// appears in the response. Possible values include: 'Creating', - /// 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' - /// Profile for gallery sharing to - /// subscription or tenant - /// Contains information about the soft - /// deletion policy of the gallery. - /// Sharing status of current - /// gallery. - /// The identity of the gallery, if - /// configured. - public Gallery(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), GalleryIdentifier identifier = default(GalleryIdentifier), string provisioningState = default(string), SharingProfile sharingProfile = default(SharingProfile), SoftDeletePolicy softDeletePolicy = default(SoftDeletePolicy), SharingStatus sharingStatus = default(SharingStatus), GalleryIdentity identity = default(GalleryIdentity)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// The identity of the gallery, if configured. + /// + + /// Profile for gallery sharing to subscription or tenant + /// + + /// Sharing status of current gallery. + /// + + /// The description of this Shared Image Gallery resource. This property is + /// updatable. + /// + + /// Describes the gallery unique name. + /// + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' + + /// Contains information about the soft deletion policy of the gallery. + /// + public Gallery(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), GalleryIdentity identity = default(GalleryIdentity), SharingProfile sharingProfile = default(SharingProfile), SharingStatus sharingStatus = default(SharingStatus), string description = default(string), GalleryIdentifier identifier = default(GalleryIdentifier), string provisioningState = default(string), SoftDeletePolicy softDeletePolicy = default(SoftDeletePolicy)) + + : base(location, id, name, type, tags) { - Description = description; - Identifier = identifier; - ProvisioningState = provisioningState; - SharingProfile = sharingProfile; - SoftDeletePolicy = softDeletePolicy; - SharingStatus = sharingStatus; - Identity = identity; + this.Identity = identity; + this.SharingProfile = sharingProfile; + this.SharingStatus = sharingStatus; + this.Description = description; + this.Identifier = identifier; + this.ProvisioningState = provisioningState; + this.SoftDeletePolicy = softDeletePolicy; CustomInit(); } @@ -72,61 +82,66 @@ public Gallery() /// partial void CustomInit(); + /// - /// Gets or sets the description of this Shared Image Gallery resource. - /// This property is updatable. + /// Gets or sets the identity of the gallery, if configured. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public GalleryIdentity Identity {get; set; } /// - /// Gets or sets describes the gallery unique name. + /// Gets or sets profile for gallery sharing to subscription or tenant /// - [JsonProperty(PropertyName = "properties.identifier")] - public GalleryIdentifier Identifier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sharingProfile")] + public SharingProfile SharingProfile {get; set; } /// - /// Gets the provisioning state, which only appears in the response. - /// Possible values include: 'Creating', 'Updating', 'Failed', - /// 'Succeeded', 'Deleting', 'Migrating' + /// Gets sharing status of current gallery. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sharingStatus")] + public SharingStatus SharingStatus {get; private set; } /// - /// Gets or sets profile for gallery sharing to subscription or tenant + /// Gets or sets the description of this Shared Image Gallery resource. This + /// property is updatable. /// - [JsonProperty(PropertyName = "properties.sharingProfile")] - public SharingProfile SharingProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets contains information about the soft deletion policy of - /// the gallery. + /// Gets or sets describes the gallery unique name. /// - [JsonProperty(PropertyName = "properties.softDeletePolicy")] - public SoftDeletePolicy SoftDeletePolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.identifier")] + public GalleryIdentifier Identifier {get; set; } /// - /// Gets sharing status of current gallery. + /// Gets the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' /// - [JsonProperty(PropertyName = "properties.sharingStatus")] - public SharingStatus SharingStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the identity of the gallery, if configured. + /// Gets or sets contains information about the soft deletion policy of the + /// gallery. /// - [JsonProperty(PropertyName = "identity")] - public GalleryIdentity Identity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.softDeletePolicy")] + public SoftDeletePolicy SoftDeletePolicy {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplication.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplication.cs index 3e7c7552a57a..84aeeeef45db 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplication.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplication.cs @@ -1,28 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specifies information about the gallery Application Definition that you /// want to create or update. /// - [Rest.Serialization.JsonTransformation] - public partial class GalleryApplication : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class GalleryApplication : TrackedResource { /// /// Initializes a new instance of the GalleryApplication class. @@ -35,39 +25,57 @@ public GalleryApplication() /// /// Initializes a new instance of the GalleryApplication class. /// - /// Resource location - /// This property allows you to specify - /// the supported type of the OS that application is built for. - /// Possible values are: **Windows,** **Linux.**. Possible values - /// include: 'Windows', 'Linux' - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The description of this gallery - /// Application Definition resource. This property is - /// updatable. - /// The Eula agreement for the gallery Application - /// Definition. - /// The privacy statement - /// uri. - /// The release note uri. - /// The end of life date of the gallery - /// Application Definition. This property can be used for - /// decommissioning purposes. This property is updatable. - /// A list of custom actions that can be - /// performed with all of the Gallery Application Versions within this - /// Gallery Application. - public GalleryApplication(string location, OperatingSystemTypes supportedOSType, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), IList customActions = default(IList)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// The description of this gallery Application Definition resource. This + /// property is updatable. + /// + + /// The Eula agreement for the gallery Application Definition. + /// + + /// The privacy statement uri. + /// + + /// The release note uri. + /// + + /// The end of life date of the gallery Application Definition. This property + /// can be used for decommissioning purposes. This property is updatable. + /// + + /// This property allows you to specify the supported type of the OS that + /// application is built for. Possible values are: **Windows,** **Linux.** + /// Possible values include: 'Windows', 'Linux' + + /// A list of custom actions that can be performed with all of the Gallery + /// Application Versions within this Gallery Application. + /// + public GalleryApplication(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), OperatingSystemTypes? supportedOSType = default(OperatingSystemTypes?), System.Collections.Generic.IList customActions = default(System.Collections.Generic.IList)) + + : base(location, id, name, type, tags) { - Description = description; - Eula = eula; - PrivacyStatementUri = privacyStatementUri; - ReleaseNoteUri = releaseNoteUri; - EndOfLifeDate = endOfLifeDate; - SupportedOSType = supportedOSType; - CustomActions = customActions; + this.Description = description; + this.Eula = eula; + this.PrivacyStatementUri = privacyStatementUri; + this.ReleaseNoteUri = releaseNoteUri; + this.EndOfLifeDate = endOfLifeDate; + this.SupportedOSType = supportedOSType; + this.CustomActions = customActions; CustomInit(); } @@ -76,69 +84,71 @@ public GalleryApplication() /// partial void CustomInit(); + /// /// Gets or sets the description of this gallery Application Definition /// resource. This property is updatable. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets the Eula agreement for the gallery Application - /// Definition. + /// Gets or sets the Eula agreement for the gallery Application Definition. /// - [JsonProperty(PropertyName = "properties.eula")] - public string Eula { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.eula")] + public string Eula {get; set; } /// /// Gets or sets the privacy statement uri. /// - [JsonProperty(PropertyName = "properties.privacyStatementUri")] - public string PrivacyStatementUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privacyStatementUri")] + public string PrivacyStatementUri {get; set; } /// /// Gets or sets the release note uri. /// - [JsonProperty(PropertyName = "properties.releaseNoteUri")] - public string ReleaseNoteUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.releaseNoteUri")] + public string ReleaseNoteUri {get; set; } /// - /// Gets or sets the end of life date of the gallery Application - /// Definition. This property can be used for decommissioning purposes. - /// This property is updatable. + /// Gets or sets the end of life date of the gallery Application Definition. + /// This property can be used for decommissioning purposes. This property is + /// updatable. /// - [JsonProperty(PropertyName = "properties.endOfLifeDate")] - public System.DateTime? EndOfLifeDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.endOfLifeDate")] + public System.DateTime? EndOfLifeDate {get; set; } /// - /// Gets or sets this property allows you to specify the supported type - /// of the OS that application is built for. Possible values are: - /// **Windows,** **Linux.**. Possible values include: 'Windows', - /// 'Linux' + /// Gets or sets this property allows you to specify the supported type of the + /// OS that application is built for. Possible values are: **Windows,** + /// **Linux.** Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "properties.supportedOSType")] - public OperatingSystemTypes SupportedOSType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.supportedOSType")] + public OperatingSystemTypes? SupportedOSType {get; set; } /// - /// Gets or sets a list of custom actions that can be performed with - /// all of the Gallery Application Versions within this Gallery - /// Application. + /// Gets or sets a list of custom actions that can be performed with all of the + /// Gallery Application Versions within this Gallery Application. /// - [JsonProperty(PropertyName = "properties.customActions")] - public IList CustomActions { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customActions")] + public System.Collections.Generic.IList CustomActions {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (CustomActions != null) + + + + + + if (this.CustomActions != null) { - foreach (var element in CustomActions) + foreach (var element in this.CustomActions) { if (element != null) { @@ -148,4 +158,4 @@ public override void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationCustomAction.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationCustomAction.cs index a6178fc0c813..38f46b64b7bf 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationCustomAction.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationCustomAction.cs @@ -1,30 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// A custom action that can be performed with a Gallery Application - /// Version. + /// A custom action that can be performed with a Gallery Application Version. /// public partial class GalleryApplicationCustomAction { /// - /// Initializes a new instance of the GalleryApplicationCustomAction - /// class. + /// Initializes a new instance of the GalleryApplicationCustomAction class. /// public GalleryApplicationCustomAction() { @@ -32,23 +21,28 @@ public GalleryApplicationCustomAction() } /// - /// Initializes a new instance of the GalleryApplicationCustomAction - /// class. + /// Initializes a new instance of the GalleryApplicationCustomAction class. /// - /// The name of the custom action. Must be unique - /// within the Gallery Application Version. - /// The script to run when executing this custom - /// action. - /// Description to help the users understand - /// what this custom action does. - /// The parameters that this custom action - /// uses - public GalleryApplicationCustomAction(string name, string script, string description = default(string), IList parameters = default(IList)) + + /// The name of the custom action. Must be unique within the Gallery + /// Application Version. + /// + + /// The script to run when executing this custom action. + /// + + /// Description to help the users understand what this custom action does. + /// + + /// The parameters that this custom action uses + /// + public GalleryApplicationCustomAction(string name, string script, string description = default(string), System.Collections.Generic.IList parameters = default(System.Collections.Generic.IList)) + { - Name = name; - Script = script; - Description = description; - Parameters = parameters; + this.Name = name; + this.Script = script; + this.Description = description; + this.Parameters = parameters; CustomInit(); } @@ -57,51 +51,54 @@ public GalleryApplicationCustomAction() /// partial void CustomInit(); + /// - /// Gets or sets the name of the custom action. Must be unique within - /// the Gallery Application Version. + /// Gets or sets the name of the custom action. Must be unique within the + /// Gallery Application Version. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the script to run when executing this custom action. /// - [JsonProperty(PropertyName = "script")] - public string Script { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "script")] + public string Script {get; set; } /// - /// Gets or sets description to help the users understand what this - /// custom action does. + /// Gets or sets description to help the users understand what this custom + /// action does. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// /// Gets or sets the parameters that this custom action uses /// - [JsonProperty(PropertyName = "parameters")] - public IList Parameters { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "parameters")] + public System.Collections.Generic.IList Parameters {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (Script == null) + if (this.Script == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Script"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Script"); } - if (Parameters != null) + + + + if (this.Parameters != null) { - foreach (var element in Parameters) + foreach (var element in this.Parameters) { if (element != null) { @@ -111,4 +108,4 @@ public virtual void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationCustomActionParameter.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationCustomActionParameter.cs index d648b8b98969..9b296f04d79c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationCustomActionParameter.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationCustomActionParameter.cs @@ -1,28 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// - /// The definition of a parameter that can be passed to a custom action of - /// a Gallery Application Version. + /// The definition of a parameter that can be passed to a custom action of a + /// Gallery Application Version. /// public partial class GalleryApplicationCustomActionParameter { /// - /// Initializes a new instance of the - /// GalleryApplicationCustomActionParameter class. + /// Initializes a new instance of the GalleryApplicationCustomActionParameter class. /// public GalleryApplicationCustomActionParameter() { @@ -30,28 +22,34 @@ public GalleryApplicationCustomActionParameter() } /// - /// Initializes a new instance of the - /// GalleryApplicationCustomActionParameter class. + /// Initializes a new instance of the GalleryApplicationCustomActionParameter class. /// - /// The name of the custom action. Must be unique - /// within the Gallery Application Version. - /// Indicates whether this parameter must be - /// passed when running the custom action. - /// Specifies the type of the custom action - /// parameter. Possible values are: String, ConfigurationDataBlob or - /// LogOutputBlob. Possible values include: 'String', - /// 'ConfigurationDataBlob', 'LogOutputBlob' - /// The default value of the parameter. - /// Only applies to string types - /// A description to help users understand - /// what this parameter means + + /// The name of the custom action. Must be unique within the Gallery + /// Application Version. + /// + + /// Indicates whether this parameter must be passed when running the custom + /// action. + /// + + /// Specifies the type of the custom action parameter. Possible values are: + /// String, ConfigurationDataBlob or LogOutputBlob + /// Possible values include: 'String', 'ConfigurationDataBlob', 'LogOutputBlob' + + /// The default value of the parameter. Only applies to string types + /// + + /// A description to help users understand what this parameter means + /// public GalleryApplicationCustomActionParameter(string name, bool? required = default(bool?), GalleryApplicationCustomActionParameterType? type = default(GalleryApplicationCustomActionParameterType?), string defaultValue = default(string), string description = default(string)) + { - Name = name; - Required = required; - Type = type; - DefaultValue = defaultValue; - Description = description; + this.Name = name; + this.Required = required; + this.Type = type; + this.DefaultValue = defaultValue; + this.Description = description; CustomInit(); } @@ -60,55 +58,57 @@ public GalleryApplicationCustomActionParameter() /// partial void CustomInit(); + /// - /// Gets or sets the name of the custom action. Must be unique within - /// the Gallery Application Version. + /// Gets or sets the name of the custom action. Must be unique within the + /// Gallery Application Version. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets indicates whether this parameter must be passed when - /// running the custom action. + /// Gets or sets indicates whether this parameter must be passed when running + /// the custom action. /// - [JsonProperty(PropertyName = "required")] - public bool? Required { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "required")] + public bool? Required {get; set; } /// - /// Gets or sets specifies the type of the custom action parameter. - /// Possible values are: String, ConfigurationDataBlob or - /// LogOutputBlob. Possible values include: 'String', - /// 'ConfigurationDataBlob', 'LogOutputBlob' + /// Gets or sets specifies the type of the custom action parameter. Possible + /// values are: String, ConfigurationDataBlob or LogOutputBlob Possible values include: 'String', 'ConfigurationDataBlob', 'LogOutputBlob' /// - [JsonProperty(PropertyName = "type")] - public GalleryApplicationCustomActionParameterType? Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public GalleryApplicationCustomActionParameterType? Type {get; set; } /// - /// Gets or sets the default value of the parameter. Only applies to - /// string types + /// Gets or sets the default value of the parameter. Only applies to string + /// types /// - [JsonProperty(PropertyName = "defaultValue")] - public string DefaultValue { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultValue")] + public string DefaultValue {get; set; } /// - /// Gets or sets a description to help users understand what this - /// parameter means + /// Gets or sets a description to help users understand what this parameter + /// means /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationCustomActionParameterType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationCustomActionParameterType.cs index 0a63b3ebcddb..868c72a894ff 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationCustomActionParameterType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationCustomActionParameterType.cs @@ -1,31 +1,24 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for GalleryApplicationCustomActionParameterType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum GalleryApplicationCustomActionParameterType { - [EnumMember(Value = "String")] + [System.Runtime.Serialization.EnumMember(Value = "String")] String, - [EnumMember(Value = "ConfigurationDataBlob")] + [System.Runtime.Serialization.EnumMember(Value = "ConfigurationDataBlob")] ConfigurationDataBlob, - [EnumMember(Value = "LogOutputBlob")] + [System.Runtime.Serialization.EnumMember(Value = "LogOutputBlob")] LogOutputBlob } internal static class GalleryApplicationCustomActionParameterTypeEnumExtension @@ -34,7 +27,6 @@ internal static string ToSerializedValue(this GalleryApplicationCustomActionPara { return value == null ? null : ((GalleryApplicationCustomActionParameterType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this GalleryApplicationCustomActionParameterType value) { switch( value ) @@ -48,7 +40,6 @@ internal static string ToSerializedValue(this GalleryApplicationCustomActionPara } return null; } - internal static GalleryApplicationCustomActionParameterType? ParseGalleryApplicationCustomActionParameterType(this string value) { switch( value ) @@ -63,4 +54,4 @@ internal static string ToSerializedValue(this GalleryApplicationCustomActionPara return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationProperties.cs new file mode 100644 index 000000000000..6782dba5aa83 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationProperties.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a gallery Application Definition. + /// + public partial class GalleryApplicationProperties + { + /// + /// Initializes a new instance of the GalleryApplicationProperties class. + /// + public GalleryApplicationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GalleryApplicationProperties class. + /// + + /// The description of this gallery Application Definition resource. This + /// property is updatable. + /// + + /// The Eula agreement for the gallery Application Definition. + /// + + /// The privacy statement uri. + /// + + /// The release note uri. + /// + + /// The end of life date of the gallery Application Definition. This property + /// can be used for decommissioning purposes. This property is updatable. + /// + + /// This property allows you to specify the supported type of the OS that + /// application is built for. Possible values are: **Windows,** **Linux.** + /// Possible values include: 'Windows', 'Linux' + + /// A list of custom actions that can be performed with all of the Gallery + /// Application Versions within this Gallery Application. + /// + public GalleryApplicationProperties(OperatingSystemTypes supportedOSType, string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), System.Collections.Generic.IList customActions = default(System.Collections.Generic.IList)) + + { + this.Description = description; + this.Eula = eula; + this.PrivacyStatementUri = privacyStatementUri; + this.ReleaseNoteUri = releaseNoteUri; + this.EndOfLifeDate = endOfLifeDate; + this.SupportedOSType = supportedOSType; + this.CustomActions = customActions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the description of this gallery Application Definition + /// resource. This property is updatable. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets the Eula agreement for the gallery Application Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eula")] + public string Eula {get; set; } + + /// + /// Gets or sets the privacy statement uri. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privacyStatementUri")] + public string PrivacyStatementUri {get; set; } + + /// + /// Gets or sets the release note uri. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "releaseNoteUri")] + public string ReleaseNoteUri {get; set; } + + /// + /// Gets or sets the end of life date of the gallery Application Definition. + /// This property can be used for decommissioning purposes. This property is + /// updatable. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "endOfLifeDate")] + public System.DateTime? EndOfLifeDate {get; set; } + + /// + /// Gets or sets this property allows you to specify the supported type of the + /// OS that application is built for. Possible values are: **Windows,** + /// **Linux.** Possible values include: 'Windows', 'Linux' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "supportedOSType")] + public OperatingSystemTypes SupportedOSType {get; set; } + + /// + /// Gets or sets a list of custom actions that can be performed with all of the + /// Gallery Application Versions within this Gallery Application. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "customActions")] + public System.Collections.Generic.IList CustomActions {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + + if (this.CustomActions != null) + { + foreach (var element in this.CustomActions) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationScriptRebootBehavior.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationScriptRebootBehavior.cs index 667f51db5418..fe29ecf2383b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationScriptRebootBehavior.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationScriptRebootBehavior.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for GalleryApplicationScriptRebootBehavior. /// + + public static class GalleryApplicationScriptRebootBehavior { public const string None = "None"; public const string Rerun = "Rerun"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationUpdate.cs index 1a4cef255cec..5ff51990779d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationUpdate.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specifies information about the gallery Application Definition that you /// want to update. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class GalleryApplicationUpdate : UpdateResourceDefinition { /// @@ -35,38 +25,54 @@ public GalleryApplicationUpdate() /// /// Initializes a new instance of the GalleryApplicationUpdate class. /// - /// This property allows you to specify - /// the supported type of the OS that application is built for. - /// Possible values are: **Windows,** **Linux.**. Possible values - /// include: 'Windows', 'Linux' - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The description of this gallery - /// Application Definition resource. This property is - /// updatable. - /// The Eula agreement for the gallery Application - /// Definition. - /// The privacy statement - /// uri. - /// The release note uri. - /// The end of life date of the gallery - /// Application Definition. This property can be used for - /// decommissioning purposes. This property is updatable. - /// A list of custom actions that can be - /// performed with all of the Gallery Application Versions within this - /// Gallery Application. - public GalleryApplicationUpdate(OperatingSystemTypes supportedOSType, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), IList customActions = default(IList)) - : base(id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource tags + /// + + /// The description of this gallery Application Definition resource. This + /// property is updatable. + /// + + /// The Eula agreement for the gallery Application Definition. + /// + + /// The privacy statement uri. + /// + + /// The release note uri. + /// + + /// The end of life date of the gallery Application Definition. This property + /// can be used for decommissioning purposes. This property is updatable. + /// + + /// This property allows you to specify the supported type of the OS that + /// application is built for. Possible values are: **Windows,** **Linux.** + /// Possible values include: 'Windows', 'Linux' + + /// A list of custom actions that can be performed with all of the Gallery + /// Application Versions within this Gallery Application. + /// + public GalleryApplicationUpdate(string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), OperatingSystemTypes? supportedOSType = default(OperatingSystemTypes?), System.Collections.Generic.IList customActions = default(System.Collections.Generic.IList)) + + : base(id, name, type, tags) { - Description = description; - Eula = eula; - PrivacyStatementUri = privacyStatementUri; - ReleaseNoteUri = releaseNoteUri; - EndOfLifeDate = endOfLifeDate; - SupportedOSType = supportedOSType; - CustomActions = customActions; + this.Description = description; + this.Eula = eula; + this.PrivacyStatementUri = privacyStatementUri; + this.ReleaseNoteUri = releaseNoteUri; + this.EndOfLifeDate = endOfLifeDate; + this.SupportedOSType = supportedOSType; + this.CustomActions = customActions; CustomInit(); } @@ -75,75 +81,53 @@ public GalleryApplicationUpdate() /// partial void CustomInit(); + /// /// Gets or sets the description of this gallery Application Definition /// resource. This property is updatable. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets the Eula agreement for the gallery Application - /// Definition. + /// Gets or sets the Eula agreement for the gallery Application Definition. /// - [JsonProperty(PropertyName = "properties.eula")] - public string Eula { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.eula")] + public string Eula {get; set; } /// /// Gets or sets the privacy statement uri. /// - [JsonProperty(PropertyName = "properties.privacyStatementUri")] - public string PrivacyStatementUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privacyStatementUri")] + public string PrivacyStatementUri {get; set; } /// /// Gets or sets the release note uri. /// - [JsonProperty(PropertyName = "properties.releaseNoteUri")] - public string ReleaseNoteUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.releaseNoteUri")] + public string ReleaseNoteUri {get; set; } /// - /// Gets or sets the end of life date of the gallery Application - /// Definition. This property can be used for decommissioning purposes. - /// This property is updatable. + /// Gets or sets the end of life date of the gallery Application Definition. + /// This property can be used for decommissioning purposes. This property is + /// updatable. /// - [JsonProperty(PropertyName = "properties.endOfLifeDate")] - public System.DateTime? EndOfLifeDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.endOfLifeDate")] + public System.DateTime? EndOfLifeDate {get; set; } /// - /// Gets or sets this property allows you to specify the supported type - /// of the OS that application is built for. Possible values are: - /// **Windows,** **Linux.**. Possible values include: 'Windows', - /// 'Linux' + /// Gets or sets this property allows you to specify the supported type of the + /// OS that application is built for. Possible values are: **Windows,** + /// **Linux.** Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "properties.supportedOSType")] - public OperatingSystemTypes SupportedOSType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.supportedOSType")] + public OperatingSystemTypes? SupportedOSType {get; set; } /// - /// Gets or sets a list of custom actions that can be performed with - /// all of the Gallery Application Versions within this Gallery - /// Application. + /// Gets or sets a list of custom actions that can be performed with all of the + /// Gallery Application Versions within this Gallery Application. /// - [JsonProperty(PropertyName = "properties.customActions")] - public IList CustomActions { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (CustomActions != null) - { - foreach (var element in CustomActions) - { - if (element != null) - { - element.Validate(); - } - } - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customActions")] + public System.Collections.Generic.IList CustomActions {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersion.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersion.cs index 9d581e08eb19..da04d1ed4f42 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersion.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersion.cs @@ -1,28 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Specifies information about the gallery Application Version that you - /// want to create or update. + /// Specifies information about the gallery Application Version that you want + /// to create or update. /// - [Rest.Serialization.JsonTransformation] - public partial class GalleryApplicationVersion : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class GalleryApplicationVersion : TrackedResource { /// /// Initializes a new instance of the GalleryApplicationVersion class. @@ -35,27 +25,42 @@ public GalleryApplicationVersion() /// /// Initializes a new instance of the GalleryApplicationVersion class. /// - /// Resource location - /// The publishing profile of a gallery - /// image version. - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The safety profile of the Gallery - /// Application Version. - /// The provisioning state, which only - /// appears in the response. Possible values include: 'Creating', - /// 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' - /// This is the replication status of - /// the gallery image version. - public GalleryApplicationVersion(string location, GalleryApplicationVersionPublishingProfile publishingProfile, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), GalleryApplicationVersionSafetyProfile safetyProfile = default(GalleryApplicationVersionSafetyProfile), string provisioningState = default(string), ReplicationStatus replicationStatus = default(ReplicationStatus)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// This is the replication status of the gallery image version. + /// + + /// The publishing profile of a gallery image version. + /// + + /// The safety profile of the Gallery Application Version. + /// + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' + public GalleryApplicationVersion(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ReplicationStatus replicationStatus = default(ReplicationStatus), GalleryApplicationVersionPublishingProfile publishingProfile = default(GalleryApplicationVersionPublishingProfile), GalleryApplicationVersionSafetyProfile safetyProfile = default(GalleryApplicationVersionSafetyProfile), string provisioningState = default(string)) + + : base(location, id, name, type, tags) { - PublishingProfile = publishingProfile; - SafetyProfile = safetyProfile; - ProvisioningState = provisioningState; - ReplicationStatus = replicationStatus; + this.ReplicationStatus = replicationStatus; + this.PublishingProfile = publishingProfile; + this.SafetyProfile = safetyProfile; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -64,49 +69,46 @@ public GalleryApplicationVersion() /// partial void CustomInit(); + /// - /// Gets or sets the publishing profile of a gallery image version. + /// Gets this is the replication status of the gallery image version. /// - [JsonProperty(PropertyName = "properties.publishingProfile")] - public GalleryApplicationVersionPublishingProfile PublishingProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.replicationStatus")] + public ReplicationStatus ReplicationStatus {get; private set; } /// - /// Gets or sets the safety profile of the Gallery Application Version. + /// Gets or sets the publishing profile of a gallery image version. /// - [JsonProperty(PropertyName = "properties.safetyProfile")] - public GalleryApplicationVersionSafetyProfile SafetyProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publishingProfile")] + public GalleryApplicationVersionPublishingProfile PublishingProfile {get; set; } /// - /// Gets the provisioning state, which only appears in the response. - /// Possible values include: 'Creating', 'Updating', 'Failed', - /// 'Succeeded', 'Deleting', 'Migrating' + /// Gets or sets the safety profile of the Gallery Application Version. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.safetyProfile")] + public GalleryApplicationVersionSafetyProfile SafetyProfile {get; set; } /// - /// Gets this is the replication status of the gallery image version. + /// Gets the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' /// - [JsonProperty(PropertyName = "properties.replicationStatus")] - public ReplicationStatus ReplicationStatus { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (PublishingProfile == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "PublishingProfile"); - } - if (PublishingProfile != null) + + if (this.PublishingProfile != null) { - PublishingProfile.Validate(); + this.PublishingProfile.Validate(); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionProperties.cs new file mode 100644 index 000000000000..05419769dcd6 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionProperties.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a gallery image version. + /// + public partial class GalleryApplicationVersionProperties + { + /// + /// Initializes a new instance of the GalleryApplicationVersionProperties class. + /// + public GalleryApplicationVersionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GalleryApplicationVersionProperties class. + /// + + /// The publishing profile of a gallery image version. + /// + + /// The safety profile of the Gallery Application Version. + /// + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' + + /// This is the replication status of the gallery image version. + /// + public GalleryApplicationVersionProperties(GalleryApplicationVersionPublishingProfile publishingProfile, GalleryApplicationVersionSafetyProfile safetyProfile = default(GalleryApplicationVersionSafetyProfile), string provisioningState = default(string), ReplicationStatus replicationStatus = default(ReplicationStatus)) + + { + this.PublishingProfile = publishingProfile; + this.SafetyProfile = safetyProfile; + this.ProvisioningState = provisioningState; + this.ReplicationStatus = replicationStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the publishing profile of a gallery image version. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publishingProfile")] + public GalleryApplicationVersionPublishingProfile PublishingProfile {get; set; } + + /// + /// Gets or sets the safety profile of the Gallery Application Version. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "safetyProfile")] + public GalleryApplicationVersionSafetyProfile SafetyProfile {get; set; } + + /// + /// Gets the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets this is the replication status of the gallery image version. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "replicationStatus")] + public ReplicationStatus ReplicationStatus {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.PublishingProfile == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PublishingProfile"); + } + if (this.PublishingProfile != null) + { + this.PublishingProfile.Validate(); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionPublishingProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionPublishingProfile.cs index a5a47fed6eae..c977aeca58bb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionPublishingProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionPublishingProfile.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class GalleryApplicationVersionPublishingProfile : GalleryArtifactPublishingProfileBase { /// - /// Initializes a new instance of the - /// GalleryApplicationVersionPublishingProfile class. + /// Initializes a new instance of the GalleryApplicationVersionPublishingProfile class. /// public GalleryApplicationVersionPublishingProfile() { @@ -31,55 +21,72 @@ public GalleryApplicationVersionPublishingProfile() } /// - /// Initializes a new instance of the - /// GalleryApplicationVersionPublishingProfile class. + /// Initializes a new instance of the GalleryApplicationVersionPublishingProfile class. /// - /// The source image from which the Image Version - /// is going to be created. - /// The target regions where the Image - /// Version is going to be replicated to. This property is - /// updatable. - /// The number of replicas of the Image - /// Version to be created per region. This property would take effect - /// for a region when regionalReplicaCount is not specified. This - /// property is updatable. - /// If set to true, Virtual Machines - /// deployed from the latest version of the Image Definition won't use - /// this Image Version. - /// The timestamp for when the gallery - /// image version is published. - /// The end of life date of the gallery - /// image version. This property can be used for decommissioning - /// purposes. This property is updatable. - /// Specifies the storage account type - /// to be used to store the image. This property is not updatable. - /// Possible values include: 'Standard_LRS', 'Standard_ZRS', - /// 'Premium_LRS', 'PremiumV2_LRS' - /// Optional parameter which specifies - /// the mode to be used for replication. This property is not - /// updatable. Possible values include: 'Full', 'Shallow' - /// The target extended locations - /// where the Image Version is going to be replicated to. This property - /// is updatable. - /// Additional settings for the VM app that - /// contains the target package and config file name when it is - /// deployed to target VM or VM scale set. - /// Optional. Additional settings to - /// pass to the vm-application-manager extension. For advanced use - /// only. - /// Optional. Whether or not this - /// application reports health. - /// A list of custom actions that can be - /// performed with this Gallery Application Version. - public GalleryApplicationVersionPublishingProfile(UserArtifactSource source, IList targetRegions = default(IList), int? replicaCount = default(int?), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? endOfLifeDate = default(System.DateTime?), string storageAccountType = default(string), string replicationMode = default(string), IList targetExtendedLocations = default(IList), UserArtifactManage manageActions = default(UserArtifactManage), UserArtifactSettings settings = default(UserArtifactSettings), IDictionary advancedSettings = default(IDictionary), bool? enableHealthCheck = default(bool?), IList customActions = default(IList)) - : base(targetRegions, replicaCount, excludeFromLatest, publishedDate, endOfLifeDate, storageAccountType, replicationMode, targetExtendedLocations) + + /// The target regions where the Image Version is going to be replicated to. + /// This property is updatable. + /// + + /// The number of replicas of the Image Version to be created per region. This + /// property would take effect for a region when regionalReplicaCount is not + /// specified. This property is updatable. + /// + + /// If set to true, Virtual Machines deployed from the latest version of the + /// Image Definition won't use this Image Version. + /// + + /// The timestamp for when the gallery image version is published. + /// + + /// The end of life date of the gallery image version. This property can be + /// used for decommissioning purposes. This property is updatable. + /// + + /// Specifies the storage account type to be used to store the image. This + /// property is not updatable. + /// Possible values include: 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS', + /// 'PremiumV2_LRS' + + /// Optional parameter which specifies the mode to be used for replication. + /// This property is not updatable. + /// Possible values include: 'Full', 'Shallow' + + /// The target extended locations where the Image Version is going to be + /// replicated to. This property is updatable. + /// + + /// The source image from which the Image Version is going to be created. + /// + + /// + /// + + /// Additional settings for the VM app that contains the target package and + /// config file name when it is deployed to target VM or VM scale set. + /// + + /// Optional. Additional settings to pass to the vm-application-manager + /// extension. For advanced use only. + /// + + /// Optional. Whether or not this application reports health. + /// + + /// A list of custom actions that can be performed with this Gallery + /// Application Version. + /// + public GalleryApplicationVersionPublishingProfile(UserArtifactSource source, System.Collections.Generic.IList targetRegions = default(System.Collections.Generic.IList), int? replicaCount = default(int?), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? endOfLifeDate = default(System.DateTime?), string storageAccountType = default(string), string replicationMode = default(string), System.Collections.Generic.IList targetExtendedLocations = default(System.Collections.Generic.IList), UserArtifactManage manageActions = default(UserArtifactManage), UserArtifactSettings settings = default(UserArtifactSettings), System.Collections.Generic.IDictionary advancedSettings = default(System.Collections.Generic.IDictionary), bool? enableHealthCheck = default(bool?), System.Collections.Generic.IList customActions = default(System.Collections.Generic.IList)) + + : base(targetRegions, replicaCount, excludeFromLatest, publishedDate, endOfLifeDate, storageAccountType, replicationMode, targetExtendedLocations) { - Source = source; - ManageActions = manageActions; - Settings = settings; - AdvancedSettings = advancedSettings; - EnableHealthCheck = enableHealthCheck; - CustomActions = customActions; + this.Source = source; + this.ManageActions = manageActions; + this.Settings = settings; + this.AdvancedSettings = advancedSettings; + this.EnableHealthCheck = enableHealthCheck; + this.CustomActions = customActions; CustomInit(); } @@ -88,70 +95,72 @@ public GalleryApplicationVersionPublishingProfile() /// partial void CustomInit(); + /// - /// Gets or sets the source image from which the Image Version is going - /// to be created. + /// Gets or sets the source image from which the Image Version is going to be + /// created. /// - [JsonProperty(PropertyName = "source")] - public UserArtifactSource Source { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "source")] + public UserArtifactSource Source {get; set; } /// + /// Gets or sets /// - [JsonProperty(PropertyName = "manageActions")] - public UserArtifactManage ManageActions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "manageActions")] + public UserArtifactManage ManageActions {get; set; } /// - /// Gets or sets additional settings for the VM app that contains the - /// target package and config file name when it is deployed to target - /// VM or VM scale set. + /// Gets or sets additional settings for the VM app that contains the target + /// package and config file name when it is deployed to target VM or VM scale + /// set. /// - [JsonProperty(PropertyName = "settings")] - public UserArtifactSettings Settings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "settings")] + public UserArtifactSettings Settings {get; set; } /// /// Gets or sets optional. Additional settings to pass to the /// vm-application-manager extension. For advanced use only. /// - [JsonProperty(PropertyName = "advancedSettings")] - public IDictionary AdvancedSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "advancedSettings")] + public System.Collections.Generic.IDictionary AdvancedSettings {get; set; } /// - /// Gets or sets optional. Whether or not this application reports - /// health. + /// Gets or sets optional. Whether or not this application reports health. /// - [JsonProperty(PropertyName = "enableHealthCheck")] - public bool? EnableHealthCheck { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enableHealthCheck")] + public bool? EnableHealthCheck {get; set; } /// - /// Gets or sets a list of custom actions that can be performed with - /// this Gallery Application Version. + /// Gets or sets a list of custom actions that can be performed with this + /// Gallery Application Version. /// - [JsonProperty(PropertyName = "customActions")] - public IList CustomActions { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "customActions")] + public System.Collections.Generic.IList CustomActions {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Source == null) + if (this.Source == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Source"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Source"); } - if (Source != null) + if (this.Source != null) { - Source.Validate(); + this.Source.Validate(); } - if (ManageActions != null) + if (this.ManageActions != null) { - ManageActions.Validate(); + this.ManageActions.Validate(); } - if (CustomActions != null) + + + if (this.CustomActions != null) { - foreach (var element in CustomActions) + foreach (var element in this.CustomActions) { if (element != null) { @@ -161,4 +170,4 @@ public virtual void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionSafetyProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionSafetyProfile.cs index b9b05b5032cc..9069d98bf5c6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionSafetyProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionSafetyProfile.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -18,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class GalleryApplicationVersionSafetyProfile : GalleryArtifactSafetyProfileBase { /// - /// Initializes a new instance of the - /// GalleryApplicationVersionSafetyProfile class. + /// Initializes a new instance of the GalleryApplicationVersionSafetyProfile class. /// public GalleryApplicationVersionSafetyProfile() { @@ -27,14 +21,15 @@ public GalleryApplicationVersionSafetyProfile() } /// - /// Initializes a new instance of the - /// GalleryApplicationVersionSafetyProfile class. + /// Initializes a new instance of the GalleryApplicationVersionSafetyProfile class. /// - /// Indicates whether - /// or not removing this Gallery Image Version from replicated regions - /// is allowed. + + /// Indicates whether or not removing this Gallery Image Version from + /// replicated regions is allowed. + /// public GalleryApplicationVersionSafetyProfile(bool? allowDeletionOfReplicatedLocations = default(bool?)) - : base(allowDeletionOfReplicatedLocations) + + : base(allowDeletionOfReplicatedLocations) { CustomInit(); } @@ -45,4 +40,4 @@ public GalleryApplicationVersionSafetyProfile() partial void CustomInit(); } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionUpdate.cs index 5e20c71565d8..423e90a5df06 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionUpdate.cs @@ -1,32 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Specifies information about the gallery Application Version that you - /// want to update. + /// Specifies information about the gallery Application Version that you want + /// to update. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class GalleryApplicationVersionUpdate : UpdateResourceDefinition { /// - /// Initializes a new instance of the GalleryApplicationVersionUpdate - /// class. + /// Initializes a new instance of the GalleryApplicationVersionUpdate class. /// public GalleryApplicationVersionUpdate() { @@ -34,29 +23,41 @@ public GalleryApplicationVersionUpdate() } /// - /// Initializes a new instance of the GalleryApplicationVersionUpdate - /// class. + /// Initializes a new instance of the GalleryApplicationVersionUpdate class. /// - /// The publishing profile of a gallery - /// image version. - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The safety profile of the Gallery - /// Application Version. - /// The provisioning state, which only - /// appears in the response. Possible values include: 'Creating', - /// 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' - /// This is the replication status of - /// the gallery image version. - public GalleryApplicationVersionUpdate(GalleryApplicationVersionPublishingProfile publishingProfile, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), GalleryApplicationVersionSafetyProfile safetyProfile = default(GalleryApplicationVersionSafetyProfile), string provisioningState = default(string), ReplicationStatus replicationStatus = default(ReplicationStatus)) - : base(id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource tags + /// + + /// This is the replication status of the gallery image version. + /// + + /// The publishing profile of a gallery image version. + /// + + /// The safety profile of the Gallery Application Version. + /// + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' + public GalleryApplicationVersionUpdate(string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ReplicationStatus replicationStatus = default(ReplicationStatus), GalleryApplicationVersionPublishingProfile publishingProfile = default(GalleryApplicationVersionPublishingProfile), GalleryApplicationVersionSafetyProfile safetyProfile = default(GalleryApplicationVersionSafetyProfile), string provisioningState = default(string)) + + : base(id, name, type, tags) { - PublishingProfile = publishingProfile; - SafetyProfile = safetyProfile; - ProvisioningState = provisioningState; - ReplicationStatus = replicationStatus; + this.ReplicationStatus = replicationStatus; + this.PublishingProfile = publishingProfile; + this.SafetyProfile = safetyProfile; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -65,48 +66,45 @@ public GalleryApplicationVersionUpdate() /// partial void CustomInit(); + /// - /// Gets or sets the publishing profile of a gallery image version. + /// Gets this is the replication status of the gallery image version. /// - [JsonProperty(PropertyName = "properties.publishingProfile")] - public GalleryApplicationVersionPublishingProfile PublishingProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.replicationStatus")] + public ReplicationStatus ReplicationStatus {get; private set; } /// - /// Gets or sets the safety profile of the Gallery Application Version. + /// Gets or sets the publishing profile of a gallery image version. /// - [JsonProperty(PropertyName = "properties.safetyProfile")] - public GalleryApplicationVersionSafetyProfile SafetyProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publishingProfile")] + public GalleryApplicationVersionPublishingProfile PublishingProfile {get; set; } /// - /// Gets the provisioning state, which only appears in the response. - /// Possible values include: 'Creating', 'Updating', 'Failed', - /// 'Succeeded', 'Deleting', 'Migrating' + /// Gets or sets the safety profile of the Gallery Application Version. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.safetyProfile")] + public GalleryApplicationVersionSafetyProfile SafetyProfile {get; set; } /// - /// Gets this is the replication status of the gallery image version. + /// Gets the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' /// - [JsonProperty(PropertyName = "properties.replicationStatus")] - public ReplicationStatus ReplicationStatus { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (PublishingProfile == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "PublishingProfile"); - } - if (PublishingProfile != null) + + if (this.PublishingProfile != null) { - PublishingProfile.Validate(); + this.PublishingProfile.Validate(); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionsCreateOrUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionsCreateOrUpdateHeaders.cs index 07f17a7b8861..e366305b0e15 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionsCreateOrUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionsCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class GalleryApplicationVersionsCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// GalleryApplicationVersionsCreateOrUpdateHeaders class. + /// Initializes a new instance of the GalleryApplicationVersionsCreateOrUpdateHeaders class. /// public GalleryApplicationVersionsCreateOrUpdateHeaders() { @@ -28,18 +18,19 @@ public GalleryApplicationVersionsCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// GalleryApplicationVersionsCreateOrUpdateHeaders class. + /// Initializes a new instance of the GalleryApplicationVersionsCreateOrUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public GalleryApplicationVersionsCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public GalleryApplicationVersionsCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionsUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionsUpdateHeaders.cs index 8f5104248220..a9d29399b549 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionsUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationVersionsUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Update operation. - /// public partial class GalleryApplicationVersionsUpdateHeaders { /// - /// Initializes a new instance of the - /// GalleryApplicationVersionsUpdateHeaders class. + /// Initializes a new instance of the GalleryApplicationVersionsUpdateHeaders class. /// public GalleryApplicationVersionsUpdateHeaders() { @@ -28,18 +18,19 @@ public GalleryApplicationVersionsUpdateHeaders() } /// - /// Initializes a new instance of the - /// GalleryApplicationVersionsUpdateHeaders class. + /// Initializes a new instance of the GalleryApplicationVersionsUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public GalleryApplicationVersionsUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public GalleryApplicationVersionsUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationsCreateOrUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationsCreateOrUpdateHeaders.cs index e52c88b5825e..92429ec59aa4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationsCreateOrUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationsCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class GalleryApplicationsCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// GalleryApplicationsCreateOrUpdateHeaders class. + /// Initializes a new instance of the GalleryApplicationsCreateOrUpdateHeaders class. /// public GalleryApplicationsCreateOrUpdateHeaders() { @@ -28,18 +18,19 @@ public GalleryApplicationsCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// GalleryApplicationsCreateOrUpdateHeaders class. + /// Initializes a new instance of the GalleryApplicationsCreateOrUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public GalleryApplicationsCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public GalleryApplicationsCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationsUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationsUpdateHeaders.cs index 243b51ad11ee..3b0e7a0565f4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationsUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryApplicationsUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Update operation. - /// public partial class GalleryApplicationsUpdateHeaders { /// - /// Initializes a new instance of the GalleryApplicationsUpdateHeaders - /// class. + /// Initializes a new instance of the GalleryApplicationsUpdateHeaders class. /// public GalleryApplicationsUpdateHeaders() { @@ -28,18 +18,19 @@ public GalleryApplicationsUpdateHeaders() } /// - /// Initializes a new instance of the GalleryApplicationsUpdateHeaders - /// class. + /// Initializes a new instance of the GalleryApplicationsUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public GalleryApplicationsUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public GalleryApplicationsUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactPublishingProfileBase.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactPublishingProfileBase.cs index ccf200f27d37..6a87eb95cd9c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactPublishingProfileBase.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactPublishingProfileBase.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class GalleryArtifactPublishingProfileBase { /// - /// Initializes a new instance of the - /// GalleryArtifactPublishingProfileBase class. + /// Initializes a new instance of the GalleryArtifactPublishingProfileBase class. /// public GalleryArtifactPublishingProfileBase() { @@ -30,44 +21,52 @@ public GalleryArtifactPublishingProfileBase() } /// - /// Initializes a new instance of the - /// GalleryArtifactPublishingProfileBase class. + /// Initializes a new instance of the GalleryArtifactPublishingProfileBase class. /// - /// The target regions where the Image - /// Version is going to be replicated to. This property is - /// updatable. - /// The number of replicas of the Image - /// Version to be created per region. This property would take effect - /// for a region when regionalReplicaCount is not specified. This - /// property is updatable. - /// If set to true, Virtual Machines - /// deployed from the latest version of the Image Definition won't use - /// this Image Version. - /// The timestamp for when the gallery - /// image version is published. - /// The end of life date of the gallery - /// image version. This property can be used for decommissioning - /// purposes. This property is updatable. - /// Specifies the storage account type - /// to be used to store the image. This property is not updatable. - /// Possible values include: 'Standard_LRS', 'Standard_ZRS', - /// 'Premium_LRS', 'PremiumV2_LRS' - /// Optional parameter which specifies - /// the mode to be used for replication. This property is not - /// updatable. Possible values include: 'Full', 'Shallow' - /// The target extended locations - /// where the Image Version is going to be replicated to. This property - /// is updatable. - public GalleryArtifactPublishingProfileBase(IList targetRegions = default(IList), int? replicaCount = default(int?), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? endOfLifeDate = default(System.DateTime?), string storageAccountType = default(string), string replicationMode = default(string), IList targetExtendedLocations = default(IList)) + + /// The target regions where the Image Version is going to be replicated to. + /// This property is updatable. + /// + + /// The number of replicas of the Image Version to be created per region. This + /// property would take effect for a region when regionalReplicaCount is not + /// specified. This property is updatable. + /// + + /// If set to true, Virtual Machines deployed from the latest version of the + /// Image Definition won't use this Image Version. + /// + + /// The timestamp for when the gallery image version is published. + /// + + /// The end of life date of the gallery image version. This property can be + /// used for decommissioning purposes. This property is updatable. + /// + + /// Specifies the storage account type to be used to store the image. This + /// property is not updatable. + /// Possible values include: 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS', + /// 'PremiumV2_LRS' + + /// Optional parameter which specifies the mode to be used for replication. + /// This property is not updatable. + /// Possible values include: 'Full', 'Shallow' + + /// The target extended locations where the Image Version is going to be + /// replicated to. This property is updatable. + /// + public GalleryArtifactPublishingProfileBase(System.Collections.Generic.IList targetRegions = default(System.Collections.Generic.IList), int? replicaCount = default(int?), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? endOfLifeDate = default(System.DateTime?), string storageAccountType = default(string), string replicationMode = default(string), System.Collections.Generic.IList targetExtendedLocations = default(System.Collections.Generic.IList)) + { - TargetRegions = targetRegions; - ReplicaCount = replicaCount; - ExcludeFromLatest = excludeFromLatest; - PublishedDate = publishedDate; - EndOfLifeDate = endOfLifeDate; - StorageAccountType = storageAccountType; - ReplicationMode = replicationMode; - TargetExtendedLocations = targetExtendedLocations; + this.TargetRegions = targetRegions; + this.ReplicaCount = replicaCount; + this.ExcludeFromLatest = excludeFromLatest; + this.PublishedDate = publishedDate; + this.EndOfLifeDate = endOfLifeDate; + this.StorageAccountType = storageAccountType; + this.ReplicationMode = replicationMode; + this.TargetExtendedLocations = targetExtendedLocations; CustomInit(); } @@ -76,66 +75,62 @@ public GalleryArtifactPublishingProfileBase() /// partial void CustomInit(); + /// - /// Gets or sets the target regions where the Image Version is going to - /// be replicated to. This property is updatable. + /// Gets or sets the target regions where the Image Version is going to be + /// replicated to. This property is updatable. /// - [JsonProperty(PropertyName = "targetRegions")] - public IList TargetRegions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetRegions")] + public System.Collections.Generic.IList TargetRegions {get; set; } /// - /// Gets or sets the number of replicas of the Image Version to be - /// created per region. This property would take effect for a region - /// when regionalReplicaCount is not specified. This property is - /// updatable. + /// Gets or sets the number of replicas of the Image Version to be created per + /// region. This property would take effect for a region when + /// regionalReplicaCount is not specified. This property is updatable. /// - [JsonProperty(PropertyName = "replicaCount")] - public int? ReplicaCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "replicaCount")] + public int? ReplicaCount {get; set; } /// - /// Gets or sets if set to true, Virtual Machines deployed from the - /// latest version of the Image Definition won't use this Image - /// Version. + /// Gets or sets if set to true, Virtual Machines deployed from the latest + /// version of the Image Definition won't use this Image Version. /// - [JsonProperty(PropertyName = "excludeFromLatest")] - public bool? ExcludeFromLatest { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "excludeFromLatest")] + public bool? ExcludeFromLatest {get; set; } /// /// Gets the timestamp for when the gallery image version is published. /// - [JsonProperty(PropertyName = "publishedDate")] - public System.DateTime? PublishedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publishedDate")] + public System.DateTime? PublishedDate {get; private set; } /// - /// Gets or sets the end of life date of the gallery image version. - /// This property can be used for decommissioning purposes. This - /// property is updatable. + /// Gets or sets the end of life date of the gallery image version. This + /// property can be used for decommissioning purposes. This property is + /// updatable. /// - [JsonProperty(PropertyName = "endOfLifeDate")] - public System.DateTime? EndOfLifeDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "endOfLifeDate")] + public System.DateTime? EndOfLifeDate {get; set; } /// - /// Gets or sets specifies the storage account type to be used to store - /// the image. This property is not updatable. Possible values include: - /// 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS', 'PremiumV2_LRS' + /// Gets or sets specifies the storage account type to be used to store the + /// image. This property is not updatable. Possible values include: 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS', 'PremiumV2_LRS' /// - [JsonProperty(PropertyName = "storageAccountType")] - public string StorageAccountType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountType")] + public string StorageAccountType {get; set; } /// - /// Gets or sets optional parameter which specifies the mode to be used - /// for replication. This property is not updatable. Possible values - /// include: 'Full', 'Shallow' + /// Gets or sets optional parameter which specifies the mode to be used for + /// replication. This property is not updatable. Possible values include: 'Full', 'Shallow' /// - [JsonProperty(PropertyName = "replicationMode")] - public string ReplicationMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "replicationMode")] + public string ReplicationMode {get; set; } /// - /// Gets or sets the target extended locations where the Image Version - /// is going to be replicated to. This property is updatable. + /// Gets or sets the target extended locations where the Image Version is going + /// to be replicated to. This property is updatable. /// - [JsonProperty(PropertyName = "targetExtendedLocations")] - public IList TargetExtendedLocations { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "targetExtendedLocations")] + public System.Collections.Generic.IList TargetExtendedLocations {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactSafetyProfileBase.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactSafetyProfileBase.cs index 0a28b357a54c..607ca575f419 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactSafetyProfileBase.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactSafetyProfileBase.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class GalleryArtifactSafetyProfileBase { /// - /// Initializes a new instance of the GalleryArtifactSafetyProfileBase - /// class. + /// Initializes a new instance of the GalleryArtifactSafetyProfileBase class. /// public GalleryArtifactSafetyProfileBase() { @@ -28,15 +21,16 @@ public GalleryArtifactSafetyProfileBase() } /// - /// Initializes a new instance of the GalleryArtifactSafetyProfileBase - /// class. + /// Initializes a new instance of the GalleryArtifactSafetyProfileBase class. /// - /// Indicates whether - /// or not removing this Gallery Image Version from replicated regions - /// is allowed. + + /// Indicates whether or not removing this Gallery Image Version from + /// replicated regions is allowed. + /// public GalleryArtifactSafetyProfileBase(bool? allowDeletionOfReplicatedLocations = default(bool?)) + { - AllowDeletionOfReplicatedLocations = allowDeletionOfReplicatedLocations; + this.AllowDeletionOfReplicatedLocations = allowDeletionOfReplicatedLocations; CustomInit(); } @@ -45,12 +39,12 @@ public GalleryArtifactSafetyProfileBase() /// partial void CustomInit(); + /// - /// Gets or sets indicates whether or not removing this Gallery Image - /// Version from replicated regions is allowed. + /// Gets or sets indicates whether or not removing this Gallery Image Version + /// from replicated regions is allowed. /// - [JsonProperty(PropertyName = "allowDeletionOfReplicatedLocations")] - public bool? AllowDeletionOfReplicatedLocations { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "allowDeletionOfReplicatedLocations")] + public bool? AllowDeletionOfReplicatedLocations {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactVersionFullSource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactVersionFullSource.cs index b2169d907f7e..805543250c14 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactVersionFullSource.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactVersionFullSource.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class GalleryArtifactVersionFullSource : GalleryArtifactVersionSource { /// - /// Initializes a new instance of the GalleryArtifactVersionFullSource - /// class. + /// Initializes a new instance of the GalleryArtifactVersionFullSource class. /// public GalleryArtifactVersionFullSource() { @@ -28,22 +21,25 @@ public GalleryArtifactVersionFullSource() } /// - /// Initializes a new instance of the GalleryArtifactVersionFullSource - /// class. + /// Initializes a new instance of the GalleryArtifactVersionFullSource class. /// - /// The id of the gallery artifact version - /// source. - /// The resource Id of the source - /// Community Gallery Image. Only required when using Community - /// Gallery Image as a source. - /// The resource Id of the source - /// virtual machine. Only required when capturing a virtual machine to - /// source this Gallery Image Version. + + /// The id of the gallery artifact version source. + /// + + /// The resource Id of the source Community Gallery Image. Only required when + /// using Community Gallery Image as a source. + /// + + /// The resource Id of the source virtual machine. Only required when + /// capturing a virtual machine to source this Gallery Image Version. + /// public GalleryArtifactVersionFullSource(string id = default(string), string communityGalleryImageId = default(string), string virtualMachineId = default(string)) - : base(id) + + : base(id) { - CommunityGalleryImageId = communityGalleryImageId; - VirtualMachineId = virtualMachineId; + this.CommunityGalleryImageId = communityGalleryImageId; + this.VirtualMachineId = virtualMachineId; CustomInit(); } @@ -52,20 +48,19 @@ public GalleryArtifactVersionFullSource() /// partial void CustomInit(); + /// - /// Gets or sets the resource Id of the source Community Gallery Image. - /// Only required when using Community Gallery Image as a source. + /// Gets or sets the resource Id of the source Community Gallery Image. Only + /// required when using Community Gallery Image as a source. /// - [JsonProperty(PropertyName = "communityGalleryImageId")] - public string CommunityGalleryImageId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "communityGalleryImageId")] + public string CommunityGalleryImageId {get; set; } /// - /// Gets or sets the resource Id of the source virtual machine. Only - /// required when capturing a virtual machine to source this Gallery - /// Image Version. + /// Gets or sets the resource Id of the source virtual machine. Only required + /// when capturing a virtual machine to source this Gallery Image Version. /// - [JsonProperty(PropertyName = "virtualMachineId")] - public string VirtualMachineId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachineId")] + public string VirtualMachineId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactVersionSource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactVersionSource.cs index 331d49524e38..d5e12d64d335 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactVersionSource.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryArtifactVersionSource.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class GalleryArtifactVersionSource { /// - /// Initializes a new instance of the GalleryArtifactVersionSource - /// class. + /// Initializes a new instance of the GalleryArtifactVersionSource class. /// public GalleryArtifactVersionSource() { @@ -28,14 +21,15 @@ public GalleryArtifactVersionSource() } /// - /// Initializes a new instance of the GalleryArtifactVersionSource - /// class. + /// Initializes a new instance of the GalleryArtifactVersionSource class. /// - /// The id of the gallery artifact version - /// source. + + /// The id of the gallery artifact version source. + /// public GalleryArtifactVersionSource(string id = default(string)) + { - Id = id; + this.Id = id; CustomInit(); } @@ -44,11 +38,11 @@ public GalleryArtifactVersionSource() /// partial void CustomInit(); + /// /// Gets or sets the id of the gallery artifact version source. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryDataDiskImage.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryDataDiskImage.cs index d86d4df26422..f532b8c2d061 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryDataDiskImage.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryDataDiskImage.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,20 +23,27 @@ public GalleryDataDiskImage() /// /// Initializes a new instance of the GalleryDataDiskImage class. /// - /// This property specifies the logical unit number - /// of the data disk. This value is used to identify data disks within - /// the Virtual Machine and therefore must be unique for each data disk - /// attached to the Virtual Machine. - /// This property indicates the size of the VHD - /// to be created. - /// The host caching of the disk. Valid - /// values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values - /// include: 'None', 'ReadOnly', 'ReadWrite' - /// The source for the disk image. - public GalleryDataDiskImage(int lun, int? sizeInGB = default(int?), HostCaching? hostCaching = default(HostCaching?), GalleryDiskImageSource source = default(GalleryDiskImageSource)) - : base(sizeInGB, hostCaching, source) + + /// This property indicates the size of the VHD to be created. + /// + + /// The host caching of the disk. Valid values are 'None', 'ReadOnly', and + /// 'ReadWrite' + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + + /// The source for the disk image. + /// + + /// This property specifies the logical unit number of the data disk. This + /// value is used to identify data disks within the Virtual Machine and + /// therefore must be unique for each data disk attached to the Virtual + /// Machine. + /// + public GalleryDataDiskImage(int lun, int? sizeInGb = default(int?), HostCaching? hostCaching = default(HostCaching?), GalleryDiskImageSource source = default(GalleryDiskImageSource)) + + : base(sizeInGb, hostCaching, source) { - Lun = lun; + this.Lun = lun; CustomInit(); } @@ -51,19 +52,19 @@ public GalleryDataDiskImage() /// partial void CustomInit(); + /// - /// Gets or sets this property specifies the logical unit number of the - /// data disk. This value is used to identify data disks within the - /// Virtual Machine and therefore must be unique for each data disk - /// attached to the Virtual Machine. + /// Gets or sets this property specifies the logical unit number of the data + /// disk. This value is used to identify data disks within the Virtual Machine + /// and therefore must be unique for each data disk attached to the Virtual + /// Machine. /// - [JsonProperty(PropertyName = "lun")] - public int Lun { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "lun")] + public int Lun {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() @@ -71,4 +72,4 @@ public virtual void Validate() //Nothing to validate } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryDiskImage.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryDiskImage.cs index 14053bcd607a..246cfc885405 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryDiskImage.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryDiskImage.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,22 @@ public GalleryDiskImage() /// /// Initializes a new instance of the GalleryDiskImage class. /// - /// This property indicates the size of the VHD - /// to be created. - /// The host caching of the disk. Valid - /// values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values - /// include: 'None', 'ReadOnly', 'ReadWrite' - /// The source for the disk image. - public GalleryDiskImage(int? sizeInGB = default(int?), HostCaching? hostCaching = default(HostCaching?), GalleryDiskImageSource source = default(GalleryDiskImageSource)) + + /// This property indicates the size of the VHD to be created. + /// + + /// The host caching of the disk. Valid values are 'None', 'ReadOnly', and + /// 'ReadWrite' + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + + /// The source for the disk image. + /// + public GalleryDiskImage(int? sizeInGb = default(int?), HostCaching? hostCaching = default(HostCaching?), GalleryDiskImageSource source = default(GalleryDiskImageSource)) + { - SizeInGB = sizeInGB; - HostCaching = hostCaching; - Source = source; + this.SizeInGB = sizeInGb; + this.HostCaching = hostCaching; + this.Source = source; CustomInit(); } @@ -48,25 +47,24 @@ public GalleryDiskImage() /// partial void CustomInit(); + /// /// Gets this property indicates the size of the VHD to be created. /// - [JsonProperty(PropertyName = "sizeInGB")] - public int? SizeInGB { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sizeInGB")] + public int? SizeInGB {get; private set; } /// - /// Gets or sets the host caching of the disk. Valid values are 'None', - /// 'ReadOnly', and 'ReadWrite'. Possible values include: 'None', - /// 'ReadOnly', 'ReadWrite' + /// Gets or sets the host caching of the disk. Valid values are 'None', + /// 'ReadOnly', and 'ReadWrite' Possible values include: 'None', 'ReadOnly', 'ReadWrite' /// - [JsonProperty(PropertyName = "hostCaching")] - public HostCaching? HostCaching { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "hostCaching")] + public HostCaching? HostCaching {get; set; } /// /// Gets or sets the source for the disk image. /// - [JsonProperty(PropertyName = "source")] - public GalleryDiskImageSource Source { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "source")] + public GalleryDiskImageSource Source {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryDiskImageSource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryDiskImageSource.cs index 694565c24605..8d6140aba48f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryDiskImageSource.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryDiskImageSource.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,18 +23,23 @@ public GalleryDiskImageSource() /// /// Initializes a new instance of the GalleryDiskImageSource class. /// - /// The id of the gallery artifact version - /// source. - /// The uri of the gallery artifact version source. - /// Currently used to specify vhd/blob source. - /// The Storage Account Id that contains - /// the vhd blob being used as a source for this artifact - /// version. + + /// The id of the gallery artifact version source. + /// + + /// The uri of the gallery artifact version source. Currently used to specify + /// vhd/blob source. + /// + + /// The Storage Account Id that contains the vhd blob being used as a source + /// for this artifact version. + /// public GalleryDiskImageSource(string id = default(string), string uri = default(string), string storageAccountId = default(string)) - : base(id) + + : base(id) { - Uri = uri; - StorageAccountId = storageAccountId; + this.Uri = uri; + this.StorageAccountId = storageAccountId; CustomInit(); } @@ -49,19 +48,19 @@ public GalleryDiskImageSource() /// partial void CustomInit(); + /// - /// Gets or sets the uri of the gallery artifact version source. - /// Currently used to specify vhd/blob source. + /// Gets or sets the uri of the gallery artifact version source. Currently used + /// to specify vhd/blob source. /// - [JsonProperty(PropertyName = "uri")] - public string Uri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "uri")] + public string Uri {get; set; } /// - /// Gets or sets the Storage Account Id that contains the vhd blob - /// being used as a source for this artifact version. + /// Gets or sets the Storage Account Id that contains the vhd blob being used + /// as a source for this artifact version. /// - [JsonProperty(PropertyName = "storageAccountId")] - public string StorageAccountId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountId")] + public string StorageAccountId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryExpandParams.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryExpandParams.cs index 4ac1f1ff5567..eff6ec85ac3f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryExpandParams.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryExpandParams.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for GalleryExpandParams. /// + + public static class GalleryExpandParams { public const string SharingProfileGroups = "SharingProfile/Groups"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryExtendedLocation.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryExtendedLocation.cs index faf6c4511f2b..e2f3a100bb7b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryExtendedLocation.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryExtendedLocation.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public GalleryExtendedLocation() /// /// Initializes a new instance of the GalleryExtendedLocation class. /// - /// It is type of the extended location. Possible - /// values include: 'EdgeZone', 'Unknown' + + /// + /// + + /// It is type of the extended location. + /// Possible values include: 'EdgeZone', 'Unknown' public GalleryExtendedLocation(string name = default(string), string type = default(string)) + { - Name = name; - Type = type; + this.Name = name; + this.Type = type; CustomInit(); } @@ -43,17 +42,17 @@ public GalleryExtendedLocation() /// partial void CustomInit(); + /// + /// Gets or sets /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets it is type of the extended location. Possible values - /// include: 'EdgeZone', 'Unknown' + /// Gets or sets it is type of the extended location. Possible values include: 'EdgeZone', 'Unknown' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryExtendedLocationType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryExtendedLocationType.cs index 1a1e331bff8a..e83b2e20ad23 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryExtendedLocationType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryExtendedLocationType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for GalleryExtendedLocationType. /// + + public static class GalleryExtendedLocationType { public const string EdgeZone = "EdgeZone"; public const string Unknown = "Unknown"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryIdentifier.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryIdentifier.cs index 37791d8d2e02..284d3dc90716 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryIdentifier.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryIdentifier.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,14 @@ public GalleryIdentifier() /// /// Initializes a new instance of the GalleryIdentifier class. /// - /// The unique name of the Shared Image - /// Gallery. This name is generated automatically by Azure. + + /// The unique name of the Shared Image Gallery. This name is generated + /// automatically by Azure. + /// public GalleryIdentifier(string uniqueName = default(string)) + { - UniqueName = uniqueName; + this.UniqueName = uniqueName; CustomInit(); } @@ -42,12 +39,12 @@ public GalleryIdentifier() /// partial void CustomInit(); + /// - /// Gets the unique name of the Shared Image Gallery. This name is - /// generated automatically by Azure. + /// Gets the unique name of the Shared Image Gallery. This name is generated + /// automatically by Azure. /// - [JsonProperty(PropertyName = "uniqueName")] - public string UniqueName { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueName")] + public string UniqueName {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryIdentity.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryIdentity.cs index 4e8a274ce67c..4acb58bd60c6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryIdentity.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryIdentity.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,28 +23,33 @@ public GalleryIdentity() /// /// Initializes a new instance of the GalleryIdentity class. /// - /// The principal id of the gallery identity. - /// This property will only be provided for a system assigned - /// identity. - /// The AAD tenant id of the gallery identity. - /// This property will only be provided for a system assigned - /// identity. - /// The type of identity used for the gallery. The - /// type 'SystemAssigned, UserAssigned' includes both an implicitly - /// created identity and a set of user assigned identities. The type - /// 'None' will remove all identities from the gallery. Possible values - /// include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, - /// UserAssigned', 'None' - /// The list of user identities - /// associated with the gallery. The user identity dictionary key - /// references will be ARM resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - public GalleryIdentity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?), IDictionary userAssignedIdentities = default(IDictionary)) + + /// The principal id of the gallery identity. This property will only be + /// provided for a system assigned identity. + /// + + /// The AAD tenant id of the gallery identity. This property will only be + /// provided for a system assigned identity. + /// + + /// The type of identity used for the gallery. The type 'SystemAssigned, + /// UserAssigned' includes both an implicitly created identity and a set of + /// user assigned identities. The type 'None' will remove all identities from + /// the gallery. + /// Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + /// UserAssigned', 'None' + + /// The list of user identities associated with the gallery. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + public GalleryIdentity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?), System.Collections.Generic.IDictionary userAssignedIdentities = default(System.Collections.Generic.IDictionary)) + { - PrincipalId = principalId; - TenantId = tenantId; - Type = type; - UserAssignedIdentities = userAssignedIdentities; + this.PrincipalId = principalId; + this.TenantId = tenantId; + this.Type = type; + this.UserAssignedIdentities = userAssignedIdentities; CustomInit(); } @@ -61,39 +58,37 @@ public GalleryIdentity() /// partial void CustomInit(); + /// - /// Gets the principal id of the gallery identity. This property will - /// only be provided for a system assigned identity. + /// Gets the principal id of the gallery identity. This property will only be + /// provided for a system assigned identity. /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; private set; } /// - /// Gets the AAD tenant id of the gallery identity. This property will - /// only be provided for a system assigned identity. + /// Gets the AAD tenant id of the gallery identity. This property will only be + /// provided for a system assigned identity. /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; private set; } /// /// Gets or sets the type of identity used for the gallery. The type - /// 'SystemAssigned, UserAssigned' includes both an implicitly created - /// identity and a set of user assigned identities. The type 'None' - /// will remove all identities from the gallery. Possible values - /// include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, - /// UserAssigned', 'None' + /// 'SystemAssigned, UserAssigned' includes both an implicitly created identity + /// and a set of user assigned identities. The type 'None' will remove all + /// identities from the gallery. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' /// - [JsonProperty(PropertyName = "type")] - public ResourceIdentityType? Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public ResourceIdentityType? Type {get; set; } /// - /// Gets or sets the list of user identities associated with the - /// gallery. The user identity dictionary key references will be ARM - /// resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// Gets or sets the list of user identities associated with the gallery. The + /// user identity dictionary key references will be ARM resource ids in the + /// form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. /// - [JsonProperty(PropertyName = "userAssignedIdentities")] - public IDictionary UserAssignedIdentities { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "userAssignedIdentities")] + public System.Collections.Generic.IDictionary UserAssignedIdentities {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImage.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImage.cs index ee80108619fb..001c008e80f4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImage.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImage.cs @@ -1,28 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Specifies information about the gallery image definition that you want - /// to create or update. + /// Specifies information about the gallery image definition that you want to + /// create or update. /// - [Rest.Serialization.JsonTransformation] - public partial class GalleryImage : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class GalleryImage : TrackedResource { /// /// Initializes a new instance of the GalleryImage class. @@ -35,69 +25,99 @@ public GalleryImage() /// /// Initializes a new instance of the GalleryImage class. /// - /// Resource location - /// This property allows you to specify the type - /// of the OS that is included in the disk when creating a VM from a - /// managed image. Possible values are: **Windows,** **Linux.**. - /// Possible values include: 'Windows', 'Linux' - /// This property allows the user to specify - /// whether the virtual machines created under this image are - /// 'Generalized' or 'Specialized'. Possible values include: - /// 'Generalized', 'Specialized' - /// This is the gallery image definition - /// identifier. - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The description of this gallery image - /// definition resource. This property is updatable. - /// The Eula agreement for the gallery image - /// definition. - /// The privacy statement - /// uri. - /// The release note uri. - /// The hypervisor generation of the - /// Virtual Machine. Applicable to OS disks only. Possible values - /// include: 'V1', 'V2' - /// The end of life date of the gallery - /// image definition. This property can be used for decommissioning - /// purposes. This property is updatable. - /// The properties describe the recommended - /// machine configuration for this Image Definition. These properties - /// are updatable. - /// Describes the disallowed disk - /// types. - /// Describes the gallery image definition - /// purchase plan. This is used by marketplace images. - /// The provisioning state, which only - /// appears in the response. Possible values include: 'Creating', - /// 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' - /// A list of gallery image features. - /// The architecture of the image. - /// Applicable to OS disks only. Possible values include: 'x64', - /// 'Arm64' - /// Optional. Must be set to true if the - /// gallery image features are being updated. - public GalleryImage(string location, OperatingSystemTypes osType, OperatingSystemStateTypes osState, GalleryImageIdentifier identifier, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), string hyperVGeneration = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string provisioningState = default(string), IList features = default(IList), string architecture = default(string), bool? allowUpdateImage = default(bool?)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// Describes the disallowed disk types. + /// + + /// The architecture of the image. Applicable to OS disks only. + /// Possible values include: 'x64', 'Arm64' + + /// The description of this gallery image definition resource. This property is + /// updatable. + /// + + /// The Eula agreement for the gallery image definition. + /// + + /// The privacy statement uri. + /// + + /// The release note uri. + /// + + /// This property allows you to specify the type of the OS that is included in + /// the disk when creating a VM from a managed image. Possible values are: + /// **Windows,** **Linux.** + /// Possible values include: 'Windows', 'Linux' + + /// This property allows the user to specify whether the virtual machines + /// created under this image are 'Generalized' or 'Specialized'. + /// Possible values include: 'Generalized', 'Specialized' + + /// The hypervisor generation of the Virtual Machine. Applicable to OS disks + /// only. + /// Possible values include: 'V1', 'V2' + + /// The end of life date of the gallery image definition. This property can be + /// used for decommissioning purposes. This property is updatable. + /// + + /// This is the gallery image definition identifier. + /// + + /// The properties describe the recommended machine configuration for this + /// Image Definition. These properties are updatable. + /// + + /// Describes the gallery image definition purchase plan. This is used by + /// marketplace images. + /// + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' + + /// A list of gallery image features. + /// + + /// Optional. Must be set to true if the gallery image features are being + /// updated. + /// + public GalleryImage(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), Disallowed disallowed = default(Disallowed), string architecture = default(string), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), OperatingSystemTypes? osType = default(OperatingSystemTypes?), OperatingSystemStateTypes? osState = default(OperatingSystemStateTypes?), string hyperVGeneration = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), GalleryImageIdentifier identifier = default(GalleryImageIdentifier), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string provisioningState = default(string), System.Collections.Generic.IList features = default(System.Collections.Generic.IList), bool? allowUpdateImage = default(bool?)) + + : base(location, id, name, type, tags) { - Description = description; - Eula = eula; - PrivacyStatementUri = privacyStatementUri; - ReleaseNoteUri = releaseNoteUri; - OsType = osType; - OsState = osState; - HyperVGeneration = hyperVGeneration; - EndOfLifeDate = endOfLifeDate; - Identifier = identifier; - Recommended = recommended; - Disallowed = disallowed; - PurchasePlan = purchasePlan; - ProvisioningState = provisioningState; - Features = features; - Architecture = architecture; - AllowUpdateImage = allowUpdateImage; + this.Disallowed = disallowed; + this.Architecture = architecture; + this.Description = description; + this.Eula = eula; + this.PrivacyStatementUri = privacyStatementUri; + this.ReleaseNoteUri = releaseNoteUri; + this.OsType = osType; + this.OsState = osState; + this.HyperVGeneration = hyperVGeneration; + this.EndOfLifeDate = endOfLifeDate; + this.Identifier = identifier; + this.Recommended = recommended; + this.PurchasePlan = purchasePlan; + this.ProvisioningState = provisioningState; + this.Features = features; + this.AllowUpdateImage = allowUpdateImage; CustomInit(); } @@ -106,136 +126,138 @@ public GalleryImage() /// partial void CustomInit(); + /// - /// Gets or sets the description of this gallery image definition - /// resource. This property is updatable. + /// Gets or sets describes the disallowed disk types. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disallowed")] + public Disallowed Disallowed {get; set; } /// - /// Gets or sets the Eula agreement for the gallery image definition. + /// Gets or sets the architecture of the image. Applicable to OS disks only. Possible values include: 'x64', 'Arm64' /// - [JsonProperty(PropertyName = "properties.eula")] - public string Eula { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.architecture")] + public string Architecture {get; set; } /// - /// Gets or sets the privacy statement uri. + /// Gets or sets the description of this gallery image definition resource. + /// This property is updatable. /// - [JsonProperty(PropertyName = "properties.privacyStatementUri")] - public string PrivacyStatementUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets the release note uri. + /// Gets or sets the Eula agreement for the gallery image definition. /// - [JsonProperty(PropertyName = "properties.releaseNoteUri")] - public string ReleaseNoteUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.eula")] + public string Eula {get; set; } /// - /// Gets or sets this property allows you to specify the type of the OS - /// that is included in the disk when creating a VM from a managed - /// image. Possible values are: **Windows,** **Linux.**. Possible - /// values include: 'Windows', 'Linux' + /// Gets or sets the privacy statement uri. /// - [JsonProperty(PropertyName = "properties.osType")] - public OperatingSystemTypes OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privacyStatementUri")] + public string PrivacyStatementUri {get; set; } /// - /// Gets or sets this property allows the user to specify whether the - /// virtual machines created under this image are 'Generalized' or - /// 'Specialized'. Possible values include: 'Generalized', - /// 'Specialized' + /// Gets or sets the release note uri. /// - [JsonProperty(PropertyName = "properties.osState")] - public OperatingSystemStateTypes OsState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.releaseNoteUri")] + public string ReleaseNoteUri {get; set; } /// - /// Gets or sets the hypervisor generation of the Virtual Machine. - /// Applicable to OS disks only. Possible values include: 'V1', 'V2' + /// Gets or sets this property allows you to specify the type of the OS that is + /// included in the disk when creating a VM from a managed image. Possible + /// values are: **Windows,** **Linux.** Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "properties.hyperVGeneration")] - public string HyperVGeneration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osType")] + public OperatingSystemTypes? OsType {get; set; } /// - /// Gets or sets the end of life date of the gallery image definition. - /// This property can be used for decommissioning purposes. This - /// property is updatable. + /// Gets or sets this property allows the user to specify whether the virtual + /// machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'Generalized', 'Specialized' /// - [JsonProperty(PropertyName = "properties.endOfLifeDate")] - public System.DateTime? EndOfLifeDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osState")] + public OperatingSystemStateTypes? OsState {get; set; } /// - /// Gets or sets this is the gallery image definition identifier. + /// Gets or sets the hypervisor generation of the Virtual Machine. Applicable + /// to OS disks only. Possible values include: 'V1', 'V2' /// - [JsonProperty(PropertyName = "properties.identifier")] - public GalleryImageIdentifier Identifier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hyperVGeneration")] + public string HyperVGeneration {get; set; } /// - /// Gets or sets the properties describe the recommended machine - /// configuration for this Image Definition. These properties are + /// Gets or sets the end of life date of the gallery image definition. This + /// property can be used for decommissioning purposes. This property is /// updatable. /// - [JsonProperty(PropertyName = "properties.recommended")] - public RecommendedMachineConfiguration Recommended { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.endOfLifeDate")] + public System.DateTime? EndOfLifeDate {get; set; } /// - /// Gets or sets describes the disallowed disk types. + /// Gets or sets this is the gallery image definition identifier. /// - [JsonProperty(PropertyName = "properties.disallowed")] - public Disallowed Disallowed { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.identifier")] + public GalleryImageIdentifier Identifier {get; set; } /// - /// Gets or sets describes the gallery image definition purchase plan. - /// This is used by marketplace images. + /// Gets or sets the properties describe the recommended machine configuration + /// for this Image Definition. These properties are updatable. /// - [JsonProperty(PropertyName = "properties.purchasePlan")] - public ImagePurchasePlan PurchasePlan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.recommended")] + public RecommendedMachineConfiguration Recommended {get; set; } /// - /// Gets the provisioning state, which only appears in the response. - /// Possible values include: 'Creating', 'Updating', 'Failed', - /// 'Succeeded', 'Deleting', 'Migrating' + /// Gets or sets describes the gallery image definition purchase plan. This is + /// used by marketplace images. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.purchasePlan")] + public ImagePurchasePlan PurchasePlan {get; set; } /// - /// Gets or sets a list of gallery image features. + /// Gets the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' /// - [JsonProperty(PropertyName = "properties.features")] - public IList Features { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the architecture of the image. Applicable to OS disks - /// only. Possible values include: 'x64', 'Arm64' + /// Gets or sets a list of gallery image features. /// - [JsonProperty(PropertyName = "properties.architecture")] - public string Architecture { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.features")] + public System.Collections.Generic.IList Features {get; set; } /// - /// Gets or sets optional. Must be set to true if the gallery image - /// features are being updated. + /// Gets or sets optional. Must be set to true if the gallery image features + /// are being updated. /// - [JsonProperty(PropertyName = "properties.allowUpdateImage")] - public bool? AllowUpdateImage { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowUpdateImage")] + public bool? AllowUpdateImage {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (Identifier == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Identifier"); - } - if (Identifier != null) + + + + + + + + + + if (this.Identifier != null) { - Identifier.Validate(); + this.Identifier.Validate(); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageFeature.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageFeature.cs index f1f011aa24f5..667f71addf9e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageFeature.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageFeature.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,15 +23,21 @@ public GalleryImageFeature() /// /// Initializes a new instance of the GalleryImageFeature class. /// - /// The name of the gallery image feature. - /// The value of the gallery image feature. - /// The minimum gallery image version - /// which supports this feature. + + /// The name of the gallery image feature. + /// + + /// The value of the gallery image feature. + /// + + /// The minimum gallery image version which supports this feature. + /// public GalleryImageFeature(string name = default(string), string value = default(string), string startsAtVersion = default(string)) + { - Name = name; - Value = value; - StartsAtVersion = startsAtVersion; + this.Name = name; + this.Value = value; + this.StartsAtVersion = startsAtVersion; CustomInit(); } @@ -46,24 +46,23 @@ public GalleryImageFeature() /// partial void CustomInit(); + /// /// Gets or sets the name of the gallery image feature. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the value of the gallery image feature. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } /// - /// Gets or sets the minimum gallery image version which supports this - /// feature. + /// Gets or sets the minimum gallery image version which supports this feature. /// - [JsonProperty(PropertyName = "startsAtVersion")] - public string StartsAtVersion { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "startsAtVersion")] + public string StartsAtVersion {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageIdentifier.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageIdentifier.cs index 5f3835b6879f..a74bbc21cfba 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageIdentifier.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageIdentifier.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,17 +23,21 @@ public GalleryImageIdentifier() /// /// Initializes a new instance of the GalleryImageIdentifier class. /// - /// The name of the gallery image definition - /// publisher. - /// The name of the gallery image definition - /// offer. - /// The name of the gallery image definition - /// SKU. + + /// The name of the gallery image definition publisher. + /// + + /// The name of the gallery image definition offer. + /// + + /// The name of the gallery image definition SKU. + /// public GalleryImageIdentifier(string publisher, string offer, string sku) + { - Publisher = publisher; - Offer = offer; - Sku = sku; + this.Publisher = publisher; + this.Offer = offer; + this.Sku = sku; CustomInit(); } @@ -49,44 +46,47 @@ public GalleryImageIdentifier(string publisher, string offer, string sku) /// partial void CustomInit(); + /// /// Gets or sets the name of the gallery image definition publisher. /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publisher")] + public string Publisher {get; set; } /// /// Gets or sets the name of the gallery image definition offer. /// - [JsonProperty(PropertyName = "offer")] - public string Offer { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "offer")] + public string Offer {get; set; } /// /// Gets or sets the name of the gallery image definition SKU. /// - [JsonProperty(PropertyName = "sku")] - public string Sku { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public string Sku {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Publisher == null) + if (this.Publisher == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Publisher"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Publisher"); } - if (Offer == null) + if (this.Offer == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Offer"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Offer"); } - if (Sku == null) + if (this.Sku == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Sku"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Sku"); } + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageProperties.cs new file mode 100644 index 000000000000..89f0e0985e6c --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageProperties.cs @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a gallery image definition. + /// + public partial class GalleryImageProperties + { + /// + /// Initializes a new instance of the GalleryImageProperties class. + /// + public GalleryImageProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GalleryImageProperties class. + /// + + /// The description of this gallery image definition resource. This property is + /// updatable. + /// + + /// The Eula agreement for the gallery image definition. + /// + + /// The privacy statement uri. + /// + + /// The release note uri. + /// + + /// This property allows you to specify the type of the OS that is included in + /// the disk when creating a VM from a managed image. Possible values are: + /// **Windows,** **Linux.** + /// Possible values include: 'Windows', 'Linux' + + /// This property allows the user to specify whether the virtual machines + /// created under this image are 'Generalized' or 'Specialized'. + /// Possible values include: 'Generalized', 'Specialized' + + /// The hypervisor generation of the Virtual Machine. Applicable to OS disks + /// only. + /// Possible values include: 'V1', 'V2' + + /// The end of life date of the gallery image definition. This property can be + /// used for decommissioning purposes. This property is updatable. + /// + + /// This is the gallery image definition identifier. + /// + + /// The properties describe the recommended machine configuration for this + /// Image Definition. These properties are updatable. + /// + + /// Describes the disallowed disk types. + /// + + /// Describes the gallery image definition purchase plan. This is used by + /// marketplace images. + /// + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' + + /// A list of gallery image features. + /// + + /// The architecture of the image. Applicable to OS disks only. + /// Possible values include: 'x64', 'Arm64' + + /// Optional. Must be set to true if the gallery image features are being + /// updated. + /// + public GalleryImageProperties(OperatingSystemTypes osType, OperatingSystemStateTypes osState, GalleryImageIdentifier identifier, string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), string hyperVGeneration = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string provisioningState = default(string), System.Collections.Generic.IList features = default(System.Collections.Generic.IList), string architecture = default(string), bool? allowUpdateImage = default(bool?)) + + { + this.Description = description; + this.Eula = eula; + this.PrivacyStatementUri = privacyStatementUri; + this.ReleaseNoteUri = releaseNoteUri; + this.OsType = osType; + this.OsState = osState; + this.HyperVGeneration = hyperVGeneration; + this.EndOfLifeDate = endOfLifeDate; + this.Identifier = identifier; + this.Recommended = recommended; + this.Disallowed = disallowed; + this.PurchasePlan = purchasePlan; + this.ProvisioningState = provisioningState; + this.Features = features; + this.Architecture = architecture; + this.AllowUpdateImage = allowUpdateImage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the description of this gallery image definition resource. + /// This property is updatable. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets the Eula agreement for the gallery image definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eula")] + public string Eula {get; set; } + + /// + /// Gets or sets the privacy statement uri. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privacyStatementUri")] + public string PrivacyStatementUri {get; set; } + + /// + /// Gets or sets the release note uri. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "releaseNoteUri")] + public string ReleaseNoteUri {get; set; } + + /// + /// Gets or sets this property allows you to specify the type of the OS that is + /// included in the disk when creating a VM from a managed image. Possible + /// values are: **Windows,** **Linux.** Possible values include: 'Windows', 'Linux' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public OperatingSystemTypes OsType {get; set; } + + /// + /// Gets or sets this property allows the user to specify whether the virtual + /// machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'Generalized', 'Specialized' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osState")] + public OperatingSystemStateTypes OsState {get; set; } + + /// + /// Gets or sets the hypervisor generation of the Virtual Machine. Applicable + /// to OS disks only. Possible values include: 'V1', 'V2' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hyperVGeneration")] + public string HyperVGeneration {get; set; } + + /// + /// Gets or sets the end of life date of the gallery image definition. This + /// property can be used for decommissioning purposes. This property is + /// updatable. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "endOfLifeDate")] + public System.DateTime? EndOfLifeDate {get; set; } + + /// + /// Gets or sets this is the gallery image definition identifier. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identifier")] + public GalleryImageIdentifier Identifier {get; set; } + + /// + /// Gets or sets the properties describe the recommended machine configuration + /// for this Image Definition. These properties are updatable. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "recommended")] + public RecommendedMachineConfiguration Recommended {get; set; } + + /// + /// Gets or sets describes the disallowed disk types. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disallowed")] + public Disallowed Disallowed {get; set; } + + /// + /// Gets or sets describes the gallery image definition purchase plan. This is + /// used by marketplace images. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "purchasePlan")] + public ImagePurchasePlan PurchasePlan {get; set; } + + /// + /// Gets the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets a list of gallery image features. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "features")] + public System.Collections.Generic.IList Features {get; set; } + + /// + /// Gets or sets the architecture of the image. Applicable to OS disks only. Possible values include: 'x64', 'Arm64' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "architecture")] + public string Architecture {get; set; } + + /// + /// Gets or sets optional. Must be set to true if the gallery image features + /// are being updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "allowUpdateImage")] + public bool? AllowUpdateImage {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Identifier == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Identifier"); + } + + + + + + + + if (this.Identifier != null) + { + this.Identifier.Validate(); + } + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageUpdate.cs index d84f7062b1e7..38537e7e45db 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageUpdate.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Specifies information about the gallery image definition that you want - /// to update. + /// Specifies information about the gallery image definition that you want to + /// update. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class GalleryImageUpdate : UpdateResourceDefinition { /// @@ -35,68 +25,96 @@ public GalleryImageUpdate() /// /// Initializes a new instance of the GalleryImageUpdate class. /// - /// This property allows you to specify the type - /// of the OS that is included in the disk when creating a VM from a - /// managed image. Possible values are: **Windows,** **Linux.**. - /// Possible values include: 'Windows', 'Linux' - /// This property allows the user to specify - /// whether the virtual machines created under this image are - /// 'Generalized' or 'Specialized'. Possible values include: - /// 'Generalized', 'Specialized' - /// This is the gallery image definition - /// identifier. - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The description of this gallery image - /// definition resource. This property is updatable. - /// The Eula agreement for the gallery image - /// definition. - /// The privacy statement - /// uri. - /// The release note uri. - /// The hypervisor generation of the - /// Virtual Machine. Applicable to OS disks only. Possible values - /// include: 'V1', 'V2' - /// The end of life date of the gallery - /// image definition. This property can be used for decommissioning - /// purposes. This property is updatable. - /// The properties describe the recommended - /// machine configuration for this Image Definition. These properties - /// are updatable. - /// Describes the disallowed disk - /// types. - /// Describes the gallery image definition - /// purchase plan. This is used by marketplace images. - /// The provisioning state, which only - /// appears in the response. Possible values include: 'Creating', - /// 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' - /// A list of gallery image features. - /// The architecture of the image. - /// Applicable to OS disks only. Possible values include: 'x64', - /// 'Arm64' - /// Optional. Must be set to true if the - /// gallery image features are being updated. - public GalleryImageUpdate(OperatingSystemTypes osType, OperatingSystemStateTypes osState, GalleryImageIdentifier identifier, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), string hyperVGeneration = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string provisioningState = default(string), IList features = default(IList), string architecture = default(string), bool? allowUpdateImage = default(bool?)) - : base(id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource tags + /// + + /// Describes the disallowed disk types. + /// + + /// The architecture of the image. Applicable to OS disks only. + /// Possible values include: 'x64', 'Arm64' + + /// The description of this gallery image definition resource. This property is + /// updatable. + /// + + /// The Eula agreement for the gallery image definition. + /// + + /// The privacy statement uri. + /// + + /// The release note uri. + /// + + /// This property allows you to specify the type of the OS that is included in + /// the disk when creating a VM from a managed image. Possible values are: + /// **Windows,** **Linux.** + /// Possible values include: 'Windows', 'Linux' + + /// This property allows the user to specify whether the virtual machines + /// created under this image are 'Generalized' or 'Specialized'. + /// Possible values include: 'Generalized', 'Specialized' + + /// The hypervisor generation of the Virtual Machine. Applicable to OS disks + /// only. + /// Possible values include: 'V1', 'V2' + + /// The end of life date of the gallery image definition. This property can be + /// used for decommissioning purposes. This property is updatable. + /// + + /// This is the gallery image definition identifier. + /// + + /// The properties describe the recommended machine configuration for this + /// Image Definition. These properties are updatable. + /// + + /// Describes the gallery image definition purchase plan. This is used by + /// marketplace images. + /// + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' + + /// A list of gallery image features. + /// + + /// Optional. Must be set to true if the gallery image features are being + /// updated. + /// + public GalleryImageUpdate(string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), Disallowed disallowed = default(Disallowed), string architecture = default(string), string description = default(string), string eula = default(string), string privacyStatementUri = default(string), string releaseNoteUri = default(string), OperatingSystemTypes? osType = default(OperatingSystemTypes?), OperatingSystemStateTypes? osState = default(OperatingSystemStateTypes?), string hyperVGeneration = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), GalleryImageIdentifier identifier = default(GalleryImageIdentifier), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string provisioningState = default(string), System.Collections.Generic.IList features = default(System.Collections.Generic.IList), bool? allowUpdateImage = default(bool?)) + + : base(id, name, type, tags) { - Description = description; - Eula = eula; - PrivacyStatementUri = privacyStatementUri; - ReleaseNoteUri = releaseNoteUri; - OsType = osType; - OsState = osState; - HyperVGeneration = hyperVGeneration; - EndOfLifeDate = endOfLifeDate; - Identifier = identifier; - Recommended = recommended; - Disallowed = disallowed; - PurchasePlan = purchasePlan; - ProvisioningState = provisioningState; - Features = features; - Architecture = architecture; - AllowUpdateImage = allowUpdateImage; + this.Disallowed = disallowed; + this.Architecture = architecture; + this.Description = description; + this.Eula = eula; + this.PrivacyStatementUri = privacyStatementUri; + this.ReleaseNoteUri = releaseNoteUri; + this.OsType = osType; + this.OsState = osState; + this.HyperVGeneration = hyperVGeneration; + this.EndOfLifeDate = endOfLifeDate; + this.Identifier = identifier; + this.Recommended = recommended; + this.PurchasePlan = purchasePlan; + this.ProvisioningState = provisioningState; + this.Features = features; + this.AllowUpdateImage = allowUpdateImage; CustomInit(); } @@ -105,135 +123,137 @@ public GalleryImageUpdate() /// partial void CustomInit(); + /// - /// Gets or sets the description of this gallery image definition - /// resource. This property is updatable. + /// Gets or sets describes the disallowed disk types. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disallowed")] + public Disallowed Disallowed {get; set; } /// - /// Gets or sets the Eula agreement for the gallery image definition. + /// Gets or sets the architecture of the image. Applicable to OS disks only. Possible values include: 'x64', 'Arm64' /// - [JsonProperty(PropertyName = "properties.eula")] - public string Eula { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.architecture")] + public string Architecture {get; set; } /// - /// Gets or sets the privacy statement uri. + /// Gets or sets the description of this gallery image definition resource. + /// This property is updatable. /// - [JsonProperty(PropertyName = "properties.privacyStatementUri")] - public string PrivacyStatementUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets the release note uri. + /// Gets or sets the Eula agreement for the gallery image definition. /// - [JsonProperty(PropertyName = "properties.releaseNoteUri")] - public string ReleaseNoteUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.eula")] + public string Eula {get; set; } /// - /// Gets or sets this property allows you to specify the type of the OS - /// that is included in the disk when creating a VM from a managed - /// image. Possible values are: **Windows,** **Linux.**. Possible - /// values include: 'Windows', 'Linux' + /// Gets or sets the privacy statement uri. /// - [JsonProperty(PropertyName = "properties.osType")] - public OperatingSystemTypes OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privacyStatementUri")] + public string PrivacyStatementUri {get; set; } /// - /// Gets or sets this property allows the user to specify whether the - /// virtual machines created under this image are 'Generalized' or - /// 'Specialized'. Possible values include: 'Generalized', - /// 'Specialized' + /// Gets or sets the release note uri. /// - [JsonProperty(PropertyName = "properties.osState")] - public OperatingSystemStateTypes OsState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.releaseNoteUri")] + public string ReleaseNoteUri {get; set; } /// - /// Gets or sets the hypervisor generation of the Virtual Machine. - /// Applicable to OS disks only. Possible values include: 'V1', 'V2' + /// Gets or sets this property allows you to specify the type of the OS that is + /// included in the disk when creating a VM from a managed image. Possible + /// values are: **Windows,** **Linux.** Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "properties.hyperVGeneration")] - public string HyperVGeneration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osType")] + public OperatingSystemTypes? OsType {get; set; } /// - /// Gets or sets the end of life date of the gallery image definition. - /// This property can be used for decommissioning purposes. This - /// property is updatable. + /// Gets or sets this property allows the user to specify whether the virtual + /// machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'Generalized', 'Specialized' /// - [JsonProperty(PropertyName = "properties.endOfLifeDate")] - public System.DateTime? EndOfLifeDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osState")] + public OperatingSystemStateTypes? OsState {get; set; } /// - /// Gets or sets this is the gallery image definition identifier. + /// Gets or sets the hypervisor generation of the Virtual Machine. Applicable + /// to OS disks only. Possible values include: 'V1', 'V2' /// - [JsonProperty(PropertyName = "properties.identifier")] - public GalleryImageIdentifier Identifier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hyperVGeneration")] + public string HyperVGeneration {get; set; } /// - /// Gets or sets the properties describe the recommended machine - /// configuration for this Image Definition. These properties are + /// Gets or sets the end of life date of the gallery image definition. This + /// property can be used for decommissioning purposes. This property is /// updatable. /// - [JsonProperty(PropertyName = "properties.recommended")] - public RecommendedMachineConfiguration Recommended { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.endOfLifeDate")] + public System.DateTime? EndOfLifeDate {get; set; } /// - /// Gets or sets describes the disallowed disk types. + /// Gets or sets this is the gallery image definition identifier. /// - [JsonProperty(PropertyName = "properties.disallowed")] - public Disallowed Disallowed { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.identifier")] + public GalleryImageIdentifier Identifier {get; set; } /// - /// Gets or sets describes the gallery image definition purchase plan. - /// This is used by marketplace images. + /// Gets or sets the properties describe the recommended machine configuration + /// for this Image Definition. These properties are updatable. /// - [JsonProperty(PropertyName = "properties.purchasePlan")] - public ImagePurchasePlan PurchasePlan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.recommended")] + public RecommendedMachineConfiguration Recommended {get; set; } /// - /// Gets the provisioning state, which only appears in the response. - /// Possible values include: 'Creating', 'Updating', 'Failed', - /// 'Succeeded', 'Deleting', 'Migrating' + /// Gets or sets describes the gallery image definition purchase plan. This is + /// used by marketplace images. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.purchasePlan")] + public ImagePurchasePlan PurchasePlan {get; set; } /// - /// Gets or sets a list of gallery image features. + /// Gets the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' /// - [JsonProperty(PropertyName = "properties.features")] - public IList Features { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the architecture of the image. Applicable to OS disks - /// only. Possible values include: 'x64', 'Arm64' + /// Gets or sets a list of gallery image features. /// - [JsonProperty(PropertyName = "properties.architecture")] - public string Architecture { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.features")] + public System.Collections.Generic.IList Features {get; set; } /// - /// Gets or sets optional. Must be set to true if the gallery image - /// features are being updated. + /// Gets or sets optional. Must be set to true if the gallery image features + /// are being updated. /// - [JsonProperty(PropertyName = "properties.allowUpdateImage")] - public bool? AllowUpdateImage { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.allowUpdateImage")] + public bool? AllowUpdateImage {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Identifier == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Identifier"); - } - if (Identifier != null) + + + + + + + + + + if (this.Identifier != null) { - Identifier.Validate(); + this.Identifier.Validate(); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersion.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersion.cs index 17165b62d421..e61aae7e5e5e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersion.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersion.cs @@ -1,28 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specifies information about the gallery image version that you want to /// create or update. /// - [Rest.Serialization.JsonTransformation] - public partial class GalleryImageVersion : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class GalleryImageVersion : TrackedResource { /// /// Initializes a new instance of the GalleryImageVersion class. @@ -35,39 +25,58 @@ public GalleryImageVersion() /// /// Initializes a new instance of the GalleryImageVersion class. /// - /// Resource location - /// This is the storage profile of a - /// Gallery Image Version. - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The publishing profile of a gallery - /// image Version. - /// The provisioning state, which only - /// appears in the response. Possible values include: 'Creating', - /// 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' - /// This is the safety profile of the - /// Gallery Image Version. - /// This is the replication status of - /// the gallery image version. - /// The security profile of a gallery - /// image version - /// Indicates if this is a soft-delete resource - /// restoration request. - /// This is the validations profile of - /// a Gallery Image Version. - public GalleryImageVersion(string location, GalleryImageVersionStorageProfile storageProfile, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), GalleryImageVersionPublishingProfile publishingProfile = default(GalleryImageVersionPublishingProfile), string provisioningState = default(string), GalleryImageVersionSafetyProfile safetyProfile = default(GalleryImageVersionSafetyProfile), ReplicationStatus replicationStatus = default(ReplicationStatus), ImageVersionSecurityProfile securityProfile = default(ImageVersionSecurityProfile), bool? restore = default(bool?), ValidationsProfile validationsProfile = default(ValidationsProfile)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// This is the replication status of the gallery image version. + /// + + /// This is the validations profile of a Gallery Image Version. + /// + + /// The publishing profile of a gallery image Version. + /// + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' + + /// This is the storage profile of a Gallery Image Version. + /// + + /// This is the safety profile of the Gallery Image Version. + /// + + /// The security profile of a gallery image version + /// + + /// Indicates if this is a soft-delete resource restoration request. + /// + public GalleryImageVersion(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ReplicationStatus replicationStatus = default(ReplicationStatus), ValidationsProfile validationsProfile = default(ValidationsProfile), GalleryImageVersionPublishingProfile publishingProfile = default(GalleryImageVersionPublishingProfile), string provisioningState = default(string), GalleryImageVersionStorageProfile storageProfile = default(GalleryImageVersionStorageProfile), GalleryImageVersionSafetyProfile safetyProfile = default(GalleryImageVersionSafetyProfile), ImageVersionSecurityProfile securityProfile = default(ImageVersionSecurityProfile), bool? restore = default(bool?)) + + : base(location, id, name, type, tags) { - PublishingProfile = publishingProfile; - ProvisioningState = provisioningState; - StorageProfile = storageProfile; - SafetyProfile = safetyProfile; - ReplicationStatus = replicationStatus; - SecurityProfile = securityProfile; - Restore = restore; - ValidationsProfile = validationsProfile; + this.ReplicationStatus = replicationStatus; + this.ValidationsProfile = validationsProfile; + this.PublishingProfile = publishingProfile; + this.ProvisioningState = provisioningState; + this.StorageProfile = storageProfile; + this.SafetyProfile = safetyProfile; + this.SecurityProfile = securityProfile; + this.Restore = restore; CustomInit(); } @@ -76,72 +85,71 @@ public GalleryImageVersion() /// partial void CustomInit(); + /// - /// Gets or sets the publishing profile of a gallery image Version. + /// Gets this is the replication status of the gallery image version. /// - [JsonProperty(PropertyName = "properties.publishingProfile")] - public GalleryImageVersionPublishingProfile PublishingProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.replicationStatus")] + public ReplicationStatus ReplicationStatus {get; private set; } /// - /// Gets the provisioning state, which only appears in the response. - /// Possible values include: 'Creating', 'Updating', 'Failed', - /// 'Succeeded', 'Deleting', 'Migrating' + /// Gets this is the validations profile of a Gallery Image Version. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.validationsProfile")] + public ValidationsProfile ValidationsProfile {get; private set; } /// - /// Gets or sets this is the storage profile of a Gallery Image - /// Version. + /// Gets or sets the publishing profile of a gallery image Version. /// - [JsonProperty(PropertyName = "properties.storageProfile")] - public GalleryImageVersionStorageProfile StorageProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publishingProfile")] + public GalleryImageVersionPublishingProfile PublishingProfile {get; set; } /// - /// Gets or sets this is the safety profile of the Gallery Image - /// Version. + /// Gets the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' /// - [JsonProperty(PropertyName = "properties.safetyProfile")] - public GalleryImageVersionSafetyProfile SafetyProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets this is the replication status of the gallery image version. + /// Gets or sets this is the storage profile of a Gallery Image Version. /// - [JsonProperty(PropertyName = "properties.replicationStatus")] - public ReplicationStatus ReplicationStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageProfile")] + public GalleryImageVersionStorageProfile StorageProfile {get; set; } /// - /// Gets or sets the security profile of a gallery image version + /// Gets or sets this is the safety profile of the Gallery Image Version. /// - [JsonProperty(PropertyName = "properties.securityProfile")] - public ImageVersionSecurityProfile SecurityProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.safetyProfile")] + public GalleryImageVersionSafetyProfile SafetyProfile {get; set; } /// - /// Gets or sets indicates if this is a soft-delete resource - /// restoration request. + /// Gets or sets the security profile of a gallery image version /// - [JsonProperty(PropertyName = "properties.restore")] - public bool? Restore { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityProfile")] + public ImageVersionSecurityProfile SecurityProfile {get; set; } /// - /// Gets this is the validations profile of a Gallery Image Version. + /// Gets or sets indicates if this is a soft-delete resource restoration + /// request. /// - [JsonProperty(PropertyName = "properties.validationsProfile")] - public ValidationsProfile ValidationsProfile { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.restore")] + public bool? Restore {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (StorageProfile == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "StorageProfile"); - } + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionProperties.cs new file mode 100644 index 000000000000..4bc2aa48389f --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionProperties.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a gallery image version. + /// + public partial class GalleryImageVersionProperties + { + /// + /// Initializes a new instance of the GalleryImageVersionProperties class. + /// + public GalleryImageVersionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GalleryImageVersionProperties class. + /// + + /// The publishing profile of a gallery image Version. + /// + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' + + /// This is the storage profile of a Gallery Image Version. + /// + + /// This is the safety profile of the Gallery Image Version. + /// + + /// This is the replication status of the gallery image version. + /// + + /// The security profile of a gallery image version + /// + + /// Indicates if this is a soft-delete resource restoration request. + /// + + /// This is the validations profile of a Gallery Image Version. + /// + public GalleryImageVersionProperties(GalleryImageVersionStorageProfile storageProfile, GalleryImageVersionPublishingProfile publishingProfile = default(GalleryImageVersionPublishingProfile), string provisioningState = default(string), GalleryImageVersionSafetyProfile safetyProfile = default(GalleryImageVersionSafetyProfile), ReplicationStatus replicationStatus = default(ReplicationStatus), ImageVersionSecurityProfile securityProfile = default(ImageVersionSecurityProfile), bool? restore = default(bool?), ValidationsProfile validationsProfile = default(ValidationsProfile)) + + { + this.PublishingProfile = publishingProfile; + this.ProvisioningState = provisioningState; + this.StorageProfile = storageProfile; + this.SafetyProfile = safetyProfile; + this.ReplicationStatus = replicationStatus; + this.SecurityProfile = securityProfile; + this.Restore = restore; + this.ValidationsProfile = validationsProfile; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the publishing profile of a gallery image Version. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publishingProfile")] + public GalleryImageVersionPublishingProfile PublishingProfile {get; set; } + + /// + /// Gets the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets this is the storage profile of a Gallery Image Version. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageProfile")] + public GalleryImageVersionStorageProfile StorageProfile {get; set; } + + /// + /// Gets or sets this is the safety profile of the Gallery Image Version. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "safetyProfile")] + public GalleryImageVersionSafetyProfile SafetyProfile {get; set; } + + /// + /// Gets this is the replication status of the gallery image version. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "replicationStatus")] + public ReplicationStatus ReplicationStatus {get; private set; } + + /// + /// Gets or sets the security profile of a gallery image version + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "securityProfile")] + public ImageVersionSecurityProfile SecurityProfile {get; set; } + + /// + /// Gets or sets indicates if this is a soft-delete resource restoration + /// request. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "restore")] + public bool? Restore {get; set; } + + /// + /// Gets this is the validations profile of a Gallery Image Version. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "validationsProfile")] + public ValidationsProfile ValidationsProfile {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.StorageProfile == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StorageProfile"); + } + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionPublishingProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionPublishingProfile.cs index 10c152139749..e4f6080b519c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionPublishingProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionPublishingProfile.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class GalleryImageVersionPublishingProfile : GalleryArtifactPublishingProfileBase { /// - /// Initializes a new instance of the - /// GalleryImageVersionPublishingProfile class. + /// Initializes a new instance of the GalleryImageVersionPublishingProfile class. /// public GalleryImageVersionPublishingProfile() { @@ -29,36 +21,44 @@ public GalleryImageVersionPublishingProfile() } /// - /// Initializes a new instance of the - /// GalleryImageVersionPublishingProfile class. + /// Initializes a new instance of the GalleryImageVersionPublishingProfile class. /// - /// The target regions where the Image - /// Version is going to be replicated to. This property is - /// updatable. - /// The number of replicas of the Image - /// Version to be created per region. This property would take effect - /// for a region when regionalReplicaCount is not specified. This - /// property is updatable. - /// If set to true, Virtual Machines - /// deployed from the latest version of the Image Definition won't use - /// this Image Version. - /// The timestamp for when the gallery - /// image version is published. - /// The end of life date of the gallery - /// image version. This property can be used for decommissioning - /// purposes. This property is updatable. - /// Specifies the storage account type - /// to be used to store the image. This property is not updatable. - /// Possible values include: 'Standard_LRS', 'Standard_ZRS', - /// 'Premium_LRS', 'PremiumV2_LRS' - /// Optional parameter which specifies - /// the mode to be used for replication. This property is not - /// updatable. Possible values include: 'Full', 'Shallow' - /// The target extended locations - /// where the Image Version is going to be replicated to. This property - /// is updatable. - public GalleryImageVersionPublishingProfile(IList targetRegions = default(IList), int? replicaCount = default(int?), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? endOfLifeDate = default(System.DateTime?), string storageAccountType = default(string), string replicationMode = default(string), IList targetExtendedLocations = default(IList)) - : base(targetRegions, replicaCount, excludeFromLatest, publishedDate, endOfLifeDate, storageAccountType, replicationMode, targetExtendedLocations) + + /// The target regions where the Image Version is going to be replicated to. + /// This property is updatable. + /// + + /// The number of replicas of the Image Version to be created per region. This + /// property would take effect for a region when regionalReplicaCount is not + /// specified. This property is updatable. + /// + + /// If set to true, Virtual Machines deployed from the latest version of the + /// Image Definition won't use this Image Version. + /// + + /// The timestamp for when the gallery image version is published. + /// + + /// The end of life date of the gallery image version. This property can be + /// used for decommissioning purposes. This property is updatable. + /// + + /// Specifies the storage account type to be used to store the image. This + /// property is not updatable. + /// Possible values include: 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS', + /// 'PremiumV2_LRS' + + /// Optional parameter which specifies the mode to be used for replication. + /// This property is not updatable. + /// Possible values include: 'Full', 'Shallow' + + /// The target extended locations where the Image Version is going to be + /// replicated to. This property is updatable. + /// + public GalleryImageVersionPublishingProfile(System.Collections.Generic.IList targetRegions = default(System.Collections.Generic.IList), int? replicaCount = default(int?), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? endOfLifeDate = default(System.DateTime?), string storageAccountType = default(string), string replicationMode = default(string), System.Collections.Generic.IList targetExtendedLocations = default(System.Collections.Generic.IList)) + + : base(targetRegions, replicaCount, excludeFromLatest, publishedDate, endOfLifeDate, storageAccountType, replicationMode, targetExtendedLocations) { CustomInit(); } @@ -69,4 +69,4 @@ public GalleryImageVersionPublishingProfile() partial void CustomInit(); } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionSafetyProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionSafetyProfile.cs index 0cd96307a815..1afcce547f17 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionSafetyProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionSafetyProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class GalleryImageVersionSafetyProfile : GalleryArtifactSafetyProfileBase { /// - /// Initializes a new instance of the GalleryImageVersionSafetyProfile - /// class. + /// Initializes a new instance of the GalleryImageVersionSafetyProfile class. /// public GalleryImageVersionSafetyProfile() { @@ -30,25 +21,31 @@ public GalleryImageVersionSafetyProfile() } /// - /// Initializes a new instance of the GalleryImageVersionSafetyProfile - /// class. + /// Initializes a new instance of the GalleryImageVersionSafetyProfile class. /// - /// Indicates whether - /// or not removing this Gallery Image Version from replicated regions - /// is allowed. - /// Indicates whether this - /// image has been reported as violating Microsoft's policies. - /// A list of Policy Violations that - /// have been reported for this Gallery Image Version. - /// Indicates whether or not - /// the deletion is blocked for this Gallery Image Version if its End - /// Of Life has not expired. - public GalleryImageVersionSafetyProfile(bool? allowDeletionOfReplicatedLocations = default(bool?), bool? reportedForPolicyViolation = default(bool?), IList policyViolations = default(IList), bool? blockDeletionBeforeEndOfLife = default(bool?)) - : base(allowDeletionOfReplicatedLocations) + + /// Indicates whether or not removing this Gallery Image Version from + /// replicated regions is allowed. + /// + + /// Indicates whether this image has been reported as violating Microsoft's + /// policies. + /// + + /// A list of Policy Violations that have been reported for this Gallery Image + /// Version. + /// + + /// Indicates whether or not the deletion is blocked for this Gallery Image + /// Version if its End Of Life has not expired. + /// + public GalleryImageVersionSafetyProfile(bool? allowDeletionOfReplicatedLocations = default(bool?), bool? reportedForPolicyViolation = default(bool?), System.Collections.Generic.IList policyViolations = default(System.Collections.Generic.IList), bool? blockDeletionBeforeEndOfLife = default(bool?)) + + : base(allowDeletionOfReplicatedLocations) { - ReportedForPolicyViolation = reportedForPolicyViolation; - PolicyViolations = policyViolations; - BlockDeletionBeforeEndOfLife = blockDeletionBeforeEndOfLife; + this.ReportedForPolicyViolation = reportedForPolicyViolation; + this.PolicyViolations = policyViolations; + this.BlockDeletionBeforeEndOfLife = blockDeletionBeforeEndOfLife; CustomInit(); } @@ -57,26 +54,26 @@ public GalleryImageVersionSafetyProfile() /// partial void CustomInit(); + /// /// Gets indicates whether this image has been reported as violating - /// Microsoft's policies. + /// Microsoft's policies. /// - [JsonProperty(PropertyName = "reportedForPolicyViolation")] - public bool? ReportedForPolicyViolation { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "reportedForPolicyViolation")] + public bool? ReportedForPolicyViolation {get; private set; } /// - /// Gets a list of Policy Violations that have been reported for this - /// Gallery Image Version. + /// Gets a list of Policy Violations that have been reported for this Gallery + /// Image Version. /// - [JsonProperty(PropertyName = "policyViolations")] - public IList PolicyViolations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "policyViolations")] + public System.Collections.Generic.IList PolicyViolations {get; private set; } /// - /// Gets or sets indicates whether or not the deletion is blocked for - /// this Gallery Image Version if its End Of Life has not expired. + /// Gets or sets indicates whether or not the deletion is blocked for this + /// Gallery Image Version if its End Of Life has not expired. /// - [JsonProperty(PropertyName = "blockDeletionBeforeEndOfLife")] - public bool? BlockDeletionBeforeEndOfLife { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "blockDeletionBeforeEndOfLife")] + public bool? BlockDeletionBeforeEndOfLife {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionStorageProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionStorageProfile.cs index 54e84b0c8a61..89d1a08363f3 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionStorageProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionStorageProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class GalleryImageVersionStorageProfile { /// - /// Initializes a new instance of the GalleryImageVersionStorageProfile - /// class. + /// Initializes a new instance of the GalleryImageVersionStorageProfile class. /// public GalleryImageVersionStorageProfile() { @@ -30,18 +21,23 @@ public GalleryImageVersionStorageProfile() } /// - /// Initializes a new instance of the GalleryImageVersionStorageProfile - /// class. + /// Initializes a new instance of the GalleryImageVersionStorageProfile class. /// - /// The source of the gallery artifact - /// version. - /// This is the OS disk image. - /// A list of data disk images. - public GalleryImageVersionStorageProfile(GalleryArtifactVersionFullSource source = default(GalleryArtifactVersionFullSource), GalleryOSDiskImage osDiskImage = default(GalleryOSDiskImage), IList dataDiskImages = default(IList)) + + /// The source of the gallery artifact version. + /// + + /// This is the OS disk image. + /// + + /// A list of data disk images. + /// + public GalleryImageVersionStorageProfile(GalleryArtifactVersionFullSource source = default(GalleryArtifactVersionFullSource), GalleryOSDiskImage osDiskImage = default(GalleryOSDiskImage), System.Collections.Generic.IList dataDiskImages = default(System.Collections.Generic.IList)) + { - Source = source; - OsDiskImage = osDiskImage; - DataDiskImages = dataDiskImages; + this.Source = source; + this.OsDiskImage = osDiskImage; + this.DataDiskImages = dataDiskImages; CustomInit(); } @@ -50,23 +46,23 @@ public GalleryImageVersionStorageProfile() /// partial void CustomInit(); + /// /// Gets or sets the source of the gallery artifact version. /// - [JsonProperty(PropertyName = "source")] - public GalleryArtifactVersionFullSource Source { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "source")] + public GalleryArtifactVersionFullSource Source {get; set; } /// /// Gets or sets this is the OS disk image. /// - [JsonProperty(PropertyName = "osDiskImage")] - public GalleryOSDiskImage OsDiskImage { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osDiskImage")] + public GalleryOSDiskImage OsDiskImage {get; set; } /// /// Gets or sets a list of data disk images. /// - [JsonProperty(PropertyName = "dataDiskImages")] - public IList DataDiskImages { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDiskImages")] + public System.Collections.Generic.IList DataDiskImages {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionUefiSettings.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionUefiSettings.cs index 148013ee1c43..7f17f689bdbe 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionUefiSettings.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionUefiSettings.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class GalleryImageVersionUefiSettings { /// - /// Initializes a new instance of the GalleryImageVersionUefiSettings - /// class. + /// Initializes a new instance of the GalleryImageVersionUefiSettings class. /// public GalleryImageVersionUefiSettings() { @@ -30,19 +21,21 @@ public GalleryImageVersionUefiSettings() } /// - /// Initializes a new instance of the GalleryImageVersionUefiSettings - /// class. + /// Initializes a new instance of the GalleryImageVersionUefiSettings class. /// - /// The name of the template(s) - /// that contains default UEFI key signatures that will be added to the - /// image. - /// Additional UEFI key signatures - /// that will be added to the image in addition to the signature - /// templates - public GalleryImageVersionUefiSettings(IList signatureTemplateNames = default(IList), UefiKeySignatures additionalSignatures = default(UefiKeySignatures)) + + /// The name of the template(s) that contains default UEFI key signatures that + /// will be added to the image. + /// + + /// Additional UEFI key signatures that will be added to the image in addition + /// to the signature templates + /// + public GalleryImageVersionUefiSettings(System.Collections.Generic.IList signatureTemplateNames = default(System.Collections.Generic.IList), UefiKeySignatures additionalSignatures = default(UefiKeySignatures)) + { - SignatureTemplateNames = signatureTemplateNames; - AdditionalSignatures = additionalSignatures; + this.SignatureTemplateNames = signatureTemplateNames; + this.AdditionalSignatures = additionalSignatures; CustomInit(); } @@ -51,19 +44,19 @@ public GalleryImageVersionUefiSettings() /// partial void CustomInit(); + /// - /// Gets or sets the name of the template(s) that contains default UEFI - /// key signatures that will be added to the image. + /// Gets or sets the name of the template(s) that contains default UEFI key + /// signatures that will be added to the image. /// - [JsonProperty(PropertyName = "signatureTemplateNames")] - public IList SignatureTemplateNames { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "signatureTemplateNames")] + public System.Collections.Generic.IList SignatureTemplateNames {get; set; } /// - /// Gets or sets additional UEFI key signatures that will be added to - /// the image in addition to the signature templates + /// Gets or sets additional UEFI key signatures that will be added to the image + /// in addition to the signature templates /// - [JsonProperty(PropertyName = "additionalSignatures")] - public UefiKeySignatures AdditionalSignatures { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalSignatures")] + public UefiKeySignatures AdditionalSignatures {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionUpdate.cs index 8b597c5025ae..545cfb77ec3e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionUpdate.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specifies information about the gallery image version that you want to /// update. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class GalleryImageVersionUpdate : UpdateResourceDefinition { /// @@ -35,38 +25,55 @@ public GalleryImageVersionUpdate() /// /// Initializes a new instance of the GalleryImageVersionUpdate class. /// - /// This is the storage profile of a - /// Gallery Image Version. - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The publishing profile of a gallery - /// image Version. - /// The provisioning state, which only - /// appears in the response. Possible values include: 'Creating', - /// 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' - /// This is the safety profile of the - /// Gallery Image Version. - /// This is the replication status of - /// the gallery image version. - /// The security profile of a gallery - /// image version - /// Indicates if this is a soft-delete resource - /// restoration request. - /// This is the validations profile of - /// a Gallery Image Version. - public GalleryImageVersionUpdate(GalleryImageVersionStorageProfile storageProfile, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), GalleryImageVersionPublishingProfile publishingProfile = default(GalleryImageVersionPublishingProfile), string provisioningState = default(string), GalleryImageVersionSafetyProfile safetyProfile = default(GalleryImageVersionSafetyProfile), ReplicationStatus replicationStatus = default(ReplicationStatus), ImageVersionSecurityProfile securityProfile = default(ImageVersionSecurityProfile), bool? restore = default(bool?), ValidationsProfile validationsProfile = default(ValidationsProfile)) - : base(id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource tags + /// + + /// This is the replication status of the gallery image version. + /// + + /// This is the validations profile of a Gallery Image Version. + /// + + /// The publishing profile of a gallery image Version. + /// + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' + + /// This is the storage profile of a Gallery Image Version. + /// + + /// This is the safety profile of the Gallery Image Version. + /// + + /// The security profile of a gallery image version + /// + + /// Indicates if this is a soft-delete resource restoration request. + /// + public GalleryImageVersionUpdate(string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ReplicationStatus replicationStatus = default(ReplicationStatus), ValidationsProfile validationsProfile = default(ValidationsProfile), GalleryImageVersionPublishingProfile publishingProfile = default(GalleryImageVersionPublishingProfile), string provisioningState = default(string), GalleryImageVersionStorageProfile storageProfile = default(GalleryImageVersionStorageProfile), GalleryImageVersionSafetyProfile safetyProfile = default(GalleryImageVersionSafetyProfile), ImageVersionSecurityProfile securityProfile = default(ImageVersionSecurityProfile), bool? restore = default(bool?)) + + : base(id, name, type, tags) { - PublishingProfile = publishingProfile; - ProvisioningState = provisioningState; - StorageProfile = storageProfile; - SafetyProfile = safetyProfile; - ReplicationStatus = replicationStatus; - SecurityProfile = securityProfile; - Restore = restore; - ValidationsProfile = validationsProfile; + this.ReplicationStatus = replicationStatus; + this.ValidationsProfile = validationsProfile; + this.PublishingProfile = publishingProfile; + this.ProvisioningState = provisioningState; + this.StorageProfile = storageProfile; + this.SafetyProfile = safetyProfile; + this.SecurityProfile = securityProfile; + this.Restore = restore; CustomInit(); } @@ -75,71 +82,54 @@ public GalleryImageVersionUpdate() /// partial void CustomInit(); - /// - /// Gets or sets the publishing profile of a gallery image Version. - /// - [JsonProperty(PropertyName = "properties.publishingProfile")] - public GalleryImageVersionPublishingProfile PublishingProfile { get; set; } /// - /// Gets the provisioning state, which only appears in the response. - /// Possible values include: 'Creating', 'Updating', 'Failed', - /// 'Succeeded', 'Deleting', 'Migrating' + /// Gets this is the replication status of the gallery image version. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.replicationStatus")] + public ReplicationStatus ReplicationStatus {get; private set; } /// - /// Gets or sets this is the storage profile of a Gallery Image - /// Version. + /// Gets this is the validations profile of a Gallery Image Version. /// - [JsonProperty(PropertyName = "properties.storageProfile")] - public GalleryImageVersionStorageProfile StorageProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.validationsProfile")] + public ValidationsProfile ValidationsProfile {get; private set; } /// - /// Gets or sets this is the safety profile of the Gallery Image - /// Version. + /// Gets or sets the publishing profile of a gallery image Version. /// - [JsonProperty(PropertyName = "properties.safetyProfile")] - public GalleryImageVersionSafetyProfile SafetyProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publishingProfile")] + public GalleryImageVersionPublishingProfile PublishingProfile {get; set; } /// - /// Gets this is the replication status of the gallery image version. + /// Gets the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' /// - [JsonProperty(PropertyName = "properties.replicationStatus")] - public ReplicationStatus ReplicationStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the security profile of a gallery image version + /// Gets or sets this is the storage profile of a Gallery Image Version. /// - [JsonProperty(PropertyName = "properties.securityProfile")] - public ImageVersionSecurityProfile SecurityProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageProfile")] + public GalleryImageVersionStorageProfile StorageProfile {get; set; } /// - /// Gets or sets indicates if this is a soft-delete resource - /// restoration request. + /// Gets or sets this is the safety profile of the Gallery Image Version. /// - [JsonProperty(PropertyName = "properties.restore")] - public bool? Restore { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.safetyProfile")] + public GalleryImageVersionSafetyProfile SafetyProfile {get; set; } /// - /// Gets this is the validations profile of a Gallery Image Version. + /// Gets or sets the security profile of a gallery image version /// - [JsonProperty(PropertyName = "properties.validationsProfile")] - public ValidationsProfile ValidationsProfile { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityProfile")] + public ImageVersionSecurityProfile SecurityProfile {get; set; } /// - /// Validate the object. + /// Gets or sets indicates if this is a soft-delete resource restoration + /// request. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (StorageProfile == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "StorageProfile"); - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.restore")] + public bool? Restore {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionsCreateOrUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionsCreateOrUpdateHeaders.cs index 21cd6dcce80a..0b8b220cb83e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionsCreateOrUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionsCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class GalleryImageVersionsCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// GalleryImageVersionsCreateOrUpdateHeaders class. + /// Initializes a new instance of the GalleryImageVersionsCreateOrUpdateHeaders class. /// public GalleryImageVersionsCreateOrUpdateHeaders() { @@ -28,18 +18,19 @@ public GalleryImageVersionsCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// GalleryImageVersionsCreateOrUpdateHeaders class. + /// Initializes a new instance of the GalleryImageVersionsCreateOrUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public GalleryImageVersionsCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public GalleryImageVersionsCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionsUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionsUpdateHeaders.cs index 79ef50659122..d4f8d46311a0 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionsUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImageVersionsUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Update operation. - /// public partial class GalleryImageVersionsUpdateHeaders { /// - /// Initializes a new instance of the GalleryImageVersionsUpdateHeaders - /// class. + /// Initializes a new instance of the GalleryImageVersionsUpdateHeaders class. /// public GalleryImageVersionsUpdateHeaders() { @@ -28,18 +18,19 @@ public GalleryImageVersionsUpdateHeaders() } /// - /// Initializes a new instance of the GalleryImageVersionsUpdateHeaders - /// class. + /// Initializes a new instance of the GalleryImageVersionsUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public GalleryImageVersionsUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public GalleryImageVersionsUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImagesCreateOrUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImagesCreateOrUpdateHeaders.cs index b3fb24898be3..16adf5c8f958 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImagesCreateOrUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImagesCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class GalleryImagesCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// GalleryImagesCreateOrUpdateHeaders class. + /// Initializes a new instance of the GalleryImagesCreateOrUpdateHeaders class. /// public GalleryImagesCreateOrUpdateHeaders() { @@ -28,18 +18,19 @@ public GalleryImagesCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// GalleryImagesCreateOrUpdateHeaders class. + /// Initializes a new instance of the GalleryImagesCreateOrUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public GalleryImagesCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public GalleryImagesCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImagesUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImagesUpdateHeaders.cs index f4c75f75cf53..5383e071fa2b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImagesUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryImagesUpdateHeaders.cs @@ -1,21 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Update operation. - /// public partial class GalleryImagesUpdateHeaders { /// @@ -29,15 +20,17 @@ public GalleryImagesUpdateHeaders() /// /// Initializes a new instance of the GalleryImagesUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public GalleryImagesUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -46,19 +39,17 @@ public GalleryImagesUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfile.cs index ffd7e2c17e28..98121621275b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfile.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Specifies information about the gallery inVMAccessControlProfile that - /// you want to create or update. + /// Specifies information about the gallery inVMAccessControlProfile that you + /// want to create or update. /// - public partial class GalleryInVMAccessControlProfile : Resource + public partial class GalleryInVMAccessControlProfile : TrackedResource { /// - /// Initializes a new instance of the GalleryInVMAccessControlProfile - /// class. + /// Initializes a new instance of the GalleryInVMAccessControlProfile class. /// public GalleryInVMAccessControlProfile() { @@ -31,20 +22,31 @@ public GalleryInVMAccessControlProfile() } /// - /// Initializes a new instance of the GalleryInVMAccessControlProfile - /// class. + /// Initializes a new instance of the GalleryInVMAccessControlProfile class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// Describes the properties of a gallery - /// inVMAccessControlProfile. - public GalleryInVMAccessControlProfile(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), GalleryInVMAccessControlProfileProperties properties = default(GalleryInVMAccessControlProfileProperties)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// Describes the properties of a gallery inVMAccessControlProfile. + /// + public GalleryInVMAccessControlProfile(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), GalleryInVMAccessControlProfileProperties properties = default(GalleryInVMAccessControlProfileProperties)) + + : base(location, id, name, type, tags) { - Properties = properties; + this.Properties = properties; CustomInit(); } @@ -53,26 +55,26 @@ public GalleryInVMAccessControlProfile() /// partial void CustomInit(); + /// /// Gets or sets describes the properties of a gallery /// inVMAccessControlProfile. /// - [JsonProperty(PropertyName = "properties")] - public GalleryInVMAccessControlProfileProperties Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public GalleryInVMAccessControlProfileProperties Properties {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (Properties != null) + if (this.Properties != null) { - Properties.Validate(); + this.Properties.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileProperties.cs index 76213ceb0dd2..b4c4588fcd45 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileProperties.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class GalleryInVMAccessControlProfileProperties : GalleryResourceProfilePropertiesBase { /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfileProperties class. + /// Initializes a new instance of the GalleryInVMAccessControlProfileProperties class. /// public GalleryInVMAccessControlProfileProperties() { @@ -28,29 +21,32 @@ public GalleryInVMAccessControlProfileProperties() } /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfileProperties class. + /// Initializes a new instance of the GalleryInVMAccessControlProfileProperties class. /// - /// This property allows you to specify the OS - /// type of the VMs/VMSS for which this profile can be used against. - /// Possible values are: 'Windows' or 'Linux'. Possible values include: - /// 'Windows', 'Linux' - /// This property allows you to - /// specify the Endpoint type for which this profile is defining the - /// access control for. Possible values are: 'WireServer' or 'IMDS'. - /// Possible values include: 'WireServer', 'IMDS' - /// The provisioning state, which only - /// appears in the response. Possible values include: 'Creating', - /// 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' - /// The description of this gallery - /// inVMAccessControlProfile resources. This property is - /// updatable. + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' + + /// The description of this gallery inVMAccessControlProfile resources. This + /// property is updatable. + /// + + /// This property allows you to specify the OS type of the VMs/VMSS for which + /// this profile can be used against. Possible values are: 'Windows' or 'Linux' + /// Possible values include: 'Windows', 'Linux' + + /// This property allows you to specify the Endpoint type for which this + /// profile is defining the access control for. Possible values are: + /// 'WireServer' or 'IMDS' + /// Possible values include: 'WireServer', 'IMDS' public GalleryInVMAccessControlProfileProperties(OperatingSystemTypes osType, EndpointTypes applicableHostEndpoint, string provisioningState = default(string), string description = default(string)) - : base(provisioningState) + + : base(provisioningState) { - Description = description; - OsType = osType; - ApplicableHostEndpoint = applicableHostEndpoint; + this.Description = description; + this.OsType = osType; + this.ApplicableHostEndpoint = applicableHostEndpoint; CustomInit(); } @@ -59,39 +55,40 @@ public GalleryInVMAccessControlProfileProperties() /// partial void CustomInit(); + /// - /// Gets or sets the description of this gallery - /// inVMAccessControlProfile resources. This property is updatable. + /// Gets or sets the description of this gallery inVMAccessControlProfile + /// resources. This property is updatable. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// /// Gets or sets this property allows you to specify the OS type of the - /// VMs/VMSS for which this profile can be used against. Possible - /// values are: 'Windows' or 'Linux'. Possible values include: - /// 'Windows', 'Linux' + /// VMs/VMSS for which this profile can be used against. Possible values are: + /// 'Windows' or 'Linux' Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "osType")] - public OperatingSystemTypes OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public OperatingSystemTypes OsType {get; set; } /// - /// Gets or sets this property allows you to specify the Endpoint type - /// for which this profile is defining the access control for. Possible - /// values are: 'WireServer' or 'IMDS'. Possible values include: - /// 'WireServer', 'IMDS' + /// Gets or sets this property allows you to specify the Endpoint type for + /// which this profile is defining the access control for. Possible values are: + /// 'WireServer' or 'IMDS' Possible values include: 'WireServer', 'IMDS' /// - [JsonProperty(PropertyName = "applicableHostEndpoint")] - public EndpointTypes ApplicableHostEndpoint { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "applicableHostEndpoint")] + public EndpointTypes ApplicableHostEndpoint {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileUpdate.cs index c74622b1ef7b..71619e596a6f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileUpdate.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Specifies information about the gallery inVMAccessControlProfile that - /// you want to update. + /// Specifies information about the gallery inVMAccessControlProfile that you + /// want to update. /// public partial class GalleryInVMAccessControlProfileUpdate : UpdateResourceDefinition { /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfileUpdate class. + /// Initializes a new instance of the GalleryInVMAccessControlProfileUpdate class. /// public GalleryInVMAccessControlProfileUpdate() { @@ -31,19 +22,28 @@ public GalleryInVMAccessControlProfileUpdate() } /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfileUpdate class. + /// Initializes a new instance of the GalleryInVMAccessControlProfileUpdate class. /// - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// Describes the properties of a gallery - /// inVMAccessControlProfile. - public GalleryInVMAccessControlProfileUpdate(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), GalleryInVMAccessControlProfileProperties properties = default(GalleryInVMAccessControlProfileProperties)) - : base(id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource tags + /// + + /// Describes the properties of a gallery inVMAccessControlProfile. + /// + public GalleryInVMAccessControlProfileUpdate(string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), GalleryInVMAccessControlProfileProperties properties = default(GalleryInVMAccessControlProfileProperties)) + + : base(id, name, type, tags) { - Properties = properties; + this.Properties = properties; CustomInit(); } @@ -52,25 +52,25 @@ public GalleryInVMAccessControlProfileUpdate() /// partial void CustomInit(); + /// /// Gets or sets describes the properties of a gallery /// inVMAccessControlProfile. /// - [JsonProperty(PropertyName = "properties")] - public GalleryInVMAccessControlProfileProperties Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public GalleryInVMAccessControlProfileProperties Properties {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Properties != null) + if (this.Properties != null) { - Properties.Validate(); + this.Properties.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersion.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersion.cs index c97f67e2c5ff..30943e341292 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersion.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersion.cs @@ -1,32 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Specifies information about the gallery inVMAccessControlProfile - /// version that you want to create or update. + /// Specifies information about the gallery inVMAccessControlProfile version + /// that you want to create or update. /// - [Rest.Serialization.JsonTransformation] - public partial class GalleryInVMAccessControlProfileVersion : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class GalleryInVMAccessControlProfileVersion : TrackedResource { /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfileVersion class. + /// Initializes a new instance of the GalleryInVMAccessControlProfileVersion class. /// public GalleryInVMAccessControlProfileVersion() { @@ -34,48 +23,66 @@ public GalleryInVMAccessControlProfileVersion() } /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfileVersion class. + /// Initializes a new instance of the GalleryInVMAccessControlProfileVersion class. /// - /// Resource location - /// This property allows you to specify whether the - /// access control rules are in Audit mode, in Enforce mode or - /// Disabled. Possible values are: 'Audit', 'Enforce' or 'Disabled'. - /// Possible values include: 'Audit', 'Enforce', 'Disabled' - /// This property allows you to specify if - /// the requests will be allowed to access the host endpoints. Possible - /// values are: 'Allow', 'Deny'. Possible values include: 'Allow', - /// 'Deny' - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The target regions where the Resource - /// Profile version is going to be replicated to. This property is - /// updatable. - /// If set to true, Virtual Machines - /// deployed from the latest version of the Resource Profile won't use - /// this Profile version. - /// The timestamp for when the Resource - /// Profile Version is published. - /// The provisioning state, which only - /// appears in the response. Possible values include: 'Creating', - /// 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' - /// This is the replication status of - /// the gallery image version. - /// This is the Access Control Rules specification - /// for an inVMAccessControlProfile version. - public GalleryInVMAccessControlProfileVersion(string location, string mode, string defaultAccess, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IList targetLocations = default(IList), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), string provisioningState = default(string), ReplicationStatus replicationStatus = default(ReplicationStatus), AccessControlRules rules = default(AccessControlRules)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// This is the replication status of the gallery image version. + /// + + /// The target regions where the Resource Profile version is going to be + /// replicated to. This property is updatable. + /// + + /// If set to true, Virtual Machines deployed from the latest version of the + /// Resource Profile won't use this Profile version. + /// + + /// The timestamp for when the Resource Profile Version is published. + /// + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' + + /// This property allows you to specify whether the access control rules are in + /// Audit mode, in Enforce mode or Disabled. Possible values are: 'Audit', + /// 'Enforce' or 'Disabled'. + /// Possible values include: 'Audit', 'Enforce', 'Disabled' + + /// This property allows you to specify if the requests will be allowed to + /// access the host endpoints. Possible values are: 'Allow', 'Deny'. + /// Possible values include: 'Allow', 'Deny' + + /// This is the Access Control Rules specification for an + /// inVMAccessControlProfile version. + /// + public GalleryInVMAccessControlProfileVersion(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ReplicationStatus replicationStatus = default(ReplicationStatus), System.Collections.Generic.IList targetLocations = default(System.Collections.Generic.IList), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), string provisioningState = default(string), string mode = default(string), string defaultAccess = default(string), AccessControlRules rules = default(AccessControlRules)) + + : base(location, id, name, type, tags) { - TargetLocations = targetLocations; - ExcludeFromLatest = excludeFromLatest; - PublishedDate = publishedDate; - ProvisioningState = provisioningState; - ReplicationStatus = replicationStatus; - Mode = mode; - DefaultAccess = defaultAccess; - Rules = rules; + this.ReplicationStatus = replicationStatus; + this.TargetLocations = targetLocations; + this.ExcludeFromLatest = excludeFromLatest; + this.PublishedDate = publishedDate; + this.ProvisioningState = provisioningState; + this.Mode = mode; + this.DefaultAccess = defaultAccess; + this.Rules = rules; CustomInit(); } @@ -84,86 +91,73 @@ public GalleryInVMAccessControlProfileVersion() /// partial void CustomInit(); + /// - /// Gets or sets the target regions where the Resource Profile version - /// is going to be replicated to. This property is updatable. + /// Gets this is the replication status of the gallery image version. /// - [JsonProperty(PropertyName = "properties.targetLocations")] - public IList TargetLocations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.replicationStatus")] + public ReplicationStatus ReplicationStatus {get; private set; } /// - /// Gets or sets if set to true, Virtual Machines deployed from the - /// latest version of the Resource Profile won't use this Profile - /// version. + /// Gets or sets the target regions where the Resource Profile version is going + /// to be replicated to. This property is updatable. /// - [JsonProperty(PropertyName = "properties.excludeFromLatest")] - public bool? ExcludeFromLatest { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.targetLocations")] + public System.Collections.Generic.IList TargetLocations {get; set; } /// - /// Gets the timestamp for when the Resource Profile Version is - /// published. + /// Gets or sets if set to true, Virtual Machines deployed from the latest + /// version of the Resource Profile won't use this Profile version. /// - [JsonProperty(PropertyName = "properties.publishedDate")] - public System.DateTime? PublishedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.excludeFromLatest")] + public bool? ExcludeFromLatest {get; set; } /// - /// Gets the provisioning state, which only appears in the response. - /// Possible values include: 'Creating', 'Updating', 'Failed', - /// 'Succeeded', 'Deleting', 'Migrating' + /// Gets the timestamp for when the Resource Profile Version is published. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publishedDate")] + public System.DateTime? PublishedDate {get; private set; } /// - /// Gets this is the replication status of the gallery image version. + /// Gets the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' /// - [JsonProperty(PropertyName = "properties.replicationStatus")] - public ReplicationStatus ReplicationStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets this property allows you to specify whether the access - /// control rules are in Audit mode, in Enforce mode or Disabled. - /// Possible values are: 'Audit', 'Enforce' or 'Disabled'. Possible - /// values include: 'Audit', 'Enforce', 'Disabled' + /// Gets or sets this property allows you to specify whether the access control + /// rules are in Audit mode, in Enforce mode or Disabled. Possible values are: + /// 'Audit', 'Enforce' or 'Disabled'. Possible values include: 'Audit', 'Enforce', 'Disabled' /// - [JsonProperty(PropertyName = "properties.mode")] - public string Mode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.mode")] + public string Mode {get; set; } /// - /// Gets or sets this property allows you to specify if the requests - /// will be allowed to access the host endpoints. Possible values are: - /// 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + /// Gets or sets this property allows you to specify if the requests will be + /// allowed to access the host endpoints. Possible values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' /// - [JsonProperty(PropertyName = "properties.defaultAccess")] - public string DefaultAccess { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultAccess")] + public string DefaultAccess {get; set; } /// /// Gets or sets this is the Access Control Rules specification for an /// inVMAccessControlProfile version. /// - [JsonProperty(PropertyName = "properties.rules")] - public AccessControlRules Rules { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.rules")] + public AccessControlRules Rules {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (Mode == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Mode"); - } - if (DefaultAccess == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DefaultAccess"); - } - if (TargetLocations != null) + + if (this.TargetLocations != null) { - foreach (var element in TargetLocations) + foreach (var element in this.TargetLocations) { if (element != null) { @@ -171,6 +165,10 @@ public override void Validate() } } } + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionProperties.cs new file mode 100644 index 000000000000..cbb0015511ff --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionProperties.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of an inVMAccessControlProfile version. + /// + public partial class GalleryInVMAccessControlProfileVersionProperties : GalleryResourceProfileVersionPropertiesBase + { + /// + /// Initializes a new instance of the GalleryInVMAccessControlProfileVersionProperties class. + /// + public GalleryInVMAccessControlProfileVersionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GalleryInVMAccessControlProfileVersionProperties class. + /// + + /// The target regions where the Resource Profile version is going to be + /// replicated to. This property is updatable. + /// + + /// If set to true, Virtual Machines deployed from the latest version of the + /// Resource Profile won't use this Profile version. + /// + + /// The timestamp for when the Resource Profile Version is published. + /// + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' + + /// This is the replication status of the gallery image version. + /// + + /// This property allows you to specify whether the access control rules are in + /// Audit mode, in Enforce mode or Disabled. Possible values are: 'Audit', + /// 'Enforce' or 'Disabled'. + /// Possible values include: 'Audit', 'Enforce', 'Disabled' + + /// This property allows you to specify if the requests will be allowed to + /// access the host endpoints. Possible values are: 'Allow', 'Deny'. + /// Possible values include: 'Allow', 'Deny' + + /// This is the Access Control Rules specification for an + /// inVMAccessControlProfile version. + /// + public GalleryInVMAccessControlProfileVersionProperties(string mode, string defaultAccess, System.Collections.Generic.IList targetLocations = default(System.Collections.Generic.IList), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), string provisioningState = default(string), ReplicationStatus replicationStatus = default(ReplicationStatus), AccessControlRules rules = default(AccessControlRules)) + + : base(targetLocations, excludeFromLatest, publishedDate, provisioningState, replicationStatus) + { + this.Mode = mode; + this.DefaultAccess = defaultAccess; + this.Rules = rules; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets this property allows you to specify whether the access control + /// rules are in Audit mode, in Enforce mode or Disabled. Possible values are: + /// 'Audit', 'Enforce' or 'Disabled'. Possible values include: 'Audit', 'Enforce', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "mode")] + public string Mode {get; set; } + + /// + /// Gets or sets this property allows you to specify if the requests will be + /// allowed to access the host endpoints. Possible values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultAccess")] + public string DefaultAccess {get; set; } + + /// + /// Gets or sets this is the Access Control Rules specification for an + /// inVMAccessControlProfile version. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] + public AccessControlRules Rules {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Mode == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Mode"); + } + if (this.DefaultAccess == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DefaultAccess"); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionUpdate.cs index c7a645315eca..f49476b7f26e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionUpdate.cs @@ -1,32 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Specifies information about the gallery inVMAccessControlProfile - /// version that you want to update. + /// Specifies information about the gallery inVMAccessControlProfile version + /// that you want to update. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class GalleryInVMAccessControlProfileVersionUpdate : UpdateResourceDefinition { /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfileVersionUpdate class. + /// Initializes a new instance of the GalleryInVMAccessControlProfileVersionUpdate class. /// public GalleryInVMAccessControlProfileVersionUpdate() { @@ -34,47 +23,63 @@ public GalleryInVMAccessControlProfileVersionUpdate() } /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfileVersionUpdate class. + /// Initializes a new instance of the GalleryInVMAccessControlProfileVersionUpdate class. /// - /// This property allows you to specify whether the - /// access control rules are in Audit mode, in Enforce mode or - /// Disabled. Possible values are: 'Audit', 'Enforce' or 'Disabled'. - /// Possible values include: 'Audit', 'Enforce', 'Disabled' - /// This property allows you to specify if - /// the requests will be allowed to access the host endpoints. Possible - /// values are: 'Allow', 'Deny'. Possible values include: 'Allow', - /// 'Deny' - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The target regions where the Resource - /// Profile version is going to be replicated to. This property is - /// updatable. - /// If set to true, Virtual Machines - /// deployed from the latest version of the Resource Profile won't use - /// this Profile version. - /// The timestamp for when the Resource - /// Profile Version is published. - /// The provisioning state, which only - /// appears in the response. Possible values include: 'Creating', - /// 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' - /// This is the replication status of - /// the gallery image version. - /// This is the Access Control Rules specification - /// for an inVMAccessControlProfile version. - public GalleryInVMAccessControlProfileVersionUpdate(string mode, string defaultAccess, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IList targetLocations = default(IList), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), string provisioningState = default(string), ReplicationStatus replicationStatus = default(ReplicationStatus), AccessControlRules rules = default(AccessControlRules)) - : base(id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource tags + /// + + /// This is the replication status of the gallery image version. + /// + + /// The target regions where the Resource Profile version is going to be + /// replicated to. This property is updatable. + /// + + /// If set to true, Virtual Machines deployed from the latest version of the + /// Resource Profile won't use this Profile version. + /// + + /// The timestamp for when the Resource Profile Version is published. + /// + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' + + /// This property allows you to specify whether the access control rules are in + /// Audit mode, in Enforce mode or Disabled. Possible values are: 'Audit', + /// 'Enforce' or 'Disabled'. + /// Possible values include: 'Audit', 'Enforce', 'Disabled' + + /// This property allows you to specify if the requests will be allowed to + /// access the host endpoints. Possible values are: 'Allow', 'Deny'. + /// Possible values include: 'Allow', 'Deny' + + /// This is the Access Control Rules specification for an + /// inVMAccessControlProfile version. + /// + public GalleryInVMAccessControlProfileVersionUpdate(string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ReplicationStatus replicationStatus = default(ReplicationStatus), System.Collections.Generic.IList targetLocations = default(System.Collections.Generic.IList), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), string provisioningState = default(string), string mode = default(string), string defaultAccess = default(string), AccessControlRules rules = default(AccessControlRules)) + + : base(id, name, type, tags) { - TargetLocations = targetLocations; - ExcludeFromLatest = excludeFromLatest; - PublishedDate = publishedDate; - ProvisioningState = provisioningState; - ReplicationStatus = replicationStatus; - Mode = mode; - DefaultAccess = defaultAccess; - Rules = rules; + this.ReplicationStatus = replicationStatus; + this.TargetLocations = targetLocations; + this.ExcludeFromLatest = excludeFromLatest; + this.PublishedDate = publishedDate; + this.ProvisioningState = provisioningState; + this.Mode = mode; + this.DefaultAccess = defaultAccess; + this.Rules = rules; CustomInit(); } @@ -83,92 +88,59 @@ public GalleryInVMAccessControlProfileVersionUpdate() /// partial void CustomInit(); + /// - /// Gets or sets the target regions where the Resource Profile version - /// is going to be replicated to. This property is updatable. + /// Gets this is the replication status of the gallery image version. /// - [JsonProperty(PropertyName = "properties.targetLocations")] - public IList TargetLocations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.replicationStatus")] + public ReplicationStatus ReplicationStatus {get; private set; } /// - /// Gets or sets if set to true, Virtual Machines deployed from the - /// latest version of the Resource Profile won't use this Profile - /// version. + /// Gets or sets the target regions where the Resource Profile version is going + /// to be replicated to. This property is updatable. /// - [JsonProperty(PropertyName = "properties.excludeFromLatest")] - public bool? ExcludeFromLatest { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.targetLocations")] + public System.Collections.Generic.IList TargetLocations {get; set; } /// - /// Gets the timestamp for when the Resource Profile Version is - /// published. + /// Gets or sets if set to true, Virtual Machines deployed from the latest + /// version of the Resource Profile won't use this Profile version. /// - [JsonProperty(PropertyName = "properties.publishedDate")] - public System.DateTime? PublishedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.excludeFromLatest")] + public bool? ExcludeFromLatest {get; set; } /// - /// Gets the provisioning state, which only appears in the response. - /// Possible values include: 'Creating', 'Updating', 'Failed', - /// 'Succeeded', 'Deleting', 'Migrating' + /// Gets the timestamp for when the Resource Profile Version is published. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publishedDate")] + public System.DateTime? PublishedDate {get; private set; } /// - /// Gets this is the replication status of the gallery image version. + /// Gets the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' /// - [JsonProperty(PropertyName = "properties.replicationStatus")] - public ReplicationStatus ReplicationStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets this property allows you to specify whether the access - /// control rules are in Audit mode, in Enforce mode or Disabled. - /// Possible values are: 'Audit', 'Enforce' or 'Disabled'. Possible - /// values include: 'Audit', 'Enforce', 'Disabled' + /// Gets or sets this property allows you to specify whether the access control + /// rules are in Audit mode, in Enforce mode or Disabled. Possible values are: + /// 'Audit', 'Enforce' or 'Disabled'. Possible values include: 'Audit', 'Enforce', 'Disabled' /// - [JsonProperty(PropertyName = "properties.mode")] - public string Mode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.mode")] + public string Mode {get; set; } /// - /// Gets or sets this property allows you to specify if the requests - /// will be allowed to access the host endpoints. Possible values are: - /// 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + /// Gets or sets this property allows you to specify if the requests will be + /// allowed to access the host endpoints. Possible values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' /// - [JsonProperty(PropertyName = "properties.defaultAccess")] - public string DefaultAccess { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultAccess")] + public string DefaultAccess {get; set; } /// /// Gets or sets this is the Access Control Rules specification for an /// inVMAccessControlProfile version. /// - [JsonProperty(PropertyName = "properties.rules")] - public AccessControlRules Rules { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Mode == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Mode"); - } - if (DefaultAccess == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DefaultAccess"); - } - if (TargetLocations != null) - { - foreach (var element in TargetLocations) - { - if (element != null) - { - element.Validate(); - } - } - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.rules")] + public AccessControlRules Rules {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionsCreateOrUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionsCreateOrUpdateHeaders.cs index 9b22438134b3..e64460e04b82 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionsCreateOrUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionsCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class GalleryInVMAccessControlProfileVersionsCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfileVersionsCreateOrUpdateHeaders class. + /// Initializes a new instance of the GalleryInVMAccessControlProfileVersionsCreateOrUpdateHeaders class. /// public GalleryInVMAccessControlProfileVersionsCreateOrUpdateHeaders() { @@ -28,18 +18,19 @@ public GalleryInVMAccessControlProfileVersionsCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfileVersionsCreateOrUpdateHeaders class. + /// Initializes a new instance of the GalleryInVMAccessControlProfileVersionsCreateOrUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public GalleryInVMAccessControlProfileVersionsCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public GalleryInVMAccessControlProfileVersionsCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionsDeleteHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionsDeleteHeaders.cs index 0ed361b03106..5ea3b42a2e51 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionsDeleteHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionsDeleteHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Delete operation. - /// public partial class GalleryInVMAccessControlProfileVersionsDeleteHeaders { /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfileVersionsDeleteHeaders class. + /// Initializes a new instance of the GalleryInVMAccessControlProfileVersionsDeleteHeaders class. /// public GalleryInVMAccessControlProfileVersionsDeleteHeaders() { @@ -28,17 +18,19 @@ public GalleryInVMAccessControlProfileVersionsDeleteHeaders() } /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfileVersionsDeleteHeaders class. + /// Initializes a new instance of the GalleryInVMAccessControlProfileVersionsDeleteHeaders class. /// - /// A link to the status - /// monitor - /// The Location header contains the URL where - /// the status of the long running operation can be checked. + + /// + /// + + /// + /// public GalleryInVMAccessControlProfileVersionsDeleteHeaders(string azureAsyncOperation = default(string), string location = default(string)) + { - AzureAsyncOperation = azureAsyncOperation; - Location = location; + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; CustomInit(); } @@ -47,18 +39,17 @@ public GalleryInVMAccessControlProfileVersionsDeleteHeaders() /// partial void CustomInit(); + /// - /// Gets or sets a link to the status monitor + /// Gets or sets /// - [JsonProperty(PropertyName = "Azure-AsyncOperation")] - public string AzureAsyncOperation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionsUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionsUpdateHeaders.cs index d834dc7137c0..4fa05bf022b1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionsUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfileVersionsUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Update operation. - /// public partial class GalleryInVMAccessControlProfileVersionsUpdateHeaders { /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfileVersionsUpdateHeaders class. + /// Initializes a new instance of the GalleryInVMAccessControlProfileVersionsUpdateHeaders class. /// public GalleryInVMAccessControlProfileVersionsUpdateHeaders() { @@ -28,18 +18,19 @@ public GalleryInVMAccessControlProfileVersionsUpdateHeaders() } /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfileVersionsUpdateHeaders class. + /// Initializes a new instance of the GalleryInVMAccessControlProfileVersionsUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public GalleryInVMAccessControlProfileVersionsUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public GalleryInVMAccessControlProfileVersionsUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfilesCreateOrUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfilesCreateOrUpdateHeaders.cs index 733a85469314..62b807ddb321 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfilesCreateOrUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfilesCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class GalleryInVMAccessControlProfilesCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfilesCreateOrUpdateHeaders class. + /// Initializes a new instance of the GalleryInVMAccessControlProfilesCreateOrUpdateHeaders class. /// public GalleryInVMAccessControlProfilesCreateOrUpdateHeaders() { @@ -28,18 +18,19 @@ public GalleryInVMAccessControlProfilesCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfilesCreateOrUpdateHeaders class. + /// Initializes a new instance of the GalleryInVMAccessControlProfilesCreateOrUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public GalleryInVMAccessControlProfilesCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public GalleryInVMAccessControlProfilesCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfilesDeleteHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfilesDeleteHeaders.cs index b2d66f67a9ca..08e98bbaf318 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfilesDeleteHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfilesDeleteHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Delete operation. - /// public partial class GalleryInVMAccessControlProfilesDeleteHeaders { /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfilesDeleteHeaders class. + /// Initializes a new instance of the GalleryInVMAccessControlProfilesDeleteHeaders class. /// public GalleryInVMAccessControlProfilesDeleteHeaders() { @@ -28,17 +18,19 @@ public GalleryInVMAccessControlProfilesDeleteHeaders() } /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfilesDeleteHeaders class. + /// Initializes a new instance of the GalleryInVMAccessControlProfilesDeleteHeaders class. /// - /// A link to the status - /// monitor - /// The Location header contains the URL where - /// the status of the long running operation can be checked. + + /// + /// + + /// + /// public GalleryInVMAccessControlProfilesDeleteHeaders(string azureAsyncOperation = default(string), string location = default(string)) + { - AzureAsyncOperation = azureAsyncOperation; - Location = location; + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; CustomInit(); } @@ -47,18 +39,17 @@ public GalleryInVMAccessControlProfilesDeleteHeaders() /// partial void CustomInit(); + /// - /// Gets or sets a link to the status monitor + /// Gets or sets /// - [JsonProperty(PropertyName = "Azure-AsyncOperation")] - public string AzureAsyncOperation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfilesUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfilesUpdateHeaders.cs index 4d19b6bdc86b..a027a9cc929a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfilesUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryInVMAccessControlProfilesUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Update operation. - /// public partial class GalleryInVMAccessControlProfilesUpdateHeaders { /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfilesUpdateHeaders class. + /// Initializes a new instance of the GalleryInVMAccessControlProfilesUpdateHeaders class. /// public GalleryInVMAccessControlProfilesUpdateHeaders() { @@ -28,18 +18,19 @@ public GalleryInVMAccessControlProfilesUpdateHeaders() } /// - /// Initializes a new instance of the - /// GalleryInVMAccessControlProfilesUpdateHeaders class. + /// Initializes a new instance of the GalleryInVMAccessControlProfilesUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public GalleryInVMAccessControlProfilesUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public GalleryInVMAccessControlProfilesUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryOSDiskImage.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryOSDiskImage.cs index 58dda2cfdcec..16c39f128ed7 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryOSDiskImage.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryOSDiskImage.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -28,14 +23,19 @@ public GalleryOSDiskImage() /// /// Initializes a new instance of the GalleryOSDiskImage class. /// - /// This property indicates the size of the VHD - /// to be created. - /// The host caching of the disk. Valid - /// values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values - /// include: 'None', 'ReadOnly', 'ReadWrite' - /// The source for the disk image. - public GalleryOSDiskImage(int? sizeInGB = default(int?), HostCaching? hostCaching = default(HostCaching?), GalleryDiskImageSource source = default(GalleryDiskImageSource)) - : base(sizeInGB, hostCaching, source) + + /// This property indicates the size of the VHD to be created. + /// + + /// The host caching of the disk. Valid values are 'None', 'ReadOnly', and + /// 'ReadWrite' + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + + /// The source for the disk image. + /// + public GalleryOSDiskImage(int? sizeInGb = default(int?), HostCaching? hostCaching = default(HostCaching?), GalleryDiskImageSource source = default(GalleryDiskImageSource)) + + : base(sizeInGb, hostCaching, source) { CustomInit(); } @@ -46,4 +46,4 @@ public GalleryOSDiskImage() partial void CustomInit(); } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryProperties.cs new file mode 100644 index 000000000000..7aed506f6924 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryProperties.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a Shared Image Gallery. + /// + public partial class GalleryProperties + { + /// + /// Initializes a new instance of the GalleryProperties class. + /// + public GalleryProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GalleryProperties class. + /// + + /// The description of this Shared Image Gallery resource. This property is + /// updatable. + /// + + /// Describes the gallery unique name. + /// + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' + + /// Profile for gallery sharing to subscription or tenant + /// + + /// Contains information about the soft deletion policy of the gallery. + /// + + /// Sharing status of current gallery. + /// + public GalleryProperties(string description = default(string), GalleryIdentifier identifier = default(GalleryIdentifier), string provisioningState = default(string), SharingProfile sharingProfile = default(SharingProfile), SoftDeletePolicy softDeletePolicy = default(SoftDeletePolicy), SharingStatus sharingStatus = default(SharingStatus)) + + { + this.Description = description; + this.Identifier = identifier; + this.ProvisioningState = provisioningState; + this.SharingProfile = sharingProfile; + this.SoftDeletePolicy = softDeletePolicy; + this.SharingStatus = sharingStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the description of this Shared Image Gallery resource. This + /// property is updatable. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } + + /// + /// Gets or sets describes the gallery unique name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identifier")] + public GalleryIdentifier Identifier {get; set; } + + /// + /// Gets the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets profile for gallery sharing to subscription or tenant + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sharingProfile")] + public SharingProfile SharingProfile {get; set; } + + /// + /// Gets or sets contains information about the soft deletion policy of the + /// gallery. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "softDeletePolicy")] + public SoftDeletePolicy SoftDeletePolicy {get; set; } + + /// + /// Gets sharing status of current gallery. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sharingStatus")] + public SharingStatus SharingStatus {get; private set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryProvisioningState.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryProvisioningState.cs index 41b216b9ce3f..1ac63d9d62c1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryProvisioningState.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryProvisioningState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for GalleryProvisioningState. /// + + public static class GalleryProvisioningState { public const string Creating = "Creating"; @@ -23,4 +20,4 @@ public static class GalleryProvisioningState public const string Deleting = "Deleting"; public const string Migrating = "Migrating"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryResourceProfilePropertiesBase.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryResourceProfilePropertiesBase.cs index c37d30f60a05..a9fe61a3cb98 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryResourceProfilePropertiesBase.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryResourceProfilePropertiesBase.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class GalleryResourceProfilePropertiesBase { /// - /// Initializes a new instance of the - /// GalleryResourceProfilePropertiesBase class. + /// Initializes a new instance of the GalleryResourceProfilePropertiesBase class. /// public GalleryResourceProfilePropertiesBase() { @@ -28,15 +21,16 @@ public GalleryResourceProfilePropertiesBase() } /// - /// Initializes a new instance of the - /// GalleryResourceProfilePropertiesBase class. + /// Initializes a new instance of the GalleryResourceProfilePropertiesBase class. /// - /// The provisioning state, which only - /// appears in the response. Possible values include: 'Creating', - /// 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' public GalleryResourceProfilePropertiesBase(string provisioningState = default(string)) + { - ProvisioningState = provisioningState; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -45,13 +39,11 @@ public GalleryResourceProfilePropertiesBase() /// partial void CustomInit(); + /// - /// Gets the provisioning state, which only appears in the response. - /// Possible values include: 'Creating', 'Updating', 'Failed', - /// 'Succeeded', 'Deleting', 'Migrating' + /// Gets the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' /// - [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryResourceProfileVersionPropertiesBase.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryResourceProfileVersionPropertiesBase.cs index 634cedcb8d22..0015bc755cc6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryResourceProfileVersionPropertiesBase.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryResourceProfileVersionPropertiesBase.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class GalleryResourceProfileVersionPropertiesBase { /// - /// Initializes a new instance of the - /// GalleryResourceProfileVersionPropertiesBase class. + /// Initializes a new instance of the GalleryResourceProfileVersionPropertiesBase class. /// public GalleryResourceProfileVersionPropertiesBase() { @@ -30,29 +21,34 @@ public GalleryResourceProfileVersionPropertiesBase() } /// - /// Initializes a new instance of the - /// GalleryResourceProfileVersionPropertiesBase class. + /// Initializes a new instance of the GalleryResourceProfileVersionPropertiesBase class. /// - /// The target regions where the Resource - /// Profile version is going to be replicated to. This property is - /// updatable. - /// If set to true, Virtual Machines - /// deployed from the latest version of the Resource Profile won't use - /// this Profile version. - /// The timestamp for when the Resource - /// Profile Version is published. - /// The provisioning state, which only - /// appears in the response. Possible values include: 'Creating', - /// 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' - /// This is the replication status of - /// the gallery image version. - public GalleryResourceProfileVersionPropertiesBase(IList targetLocations = default(IList), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), string provisioningState = default(string), ReplicationStatus replicationStatus = default(ReplicationStatus)) + + /// The target regions where the Resource Profile version is going to be + /// replicated to. This property is updatable. + /// + + /// If set to true, Virtual Machines deployed from the latest version of the + /// Resource Profile won't use this Profile version. + /// + + /// The timestamp for when the Resource Profile Version is published. + /// + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' + + /// This is the replication status of the gallery image version. + /// + public GalleryResourceProfileVersionPropertiesBase(System.Collections.Generic.IList targetLocations = default(System.Collections.Generic.IList), bool? excludeFromLatest = default(bool?), System.DateTime? publishedDate = default(System.DateTime?), string provisioningState = default(string), ReplicationStatus replicationStatus = default(ReplicationStatus)) + { - TargetLocations = targetLocations; - ExcludeFromLatest = excludeFromLatest; - PublishedDate = publishedDate; - ProvisioningState = provisioningState; - ReplicationStatus = replicationStatus; + this.TargetLocations = targetLocations; + this.ExcludeFromLatest = excludeFromLatest; + this.PublishedDate = publishedDate; + this.ProvisioningState = provisioningState; + this.ReplicationStatus = replicationStatus; CustomInit(); } @@ -61,41 +57,37 @@ public GalleryResourceProfileVersionPropertiesBase() /// partial void CustomInit(); + /// - /// Gets or sets the target regions where the Resource Profile version - /// is going to be replicated to. This property is updatable. + /// Gets or sets the target regions where the Resource Profile version is going + /// to be replicated to. This property is updatable. /// - [JsonProperty(PropertyName = "targetLocations")] - public IList TargetLocations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetLocations")] + public System.Collections.Generic.IList TargetLocations {get; set; } /// - /// Gets or sets if set to true, Virtual Machines deployed from the - /// latest version of the Resource Profile won't use this Profile - /// version. + /// Gets or sets if set to true, Virtual Machines deployed from the latest + /// version of the Resource Profile won't use this Profile version. /// - [JsonProperty(PropertyName = "excludeFromLatest")] - public bool? ExcludeFromLatest { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "excludeFromLatest")] + public bool? ExcludeFromLatest {get; set; } /// - /// Gets the timestamp for when the Resource Profile Version is - /// published. + /// Gets the timestamp for when the Resource Profile Version is published. /// - [JsonProperty(PropertyName = "publishedDate")] - public System.DateTime? PublishedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publishedDate")] + public System.DateTime? PublishedDate {get; private set; } /// - /// Gets the provisioning state, which only appears in the response. - /// Possible values include: 'Creating', 'Updating', 'Failed', - /// 'Succeeded', 'Deleting', 'Migrating' + /// Gets the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' /// - [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } /// /// Gets this is the replication status of the gallery image version. /// - [JsonProperty(PropertyName = "replicationStatus")] - public ReplicationStatus ReplicationStatus { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "replicationStatus")] + public ReplicationStatus ReplicationStatus {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySharingPermissionTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySharingPermissionTypes.cs index ae86b1d43aa6..4d9af43b772b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySharingPermissionTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySharingPermissionTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for GallerySharingPermissionTypes. /// + + public static class GallerySharingPermissionTypes { public const string Private = "Private"; public const string Groups = "Groups"; public const string Community = "Community"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySoftDeletedResource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySoftDeletedResource.cs index 9648744b55a8..f08b7e089ced 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySoftDeletedResource.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySoftDeletedResource.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The details information of soft-deleted resource. /// - [Rest.Serialization.JsonTransformation] - public partial class GallerySoftDeletedResource : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class GallerySoftDeletedResource : TrackedResource { /// /// Initializes a new instance of the GallerySoftDeletedResource class. @@ -34,23 +24,38 @@ public GallerySoftDeletedResource() /// /// Initializes a new instance of the GallerySoftDeletedResource class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// arm id of the soft-deleted - /// resource - /// artifact type of the - /// soft-deleted resource. Possible values include: 'Images' - /// The timestamp for when the resource - /// is soft-deleted. In dateTime offset format. - public GallerySoftDeletedResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string resourceArmId = default(string), string softDeletedArtifactType = default(string), string softDeletedTime = default(string)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// arm id of the soft-deleted resource + /// + + /// artifact type of the soft-deleted resource + /// Possible values include: 'Images' + + /// The timestamp for when the resource is soft-deleted. In dateTime offset + /// format. + /// + public GallerySoftDeletedResource(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string resourceArmId = default(string), string softDeletedArtifactType = default(string), string softDeletedTime = default(string)) + + : base(location, id, name, type, tags) { - ResourceArmId = resourceArmId; - SoftDeletedArtifactType = softDeletedArtifactType; - SoftDeletedTime = softDeletedTime; + this.ResourceArmId = resourceArmId; + this.SoftDeletedArtifactType = softDeletedArtifactType; + this.SoftDeletedTime = softDeletedTime; CustomInit(); } @@ -59,35 +64,37 @@ public GallerySoftDeletedResource() /// partial void CustomInit(); + /// /// Gets or sets arm id of the soft-deleted resource /// - [JsonProperty(PropertyName = "properties.resourceArmId")] - public string ResourceArmId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceArmId")] + public string ResourceArmId {get; set; } /// - /// Gets or sets artifact type of the soft-deleted resource. Possible - /// values include: 'Images' + /// Gets or sets artifact type of the soft-deleted resource Possible values include: 'Images' /// - [JsonProperty(PropertyName = "properties.softDeletedArtifactType")] - public string SoftDeletedArtifactType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.softDeletedArtifactType")] + public string SoftDeletedArtifactType {get; set; } /// - /// Gets or sets the timestamp for when the resource is soft-deleted. - /// In dateTime offset format. + /// Gets or sets the timestamp for when the resource is soft-deleted. In + /// dateTime offset format. /// - [JsonProperty(PropertyName = "properties.softDeletedTime")] - public string SoftDeletedTime { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.softDeletedTime")] + public string SoftDeletedTime {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySoftDeletedResourceProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySoftDeletedResourceProperties.cs new file mode 100644 index 000000000000..25bbd59a65b8 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GallerySoftDeletedResourceProperties.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a soft-deleted resource. + /// + public partial class GallerySoftDeletedResourceProperties + { + /// + /// Initializes a new instance of the GallerySoftDeletedResourceProperties class. + /// + public GallerySoftDeletedResourceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GallerySoftDeletedResourceProperties class. + /// + + /// arm id of the soft-deleted resource + /// + + /// artifact type of the soft-deleted resource + /// Possible values include: 'Images' + + /// The timestamp for when the resource is soft-deleted. In dateTime offset + /// format. + /// + public GallerySoftDeletedResourceProperties(string resourceArmId = default(string), string softDeletedArtifactType = default(string), string softDeletedTime = default(string)) + + { + this.ResourceArmId = resourceArmId; + this.SoftDeletedArtifactType = softDeletedArtifactType; + this.SoftDeletedTime = softDeletedTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets arm id of the soft-deleted resource + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceArmId")] + public string ResourceArmId {get; set; } + + /// + /// Gets or sets artifact type of the soft-deleted resource Possible values include: 'Images' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "softDeletedArtifactType")] + public string SoftDeletedArtifactType {get; set; } + + /// + /// Gets or sets the timestamp for when the resource is soft-deleted. In + /// dateTime offset format. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "softDeletedTime")] + public string SoftDeletedTime {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryTargetExtendedLocation.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryTargetExtendedLocation.cs index 0cc8c85ba519..67fe02042641 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryTargetExtendedLocation.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryTargetExtendedLocation.cs @@ -1,23 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; public partial class GalleryTargetExtendedLocation { /// - /// Initializes a new instance of the GalleryTargetExtendedLocation - /// class. + /// Initializes a new instance of the GalleryTargetExtendedLocation class. /// public GalleryTargetExtendedLocation() { @@ -25,29 +18,35 @@ public GalleryTargetExtendedLocation() } /// - /// Initializes a new instance of the GalleryTargetExtendedLocation - /// class. + /// Initializes a new instance of the GalleryTargetExtendedLocation class. /// - /// The name of the region. - /// The name of the extended - /// location. - /// 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. - /// Possible values include: 'Standard_LRS', 'Standard_ZRS', - /// 'StandardSSD_LRS', 'Premium_LRS' - /// Optional. Allows users to provide customer - /// managed keys for encrypting the OS and data disks in the gallery - /// artifact. + + /// The name of the region. + /// + + /// The name of the extended location. + /// + + /// 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. + /// Possible values include: 'Standard_LRS', 'Standard_ZRS', 'StandardSSD_LRS', + /// 'Premium_LRS' + + /// Optional. Allows users to provide customer managed keys for encrypting the + /// OS and data disks in the gallery artifact. + /// public GalleryTargetExtendedLocation(string name = default(string), GalleryExtendedLocation extendedLocation = default(GalleryExtendedLocation), int? extendedLocationReplicaCount = default(int?), string storageAccountType = default(string), EncryptionImages encryption = default(EncryptionImages)) + { - Name = name; - ExtendedLocation = extendedLocation; - ExtendedLocationReplicaCount = extendedLocationReplicaCount; - StorageAccountType = storageAccountType; - Encryption = encryption; + this.Name = name; + this.ExtendedLocation = extendedLocation; + this.ExtendedLocationReplicaCount = extendedLocationReplicaCount; + this.StorageAccountType = storageAccountType; + this.Encryption = encryption; CustomInit(); } @@ -56,39 +55,38 @@ public GalleryTargetExtendedLocation() /// partial void CustomInit(); + /// /// Gets or sets the name of the region. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the name of the extended location. /// - [JsonProperty(PropertyName = "extendedLocation")] - public GalleryExtendedLocation ExtendedLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public GalleryExtendedLocation ExtendedLocation {get; set; } /// - /// Gets or sets the number of replicas of the Image Version to be - /// created per extended location. This property is updatable. + /// Gets or sets the number of replicas of the Image Version to be created per + /// extended location. This property is updatable. /// - [JsonProperty(PropertyName = "extendedLocationReplicaCount")] - public int? ExtendedLocationReplicaCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocationReplicaCount")] + public int? ExtendedLocationReplicaCount {get; set; } /// - /// Gets or sets specifies the storage account type to be used to store - /// the image. This property is not updatable. Possible values include: - /// 'Standard_LRS', 'Standard_ZRS', 'StandardSSD_LRS', 'Premium_LRS' + /// Gets or sets specifies the storage account type to be used to store the + /// image. This property is not updatable. Possible values include: 'Standard_LRS', 'Standard_ZRS', 'StandardSSD_LRS', 'Premium_LRS' /// - [JsonProperty(PropertyName = "storageAccountType")] - public string StorageAccountType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountType")] + public string StorageAccountType {get; set; } /// - /// Gets or sets optional. Allows users to provide customer managed - /// keys for encrypting the OS and data disks in the gallery artifact. + /// Gets or sets optional. Allows users to provide customer managed keys for + /// encrypting the OS and data disks in the gallery artifact. /// - [JsonProperty(PropertyName = "encryption")] - public EncryptionImages Encryption { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "encryption")] + public EncryptionImages Encryption {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryUpdate.cs index 48a0a03c7d9c..5076d9c5795b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GalleryUpdate.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specifies information about the Shared Image Gallery that you want to /// update. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class GalleryUpdate : UpdateResourceDefinition { /// @@ -35,34 +25,52 @@ public GalleryUpdate() /// /// Initializes a new instance of the GalleryUpdate class. /// - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The description of this Shared Image - /// Gallery resource. This property is updatable. - /// Describes the gallery unique name. - /// The provisioning state, which only - /// appears in the response. Possible values include: 'Creating', - /// 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' - /// Profile for gallery sharing to - /// subscription or tenant - /// Contains information about the soft - /// deletion policy of the gallery. - /// Sharing status of current - /// gallery. - /// The identity of the gallery, if - /// configured. - public GalleryUpdate(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), GalleryIdentifier identifier = default(GalleryIdentifier), string provisioningState = default(string), SharingProfile sharingProfile = default(SharingProfile), SoftDeletePolicy softDeletePolicy = default(SoftDeletePolicy), SharingStatus sharingStatus = default(SharingStatus), GalleryIdentity identity = default(GalleryIdentity)) - : base(id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource tags + /// + + /// The identity of the gallery, if configured. + /// + + /// Profile for gallery sharing to subscription or tenant + /// + + /// Sharing status of current gallery. + /// + + /// The description of this Shared Image Gallery resource. This property is + /// updatable. + /// + + /// Describes the gallery unique name. + /// + + /// The provisioning state, which only appears in the response. + /// Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + /// 'Deleting', 'Migrating' + + /// Contains information about the soft deletion policy of the gallery. + /// + public GalleryUpdate(string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), GalleryIdentity identity = default(GalleryIdentity), SharingProfile sharingProfile = default(SharingProfile), SharingStatus sharingStatus = default(SharingStatus), string description = default(string), GalleryIdentifier identifier = default(GalleryIdentifier), string provisioningState = default(string), SoftDeletePolicy softDeletePolicy = default(SoftDeletePolicy)) + + : base(id, name, type, tags) { - Description = description; - Identifier = identifier; - ProvisioningState = provisioningState; - SharingProfile = sharingProfile; - SoftDeletePolicy = softDeletePolicy; - SharingStatus = sharingStatus; - Identity = identity; + this.Identity = identity; + this.SharingProfile = sharingProfile; + this.SharingStatus = sharingStatus; + this.Description = description; + this.Identifier = identifier; + this.ProvisioningState = provisioningState; + this.SoftDeletePolicy = softDeletePolicy; CustomInit(); } @@ -71,51 +79,49 @@ public GalleryUpdate() /// partial void CustomInit(); + /// - /// Gets or sets the description of this Shared Image Gallery resource. - /// This property is updatable. + /// Gets or sets the identity of the gallery, if configured. /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public GalleryIdentity Identity {get; set; } /// - /// Gets or sets describes the gallery unique name. + /// Gets or sets profile for gallery sharing to subscription or tenant /// - [JsonProperty(PropertyName = "properties.identifier")] - public GalleryIdentifier Identifier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sharingProfile")] + public SharingProfile SharingProfile {get; set; } /// - /// Gets the provisioning state, which only appears in the response. - /// Possible values include: 'Creating', 'Updating', 'Failed', - /// 'Succeeded', 'Deleting', 'Migrating' + /// Gets sharing status of current gallery. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sharingStatus")] + public SharingStatus SharingStatus {get; private set; } /// - /// Gets or sets profile for gallery sharing to subscription or tenant + /// Gets or sets the description of this Shared Image Gallery resource. This + /// property is updatable. /// - [JsonProperty(PropertyName = "properties.sharingProfile")] - public SharingProfile SharingProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description {get; set; } /// - /// Gets or sets contains information about the soft deletion policy of - /// the gallery. + /// Gets or sets describes the gallery unique name. /// - [JsonProperty(PropertyName = "properties.softDeletePolicy")] - public SoftDeletePolicy SoftDeletePolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.identifier")] + public GalleryIdentifier Identifier {get; set; } /// - /// Gets sharing status of current gallery. + /// Gets the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' /// - [JsonProperty(PropertyName = "properties.sharingStatus")] - public SharingStatus SharingStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the identity of the gallery, if configured. + /// Gets or sets contains information about the soft deletion policy of the + /// gallery. /// - [JsonProperty(PropertyName = "identity")] - public GalleryIdentity Identity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.softDeletePolicy")] + public SoftDeletePolicy SoftDeletePolicy {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/GrantAccessData.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/GrantAccessData.cs index f4b26f8af41b..382584c24308 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/GrantAccessData.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/GrantAccessData.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,22 +23,26 @@ public GrantAccessData() /// /// Initializes a new instance of the GrantAccessData class. /// - /// The Access Level, accepted values include - /// None, Read, Write. Possible values include: 'None', 'Read', - /// 'Write' - /// Time duration in seconds until the - /// SAS access expires. - /// Set this flag to true to get - /// additional SAS for VM guest state - /// Used to specify the file format when - /// making request for SAS on a VHDX file format snapshot. Possible - /// values include: 'VHD', 'VHDX' - public GrantAccessData(string access, int durationInSeconds, bool? getSecureVMGuestStateSAS = default(bool?), string fileFormat = default(string)) + + /// The Access Level, accepted values include None, Read, Write. + /// Possible values include: 'None', 'Read', 'Write' + + /// Time duration in seconds until the SAS access expires. + /// + + /// Set this flag to true to get additional SAS for VM guest state + /// + + /// Used to specify the file format when making request for SAS on a VHDX file + /// format snapshot + /// Possible values include: 'VHD', 'VHDX' + public GrantAccessData(string access, int durationInSeconds, bool? getSecureVMGuestStateSas = default(bool?), string fileFormat = default(string)) + { - Access = access; - DurationInSeconds = durationInSeconds; - GetSecureVMGuestStateSAS = getSecureVMGuestStateSAS; - FileFormat = fileFormat; + this.Access = access; + this.DurationInSeconds = durationInSeconds; + this.GetSecureVMGuestStateSas = getSecureVMGuestStateSas; + this.FileFormat = fileFormat; CustomInit(); } @@ -54,46 +51,45 @@ public GrantAccessData() /// partial void CustomInit(); + /// - /// Gets or sets the Access Level, accepted values include None, Read, - /// Write. Possible values include: 'None', 'Read', 'Write' + /// Gets or sets the Access Level, accepted values include None, Read, Write. Possible values include: 'None', 'Read', 'Write' /// - [JsonProperty(PropertyName = "access")] - public string Access { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "access")] + public string Access {get; set; } /// /// Gets or sets time duration in seconds until the SAS access expires. /// - [JsonProperty(PropertyName = "durationInSeconds")] - public int DurationInSeconds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "durationInSeconds")] + public int DurationInSeconds {get; set; } /// - /// Gets or sets set this flag to true to get additional SAS for VM - /// guest state + /// Gets or sets set this flag to true to get additional SAS for VM guest state /// - [JsonProperty(PropertyName = "getSecureVMGuestStateSAS")] - public bool? GetSecureVMGuestStateSAS { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "getSecureVMGuestStateSAS")] + public bool? GetSecureVMGuestStateSas {get; set; } /// - /// Gets or sets used to specify the file format when making request - /// for SAS on a VHDX file format snapshot. Possible values include: - /// 'VHD', 'VHDX' + /// Gets or sets used to specify the file format when making request for SAS on + /// a VHDX file format snapshot Possible values include: 'VHD', 'VHDX' /// - [JsonProperty(PropertyName = "fileFormat")] - public string FileFormat { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "fileFormat")] + public string FileFormat {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Access == null) + if (this.Access == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Access"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Access"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/HardwareProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/HardwareProfile.cs index 1ece1b9c2bf1..55fd50ca6b6a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/HardwareProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/HardwareProfile.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,80 +23,74 @@ public HardwareProfile() /// /// Initializes a new instance of the HardwareProfile class. /// - /// Specifies the size of the virtual machine. The - /// enum data type is currently deprecated and will be removed by - /// December 23rd 2023. The recommended way to get the list of - /// available sizes is using these APIs: [List all available virtual - /// machine sizes in an availability + + /// Specifies the size of the virtual machine. The enum data type is currently + /// deprecated and will be removed by December 23rd 2023. The recommended way + /// to get the list of available sizes is using these APIs: [List all available + /// virtual machine sizes in an availability /// set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes), /// [List all available virtual machine sizes in a region]( - /// https://docs.microsoft.com/rest/api/compute/resourceskus/list), - /// [List all available virtual machine sizes for + /// https://docs.microsoft.com/rest/api/compute/resourceskus/list), [List all + /// available virtual machine sizes for /// resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). - /// For more information about virtual machine sizes, see [Sizes for - /// virtual - /// machines](https://docs.microsoft.com/azure/virtual-machines/sizes). - /// The available VM sizes depend on region and availability set. - /// Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', - /// 'Basic_A3', 'Basic_A4', 'Standard_A0', 'Standard_A1', - /// 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', - /// 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', - /// 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', - /// 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', - /// 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', - /// 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', - /// 'Standard_B8ms', 'Standard_D1', 'Standard_D2', 'Standard_D3', - /// 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', - /// 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', - /// 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', - /// 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', - /// 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D64_v3', - /// 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', - /// 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', - /// 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', - /// 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', - /// 'Standard_DS2', 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', - /// 'Standard_DS12', 'Standard_DS13', 'Standard_DS14', - /// 'Standard_DS1_v2', 'Standard_DS2_v2', 'Standard_DS3_v2', - /// 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2', - /// 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', - /// 'Standard_DS15_v2', 'Standard_DS13-4_v2', 'Standard_DS13-2_v2', - /// 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', - /// 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', - /// 'Standard_E32_v3', 'Standard_E64_v3', 'Standard_E2s_v3', - /// 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', - /// 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_E32-16_v3', - /// 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', 'Standard_E64-16s_v3', - /// 'Standard_F1', 'Standard_F2', 'Standard_F4', 'Standard_F8', - /// 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', - /// 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', - /// 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', - /// 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', - /// 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', - /// 'Standard_G5', 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', - /// 'Standard_GS4', 'Standard_GS5', 'Standard_GS4-8', 'Standard_GS4-4', - /// 'Standard_GS5-16', 'Standard_GS5-8', 'Standard_H8', 'Standard_H16', - /// 'Standard_H8m', 'Standard_H16m', 'Standard_H16r', 'Standard_H16mr', - /// 'Standard_L4s', 'Standard_L8s', 'Standard_L16s', 'Standard_L32s', - /// 'Standard_M64s', 'Standard_M64ms', 'Standard_M128s', - /// 'Standard_M128ms', 'Standard_M64-32ms', 'Standard_M64-16ms', - /// 'Standard_M128-64ms', 'Standard_M128-32ms', 'Standard_NC6', - /// 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', - /// 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', - /// 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', - /// 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', - /// 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', - /// 'Standard_NV6', 'Standard_NV12', 'Standard_NV24' - /// Specifies the properties for - /// customizing the size of the virtual machine. Minimum api-version: - /// 2021-07-01. This feature is still in preview mode and is not - /// supported for VirtualMachineScaleSet. Please follow the - /// instructions in [VM Customization](https://aka.ms/vmcustomization) - /// for more details. + /// For more information about virtual machine sizes, see [Sizes for virtual + /// machines](https://docs.microsoft.com/azure/virtual-machines/sizes). The + /// available VM sizes depend on region and availability set. + /// Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', + /// 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', + /// 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', + /// 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + /// 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', + /// 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', + /// 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + /// 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', + /// 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', + /// 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', + /// 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + /// 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + /// 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + /// 'Standard_D64s_v3', 'Standard_D11_v2', 'Standard_D12_v2', + /// 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', + /// 'Standard_DS2', 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', + /// 'Standard_DS12', 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', + /// 'Standard_DS2_v2', 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', + /// 'Standard_DS11_v2', 'Standard_DS12_v2', 'Standard_DS13_v2', + /// 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_DS13-4_v2', + /// 'Standard_DS13-2_v2', 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', + /// 'Standard_E2_v3', 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', + /// 'Standard_E32_v3', 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', + /// 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E32s_v3', + /// 'Standard_E64s_v3', 'Standard_E32-16_v3', 'Standard_E32-8s_v3', + /// 'Standard_E64-32s_v3', 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', + /// 'Standard_F4', 'Standard_F8', 'Standard_F16', 'Standard_F1s', + /// 'Standard_F2s', 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', + /// 'Standard_F2s_v2', 'Standard_F4s_v2', 'Standard_F8s_v2', + /// 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + /// 'Standard_F72s_v2', 'Standard_G1', 'Standard_G2', 'Standard_G3', + /// 'Standard_G4', 'Standard_G5', 'Standard_GS1', 'Standard_GS2', + /// 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', 'Standard_GS4-8', + /// 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', 'Standard_H8', + /// 'Standard_H16', 'Standard_H8m', 'Standard_H16m', 'Standard_H16r', + /// 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', 'Standard_L16s', + /// 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', 'Standard_M128s', + /// 'Standard_M128ms', 'Standard_M64-32ms', 'Standard_M64-16ms', + /// 'Standard_M128-64ms', 'Standard_M128-32ms', 'Standard_NC6', + /// 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', 'Standard_NC6s_v2', + /// 'Standard_NC12s_v2', 'Standard_NC24s_v2', 'Standard_NC24rs_v2', + /// 'Standard_NC6s_v3', 'Standard_NC12s_v3', 'Standard_NC24s_v3', + /// 'Standard_NC24rs_v3', 'Standard_ND6s', 'Standard_ND12s', 'Standard_ND24s', + /// 'Standard_ND24rs', 'Standard_NV6', 'Standard_NV12', 'Standard_NV24' + + /// Specifies the properties for customizing the size of the virtual machine. + /// Minimum api-version: 2021-07-01. This feature is still in preview mode and + /// is not supported for VirtualMachineScaleSet. Please follow the instructions + /// in [VM Customization](https://aka.ms/vmcustomization) for more details. + /// public HardwareProfile(string vmSize = default(string), VMSizeProperties vmSizeProperties = default(VMSizeProperties)) + { - VmSize = vmSize; - VmSizeProperties = vmSizeProperties; + this.VmSize = vmSize; + this.VmSizeProperties = vmSizeProperties; CustomInit(); } @@ -111,84 +99,32 @@ public HardwareProfile() /// partial void CustomInit(); + /// - /// Gets or sets specifies the size of the virtual machine. The enum - /// data type is currently deprecated and will be removed by December - /// 23rd 2023. The recommended way to get the list of available sizes - /// is using these APIs: [List all available virtual machine sizes in - /// an availability + /// Gets or sets specifies the size of the virtual machine. The enum data type + /// is currently deprecated and will be removed by December 23rd 2023. The + /// recommended way to get the list of available sizes is using these APIs: + /// [List all available virtual machine sizes in an availability /// set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes), /// [List all available virtual machine sizes in a region]( - /// https://docs.microsoft.com/rest/api/compute/resourceskus/list), - /// [List all available virtual machine sizes for + /// https://docs.microsoft.com/rest/api/compute/resourceskus/list), [List all + /// available virtual machine sizes for /// resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). - /// For more information about virtual machine sizes, see [Sizes for - /// virtual - /// machines](https://docs.microsoft.com/azure/virtual-machines/sizes). - /// The available VM sizes depend on region and availability set. - /// Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', - /// 'Basic_A3', 'Basic_A4', 'Standard_A0', 'Standard_A1', - /// 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', - /// 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', - /// 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', - /// 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', - /// 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', - /// 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', - /// 'Standard_B8ms', 'Standard_D1', 'Standard_D2', 'Standard_D3', - /// 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', - /// 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', - /// 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', - /// 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', - /// 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D64_v3', - /// 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', - /// 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', - /// 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', - /// 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', - /// 'Standard_DS2', 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', - /// 'Standard_DS12', 'Standard_DS13', 'Standard_DS14', - /// 'Standard_DS1_v2', 'Standard_DS2_v2', 'Standard_DS3_v2', - /// 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2', - /// 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', - /// 'Standard_DS15_v2', 'Standard_DS13-4_v2', 'Standard_DS13-2_v2', - /// 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', - /// 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', - /// 'Standard_E32_v3', 'Standard_E64_v3', 'Standard_E2s_v3', - /// 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', - /// 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_E32-16_v3', - /// 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', 'Standard_E64-16s_v3', - /// 'Standard_F1', 'Standard_F2', 'Standard_F4', 'Standard_F8', - /// 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', - /// 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', - /// 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', - /// 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', - /// 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', - /// 'Standard_G5', 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', - /// 'Standard_GS4', 'Standard_GS5', 'Standard_GS4-8', 'Standard_GS4-4', - /// 'Standard_GS5-16', 'Standard_GS5-8', 'Standard_H8', 'Standard_H16', - /// 'Standard_H8m', 'Standard_H16m', 'Standard_H16r', 'Standard_H16mr', - /// 'Standard_L4s', 'Standard_L8s', 'Standard_L16s', 'Standard_L32s', - /// 'Standard_M64s', 'Standard_M64ms', 'Standard_M128s', - /// 'Standard_M128ms', 'Standard_M64-32ms', 'Standard_M64-16ms', - /// 'Standard_M128-64ms', 'Standard_M128-32ms', 'Standard_NC6', - /// 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', - /// 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', - /// 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', - /// 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', - /// 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', - /// 'Standard_NV6', 'Standard_NV12', 'Standard_NV24' + /// For more information about virtual machine sizes, see [Sizes for virtual + /// machines](https://docs.microsoft.com/azure/virtual-machines/sizes). The + /// available VM sizes depend on region and availability set. Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2', 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_DS13-4_v2', 'Standard_DS13-2_v2', 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', 'Standard_NV12', 'Standard_NV24' /// - [JsonProperty(PropertyName = "vmSize")] - public string VmSize { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vmSize")] + public string VmSize {get; set; } /// - /// Gets or sets specifies the properties for customizing the size of - /// the virtual machine. Minimum api-version: 2021-07-01. This feature - /// is still in preview mode and is not supported for - /// VirtualMachineScaleSet. Please follow the instructions in [VM - /// Customization](https://aka.ms/vmcustomization) for more details. + /// Gets or sets specifies the properties for customizing the size of the + /// virtual machine. Minimum api-version: 2021-07-01. This feature is still in + /// preview mode and is not supported for VirtualMachineScaleSet. Please follow + /// the instructions in [VM Customization](https://aka.ms/vmcustomization) for + /// more details. /// - [JsonProperty(PropertyName = "vmSizeProperties")] - public VMSizeProperties VmSizeProperties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "vmSizeProperties")] + public VMSizeProperties VmSizeProperties {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/HighSpeedInterconnectPlacement.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/HighSpeedInterconnectPlacement.cs index 04b4c22de687..d98e2cd683d1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/HighSpeedInterconnectPlacement.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/HighSpeedInterconnectPlacement.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for HighSpeedInterconnectPlacement. /// + + public static class HighSpeedInterconnectPlacement { /// @@ -25,4 +22,4 @@ public static class HighSpeedInterconnectPlacement /// public const string Trunk = "Trunk"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/HostCaching.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/HostCaching.cs index c140f5462331..75103bfca130 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/HostCaching.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/HostCaching.cs @@ -1,31 +1,24 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for HostCaching. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum HostCaching { - [EnumMember(Value = "None")] + [System.Runtime.Serialization.EnumMember(Value = "None")] None, - [EnumMember(Value = "ReadOnly")] + [System.Runtime.Serialization.EnumMember(Value = "ReadOnly")] ReadOnly, - [EnumMember(Value = "ReadWrite")] + [System.Runtime.Serialization.EnumMember(Value = "ReadWrite")] ReadWrite } internal static class HostCachingEnumExtension @@ -34,7 +27,6 @@ internal static string ToSerializedValue(this HostCaching? value) { return value == null ? null : ((HostCaching)value).ToSerializedValue(); } - internal static string ToSerializedValue(this HostCaching value) { switch( value ) @@ -48,7 +40,6 @@ internal static string ToSerializedValue(this HostCaching value) } return null; } - internal static HostCaching? ParseHostCaching(this string value) { switch( value ) @@ -63,4 +54,4 @@ internal static string ToSerializedValue(this HostCaching value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/HostEndpointSettings.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/HostEndpointSettings.cs index 7006177d0998..d31e6b665f73 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/HostEndpointSettings.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/HostEndpointSettings.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,20 +23,22 @@ public HostEndpointSettings() /// /// Initializes a new instance of the HostEndpointSettings class. /// - /// Specifies the execution mode. In Audit mode, the - /// system acts as if it is enforcing the access control policy, - /// including emitting access denial entries in the logs but it does - /// not actually deny any requests to host endpoints. In Enforce mode, - /// the system will enforce the access control and it is the - /// recommended mode of operation. Possible values include: 'Audit', - /// 'Enforce', 'Disabled' - /// Specifies the - /// InVMAccessControlProfileVersion resource id in the format of - /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{profile}/versions/{version} + + /// Specifies the execution mode. In Audit mode, the system acts as if it is + /// enforcing the access control policy, including emitting access denial + /// entries in the logs but it does not actually deny any requests to host + /// endpoints. In Enforce mode, the system will enforce the access control and + /// it is the recommended mode of operation. + /// Possible values include: 'Audit', 'Enforce', 'Disabled' + + /// Specifies the InVMAccessControlProfileVersion resource id in the format of + /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{profile}/versions/{version} + /// public HostEndpointSettings(string mode = default(string), string inVMAccessControlProfileReferenceId = default(string)) + { - Mode = mode; - InVMAccessControlProfileReferenceId = inVMAccessControlProfileReferenceId; + this.Mode = mode; + this.InVMAccessControlProfileReferenceId = inVMAccessControlProfileReferenceId; CustomInit(); } @@ -51,25 +47,23 @@ public HostEndpointSettings() /// partial void CustomInit(); + /// - /// Gets or sets specifies the execution mode. In Audit mode, the - /// system acts as if it is enforcing the access control policy, - /// including emitting access denial entries in the logs but it does - /// not actually deny any requests to host endpoints. In Enforce mode, - /// the system will enforce the access control and it is the - /// recommended mode of operation. Possible values include: 'Audit', - /// 'Enforce', 'Disabled' + /// Gets or sets specifies the execution mode. In Audit mode, the system acts + /// as if it is enforcing the access control policy, including emitting access + /// denial entries in the logs but it does not actually deny any requests to + /// host endpoints. In Enforce mode, the system will enforce the access control + /// and it is the recommended mode of operation. Possible values include: 'Audit', 'Enforce', 'Disabled' /// - [JsonProperty(PropertyName = "mode")] - public string Mode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "mode")] + public string Mode {get; set; } /// - /// Gets or sets specifies the InVMAccessControlProfileVersion resource - /// id in the format of + /// Gets or sets specifies the InVMAccessControlProfileVersion resource id in + /// the format of /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{profile}/versions/{version} /// - [JsonProperty(PropertyName = "inVMAccessControlProfileReferenceId")] - public string InVMAccessControlProfileReferenceId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "inVMAccessControlProfileReferenceId")] + public string InVMAccessControlProfileReferenceId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/HyperVGeneration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/HyperVGeneration.cs index 569343631696..03b6a4bbfec1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/HyperVGeneration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/HyperVGeneration.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for HyperVGeneration. /// + + public static class HyperVGeneration { public const string V1 = "V1"; public const string V2 = "V2"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/HyperVGenerationType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/HyperVGenerationType.cs index d8e6cbcd3646..85084db31d35 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/HyperVGenerationType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/HyperVGenerationType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for HyperVGenerationType. /// + + public static class HyperVGenerationType { public const string V1 = "V1"; public const string V2 = "V2"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/HyperVGenerationTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/HyperVGenerationTypes.cs index 50b687302386..f8b0797d7fb7 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/HyperVGenerationTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/HyperVGenerationTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for HyperVGenerationTypes. /// + + public static class HyperVGenerationTypes { public const string V1 = "V1"; public const string V2 = "V2"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/IPVersion.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/IPVersion.cs index b084ca6e2b50..7acf9467ff2e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/IPVersion.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/IPVersion.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for IPVersion. /// + + public static class IPVersion { public const string IPv4 = "IPv4"; public const string IPv6 = "IPv6"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/IPVersions.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/IPVersions.cs index 0cbb3a97bcd4..a0759600648f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/IPVersions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/IPVersions.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for IPVersions. /// + + public static class IPVersions { public const string IPv4 = "IPv4"; public const string IPv6 = "IPv6"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Image.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Image.cs index c844f7a144af..6910e06f1904 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Image.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/Image.cs @@ -1,20 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +12,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// copied before being attached to the virtual machine. If SourceImage is /// provided, the destination virtual hard drive must not exist. /// - [Rest.Serialization.JsonTransformation] - public partial class Image : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class Image : TrackedResource { /// /// Initializes a new instance of the Image class. @@ -36,33 +26,49 @@ public Image() /// /// Initializes a new instance of the Image class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The source virtual machine from - /// which Image is created. - /// Specifies the storage settings for the - /// virtual machine disks. - /// The provisioning state. - /// Specifies the HyperVGenerationType - /// of the VirtualMachine created from the image. From API Version - /// 2019-03-01 if the image source is a blob, then we need the user to - /// specify the value, if the source is managed resource like disk or - /// snapshot, we may require the user to specify the property if we - /// cannot deduce it from the source managed resource. Possible values - /// include: 'V1', 'V2' - /// The extended location of the - /// Image. - public Image(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SubResource sourceVirtualMachine = default(SubResource), ImageStorageProfile storageProfile = default(ImageStorageProfile), string provisioningState = default(string), string hyperVGeneration = default(string), ExtendedLocation extendedLocation = default(ExtendedLocation)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// The extended location of the Image. + /// + + /// The source virtual machine from which Image is created. + /// + + /// Specifies the storage settings for the virtual machine disks. + /// + + /// The provisioning state. + /// + + /// Specifies the HyperVGenerationType of the VirtualMachine created from the + /// image. From API Version 2019-03-01 if the image source is a blob, then we + /// need the user to specify the value, if the source is managed resource like + /// disk or snapshot, we may require the user to specify the property if we + /// cannot deduce it from the source managed resource. + /// Possible values include: 'V1', 'V2' + public Image(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), SubResource sourceVirtualMachine = default(SubResource), ImageStorageProfile storageProfile = default(ImageStorageProfile), string provisioningState = default(string), string hyperVGeneration = default(string)) + + : base(location, id, name, type, tags) { - SourceVirtualMachine = sourceVirtualMachine; - StorageProfile = storageProfile; - ProvisioningState = provisioningState; - HyperVGeneration = hyperVGeneration; - ExtendedLocation = extendedLocation; + this.ExtendedLocation = extendedLocation; + this.SourceVirtualMachine = sourceVirtualMachine; + this.StorageProfile = storageProfile; + this.ProvisioningState = provisioningState; + this.HyperVGeneration = hyperVGeneration; CustomInit(); } @@ -71,57 +77,57 @@ public Image() /// partial void CustomInit(); + /// - /// Gets or sets the source virtual machine from which Image is - /// created. + /// Gets or sets the extended location of the Image. /// - [JsonProperty(PropertyName = "properties.sourceVirtualMachine")] - public SubResource SourceVirtualMachine { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation {get; set; } /// - /// Gets or sets specifies the storage settings for the virtual machine - /// disks. + /// Gets or sets the source virtual machine from which Image is created. /// - [JsonProperty(PropertyName = "properties.storageProfile")] - public ImageStorageProfile StorageProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourceVirtualMachine")] + public SubResource SourceVirtualMachine {get; set; } /// - /// Gets the provisioning state. + /// Gets or sets specifies the storage settings for the virtual machine disks. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageProfile")] + public ImageStorageProfile StorageProfile {get; set; } /// - /// Gets or sets specifies the HyperVGenerationType of the - /// VirtualMachine created from the image. From API Version 2019-03-01 - /// if the image source is a blob, then we need the user to specify the - /// value, if the source is managed resource like disk or snapshot, we - /// may require the user to specify the property if we cannot deduce it - /// from the source managed resource. Possible values include: 'V1', - /// 'V2' + /// Gets the provisioning state. /// - [JsonProperty(PropertyName = "properties.hyperVGeneration")] - public string HyperVGeneration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the extended location of the Image. + /// Gets or sets specifies the HyperVGenerationType of the VirtualMachine + /// created from the image. From API Version 2019-03-01 if the image source is + /// a blob, then we need the user to specify the value, if the source is + /// managed resource like disk or snapshot, we may require the user to specify + /// the property if we cannot deduce it from the source managed resource. Possible values include: 'V1', 'V2' /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hyperVGeneration")] + public string HyperVGeneration {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (StorageProfile != null) + + + if (this.StorageProfile != null) { - StorageProfile.Validate(); + this.StorageProfile.Validate(); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageDataDisk.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageDataDisk.cs index d427719d6e52..fd29873d6a92 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageDataDisk.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageDataDisk.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,33 +23,44 @@ public ImageDataDisk() /// /// Initializes a new instance of the ImageDataDisk class. /// - /// Specifies the logical unit number of the data - /// disk. This value is used to identify data disks within the VM and - /// therefore must be unique for each data disk attached to a - /// VM. - /// The snapshot. - /// The managedDisk. - /// The Virtual Hard Disk. - /// Specifies the caching requirements. Possible - /// values are: **None,** **ReadOnly,** **ReadWrite.** The default - /// values are: **None for Standard storage. ReadOnly for Premium - /// storage.**. Possible values include: 'None', 'ReadOnly', - /// 'ReadWrite' - /// Specifies the size of empty data disks in - /// gigabytes. This element can be used to overwrite the name of the - /// disk in a virtual machine image. This value cannot be larger than - /// 1023 GB. - /// Specifies the storage account type - /// for the managed disk. NOTE: UltraSSD_LRS can only be used with data - /// disks, it cannot be used with OS Disk. Possible values include: - /// 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS', - /// 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' - /// Specifies the customer managed disk - /// encryption set resource id for the managed image disk. - public ImageDataDisk(int lun, SubResource snapshot = default(SubResource), SubResource managedDisk = default(SubResource), string blobUri = default(string), CachingTypes? caching = default(CachingTypes?), int? diskSizeGB = default(int?), string storageAccountType = default(string), DiskEncryptionSetParameters diskEncryptionSet = default(DiskEncryptionSetParameters)) - : base(snapshot, managedDisk, blobUri, caching, diskSizeGB, storageAccountType, diskEncryptionSet) + + /// The snapshot. + /// + + /// The managedDisk. + /// + + /// The Virtual Hard Disk. + /// + + /// Specifies the caching requirements. Possible values are: **None,** + /// **ReadOnly,** **ReadWrite.** The default values are: **None for Standard + /// storage. ReadOnly for Premium storage.** + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + + /// Specifies the size of empty data disks in gigabytes. This element can be + /// used to overwrite the name of the disk in a virtual machine image. This + /// value cannot be larger than 1023 GB. + /// + + /// Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + /// can only be used with data disks, it cannot be used with OS Disk. + /// Possible values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + /// 'UltraSSD_LRS', 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' + + /// Specifies the customer managed disk encryption set resource id for the + /// managed image disk. + /// + + /// Specifies the logical unit number of the data disk. This value is used to + /// identify data disks within the VM and therefore must be unique for each + /// data disk attached to a VM. + /// + public ImageDataDisk(int lun, SubResource snapshot = default(SubResource), SubResource managedDisk = default(SubResource), string blobUri = default(string), CachingTypes? caching = default(CachingTypes?), int? diskSizeGb = default(int?), string storageAccountType = default(string), DiskEncryptionSetParameters diskEncryptionSet = default(DiskEncryptionSetParameters)) + + : base(snapshot, managedDisk, blobUri, caching, diskSizeGb, storageAccountType, diskEncryptionSet) { - Lun = lun; + this.Lun = lun; CustomInit(); } @@ -64,18 +69,18 @@ public ImageDataDisk() /// partial void CustomInit(); + /// - /// Gets or sets specifies the logical unit number of the data disk. - /// This value is used to identify data disks within the VM and - /// therefore must be unique for each data disk attached to a VM. + /// Gets or sets specifies the logical unit number of the data disk. This value + /// is used to identify data disks within the VM and therefore must be unique + /// for each data disk attached to a VM. /// - [JsonProperty(PropertyName = "lun")] - public int Lun { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "lun")] + public int Lun {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() @@ -83,4 +88,4 @@ public virtual void Validate() //Nothing to validate } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageDeprecationStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageDeprecationStatus.cs index e3485a205445..11ca9885096c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageDeprecationStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageDeprecationStatus.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,20 +23,23 @@ public ImageDeprecationStatus() /// /// Initializes a new instance of the ImageDeprecationStatus class. /// - /// Describes the state of the image. Possible - /// values include: 'Active', 'ScheduledForDeprecation', - /// 'Deprecated' - /// The time, in future, at - /// which this image will be marked as deprecated. This scheduled time - /// is chosen by the Publisher. - /// Describes the alternative option - /// specified by the Publisher for this image when this image is - /// deprecated. + + /// Describes the state of the image. + /// Possible values include: 'Active', 'ScheduledForDeprecation', 'Deprecated' + + /// The time, in future, at which this image will be marked as deprecated. This + /// scheduled time is chosen by the Publisher. + /// + + /// Describes the alternative option specified by the Publisher for this image + /// when this image is deprecated. + /// public ImageDeprecationStatus(string imageState = default(string), System.DateTime? scheduledDeprecationTime = default(System.DateTime?), AlternativeOption alternativeOption = default(AlternativeOption)) + { - ImageState = imageState; - ScheduledDeprecationTime = scheduledDeprecationTime; - AlternativeOption = alternativeOption; + this.ImageState = imageState; + this.ScheduledDeprecationTime = scheduledDeprecationTime; + this.AlternativeOption = alternativeOption; CustomInit(); } @@ -51,27 +48,25 @@ public ImageDeprecationStatus() /// partial void CustomInit(); + /// - /// Gets or sets describes the state of the image. Possible values - /// include: 'Active', 'ScheduledForDeprecation', 'Deprecated' + /// Gets or sets describes the state of the image. Possible values include: 'Active', 'ScheduledForDeprecation', 'Deprecated' /// - [JsonProperty(PropertyName = "imageState")] - public string ImageState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "imageState")] + public string ImageState {get; set; } /// - /// Gets or sets the time, in future, at which this image will be - /// marked as deprecated. This scheduled time is chosen by the - /// Publisher. + /// Gets or sets the time, in future, at which this image will be marked as + /// deprecated. This scheduled time is chosen by the Publisher. /// - [JsonProperty(PropertyName = "scheduledDeprecationTime")] - public System.DateTime? ScheduledDeprecationTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "scheduledDeprecationTime")] + public System.DateTime? ScheduledDeprecationTime {get; set; } /// - /// Gets or sets describes the alternative option specified by the - /// Publisher for this image when this image is deprecated. + /// Gets or sets describes the alternative option specified by the Publisher + /// for this image when this image is deprecated. /// - [JsonProperty(PropertyName = "alternativeOption")] - public AlternativeOption AlternativeOption { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "alternativeOption")] + public AlternativeOption AlternativeOption {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageDisk.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageDisk.cs index e75a4a333176..c9d0c72c4d70 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageDisk.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageDisk.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,34 +23,44 @@ public ImageDisk() /// /// Initializes a new instance of the ImageDisk class. /// - /// The snapshot. - /// The managedDisk. - /// The Virtual Hard Disk. - /// Specifies the caching requirements. Possible - /// values are: **None,** **ReadOnly,** **ReadWrite.** The default - /// values are: **None for Standard storage. ReadOnly for Premium - /// storage.**. Possible values include: 'None', 'ReadOnly', - /// 'ReadWrite' - /// Specifies the size of empty data disks in - /// gigabytes. This element can be used to overwrite the name of the - /// disk in a virtual machine image. This value cannot be larger than - /// 1023 GB. - /// Specifies the storage account type - /// for the managed disk. NOTE: UltraSSD_LRS can only be used with data - /// disks, it cannot be used with OS Disk. Possible values include: - /// 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS', - /// 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' - /// Specifies the customer managed disk - /// encryption set resource id for the managed image disk. - public ImageDisk(SubResource snapshot = default(SubResource), SubResource managedDisk = default(SubResource), string blobUri = default(string), CachingTypes? caching = default(CachingTypes?), int? diskSizeGB = default(int?), string storageAccountType = default(string), DiskEncryptionSetParameters diskEncryptionSet = default(DiskEncryptionSetParameters)) + + /// The snapshot. + /// + + /// The managedDisk. + /// + + /// The Virtual Hard Disk. + /// + + /// Specifies the caching requirements. Possible values are: **None,** + /// **ReadOnly,** **ReadWrite.** The default values are: **None for Standard + /// storage. ReadOnly for Premium storage.** + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + + /// Specifies the size of empty data disks in gigabytes. This element can be + /// used to overwrite the name of the disk in a virtual machine image. This + /// value cannot be larger than 1023 GB. + /// + + /// Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + /// can only be used with data disks, it cannot be used with OS Disk. + /// Possible values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + /// 'UltraSSD_LRS', 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' + + /// Specifies the customer managed disk encryption set resource id for the + /// managed image disk. + /// + public ImageDisk(SubResource snapshot = default(SubResource), SubResource managedDisk = default(SubResource), string blobUri = default(string), CachingTypes? caching = default(CachingTypes?), int? diskSizeGb = default(int?), string storageAccountType = default(string), DiskEncryptionSetParameters diskEncryptionSet = default(DiskEncryptionSetParameters)) + { - Snapshot = snapshot; - ManagedDisk = managedDisk; - BlobUri = blobUri; - Caching = caching; - DiskSizeGB = diskSizeGB; - StorageAccountType = storageAccountType; - DiskEncryptionSet = diskEncryptionSet; + this.Snapshot = snapshot; + this.ManagedDisk = managedDisk; + this.BlobUri = blobUri; + this.Caching = caching; + this.DiskSizeGB = diskSizeGb; + this.StorageAccountType = storageAccountType; + this.DiskEncryptionSet = diskEncryptionSet; CustomInit(); } @@ -65,57 +69,54 @@ public ImageDisk() /// partial void CustomInit(); + /// /// Gets or sets the snapshot. /// - [JsonProperty(PropertyName = "snapshot")] - public SubResource Snapshot { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "snapshot")] + public SubResource Snapshot {get; set; } /// /// Gets or sets the managedDisk. /// - [JsonProperty(PropertyName = "managedDisk")] - public SubResource ManagedDisk { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managedDisk")] + public SubResource ManagedDisk {get; set; } /// /// Gets or sets the Virtual Hard Disk. /// - [JsonProperty(PropertyName = "blobUri")] - public string BlobUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "blobUri")] + public string BlobUri {get; set; } /// - /// Gets or sets specifies the caching requirements. Possible values - /// are: **None,** **ReadOnly,** **ReadWrite.** The default values are: - /// **None for Standard storage. ReadOnly for Premium storage.**. - /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + /// Gets or sets specifies the caching requirements. Possible values are: + /// **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for + /// Standard storage. ReadOnly for Premium storage.** Possible values include: 'None', 'ReadOnly', 'ReadWrite' /// - [JsonProperty(PropertyName = "caching")] - public CachingTypes? Caching { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "caching")] + public CachingTypes? Caching {get; set; } /// - /// Gets or sets specifies the size of empty data disks in gigabytes. - /// This element can be used to overwrite the name of the disk in a - /// virtual machine image. This value cannot be larger than 1023 GB. + /// Gets or sets specifies the size of empty data disks in gigabytes. This + /// element can be used to overwrite the name of the disk in a virtual machine + /// image. This value cannot be larger than 1023 GB. /// - [JsonProperty(PropertyName = "diskSizeGB")] - public int? DiskSizeGB { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeGB")] + public int? DiskSizeGB {get; set; } /// - /// Gets or sets specifies the storage account type for the managed - /// disk. NOTE: UltraSSD_LRS can only be used with data disks, it - /// cannot be used with OS Disk. Possible values include: - /// 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS', - /// 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' + /// Gets or sets specifies the storage account type for the managed disk. NOTE: + /// UltraSSD_LRS can only be used with data disks, it cannot be used with OS + /// Disk. Possible values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS', 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' /// - [JsonProperty(PropertyName = "storageAccountType")] - public string StorageAccountType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountType")] + public string StorageAccountType {get; set; } /// - /// Gets or sets specifies the customer managed disk encryption set - /// resource id for the managed image disk. + /// Gets or sets specifies the customer managed disk encryption set resource id + /// for the managed image disk. /// - [JsonProperty(PropertyName = "diskEncryptionSet")] - public DiskEncryptionSetParameters DiskEncryptionSet { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "diskEncryptionSet")] + public DiskEncryptionSetParameters DiskEncryptionSet {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageDiskReference.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageDiskReference.cs index 7b02864e315a..bf5c0f124664 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageDiskReference.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageDiskReference.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,22 +23,30 @@ public ImageDiskReference() /// /// Initializes a new instance of the ImageDiskReference class. /// - /// A relative uri containing either a Platform Image - /// Repository, user image, or Azure Compute Gallery image - /// reference. - /// A relative uri containing a - /// direct shared Azure Compute Gallery image reference. - /// A relative uri containing a - /// community Azure Compute Gallery image reference. - /// If the disk is created from an image's data disk, - /// this is an index that indicates which of the data disks in the - /// image to use. For OS disks, this field is null. + + /// A relative uri containing either a Platform Image Repository, user image, + /// or Azure Compute Gallery image reference. + /// + + /// A relative uri containing a direct shared Azure Compute Gallery image + /// reference. + /// + + /// A relative uri containing a community Azure Compute Gallery image + /// reference. + /// + + /// If the disk is created from an image's data disk, this is an index that + /// indicates which of the data disks in the image to use. For OS disks, this + /// field is null. + /// public ImageDiskReference(string id = default(string), string sharedGalleryImageId = default(string), string communityGalleryImageId = default(string), int? lun = default(int?)) + { - Id = id; - SharedGalleryImageId = sharedGalleryImageId; - CommunityGalleryImageId = communityGalleryImageId; - Lun = lun; + this.Id = id; + this.SharedGalleryImageId = sharedGalleryImageId; + this.CommunityGalleryImageId = communityGalleryImageId; + this.Lun = lun; CustomInit(); } @@ -53,34 +55,34 @@ public ImageDiskReference() /// partial void CustomInit(); - /// - /// Gets or sets a relative uri containing either a Platform Image - /// Repository, user image, or Azure Compute Gallery image reference. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } /// - /// Gets or sets a relative uri containing a direct shared Azure - /// Compute Gallery image reference. + /// Gets or sets a relative uri containing either a Platform Image Repository, + /// user image, or Azure Compute Gallery image reference. /// - [JsonProperty(PropertyName = "sharedGalleryImageId")] - public string SharedGalleryImageId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// - /// Gets or sets a relative uri containing a community Azure Compute + /// Gets or sets a relative uri containing a direct shared Azure Compute /// Gallery image reference. /// - [JsonProperty(PropertyName = "communityGalleryImageId")] - public string CommunityGalleryImageId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sharedGalleryImageId")] + public string SharedGalleryImageId {get; set; } /// - /// Gets or sets if the disk is created from an image's data disk, this - /// is an index that indicates which of the data disks in the image to - /// use. For OS disks, this field is null. + /// Gets or sets a relative uri containing a community Azure Compute Gallery + /// image reference. /// - [JsonProperty(PropertyName = "lun")] - public int? Lun { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "communityGalleryImageId")] + public string CommunityGalleryImageId {get; set; } + /// + /// Gets or sets if the disk is created from an image's data disk, this is an + /// index that indicates which of the data disks in the image to use. For OS + /// disks, this field is null. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lun")] + public int? Lun {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageOSDisk.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageOSDisk.cs index 37fe4872237c..525fbac33ffd 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageOSDisk.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageOSDisk.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,37 +23,48 @@ public ImageOSDisk() /// /// Initializes a new instance of the ImageOSDisk class. /// - /// This property allows you to specify the type - /// of the OS that is included in the disk if creating a VM from a - /// custom image. Possible values are: **Windows,** **Linux.**. - /// Possible values include: 'Windows', 'Linux' - /// The OS State. For managed images, use - /// Generalized. Possible values include: 'Generalized', - /// 'Specialized' - /// The snapshot. - /// The managedDisk. - /// The Virtual Hard Disk. - /// Specifies the caching requirements. Possible - /// values are: **None,** **ReadOnly,** **ReadWrite.** The default - /// values are: **None for Standard storage. ReadOnly for Premium - /// storage.**. Possible values include: 'None', 'ReadOnly', - /// 'ReadWrite' - /// Specifies the size of empty data disks in - /// gigabytes. This element can be used to overwrite the name of the - /// disk in a virtual machine image. This value cannot be larger than - /// 1023 GB. - /// Specifies the storage account type - /// for the managed disk. NOTE: UltraSSD_LRS can only be used with data - /// disks, it cannot be used with OS Disk. Possible values include: - /// 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS', - /// 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' - /// Specifies the customer managed disk - /// encryption set resource id for the managed image disk. - public ImageOSDisk(OperatingSystemTypes osType, OperatingSystemStateTypes osState, SubResource snapshot = default(SubResource), SubResource managedDisk = default(SubResource), string blobUri = default(string), CachingTypes? caching = default(CachingTypes?), int? diskSizeGB = default(int?), string storageAccountType = default(string), DiskEncryptionSetParameters diskEncryptionSet = default(DiskEncryptionSetParameters)) - : base(snapshot, managedDisk, blobUri, caching, diskSizeGB, storageAccountType, diskEncryptionSet) + + /// The snapshot. + /// + + /// The managedDisk. + /// + + /// The Virtual Hard Disk. + /// + + /// Specifies the caching requirements. Possible values are: **None,** + /// **ReadOnly,** **ReadWrite.** The default values are: **None for Standard + /// storage. ReadOnly for Premium storage.** + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + + /// Specifies the size of empty data disks in gigabytes. This element can be + /// used to overwrite the name of the disk in a virtual machine image. This + /// value cannot be larger than 1023 GB. + /// + + /// Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + /// can only be used with data disks, it cannot be used with OS Disk. + /// Possible values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + /// 'UltraSSD_LRS', 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' + + /// Specifies the customer managed disk encryption set resource id for the + /// managed image disk. + /// + + /// This property allows you to specify the type of the OS that is included in + /// the disk if creating a VM from a custom image. Possible values are: + /// **Windows,** **Linux.** + /// Possible values include: 'Windows', 'Linux' + + /// The OS State. For managed images, use Generalized. + /// Possible values include: 'Generalized', 'Specialized' + public ImageOSDisk(OperatingSystemTypes osType, OperatingSystemStateTypes osState, SubResource snapshot = default(SubResource), SubResource managedDisk = default(SubResource), string blobUri = default(string), CachingTypes? caching = default(CachingTypes?), int? diskSizeGb = default(int?), string storageAccountType = default(string), DiskEncryptionSetParameters diskEncryptionSet = default(DiskEncryptionSetParameters)) + + : base(snapshot, managedDisk, blobUri, caching, diskSizeGb, storageAccountType, diskEncryptionSet) { - OsType = osType; - OsState = osState; + this.OsType = osType; + this.OsState = osState; CustomInit(); } @@ -68,30 +73,30 @@ public ImageOSDisk() /// partial void CustomInit(); + /// - /// Gets or sets this property allows you to specify the type of the OS - /// that is included in the disk if creating a VM from a custom image. - /// Possible values are: **Windows,** **Linux.**. Possible values - /// include: 'Windows', 'Linux' + /// Gets or sets this property allows you to specify the type of the OS that is + /// included in the disk if creating a VM from a custom image. Possible values + /// are: **Windows,** **Linux.** Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "osType")] - public OperatingSystemTypes OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public OperatingSystemTypes OsType {get; set; } /// - /// Gets or sets the OS State. For managed images, use Generalized. - /// Possible values include: 'Generalized', 'Specialized' + /// Gets or sets the OS State. For managed images, use Generalized. Possible values include: 'Generalized', 'Specialized' /// - [JsonProperty(PropertyName = "osState")] - public OperatingSystemStateTypes OsState { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "osState")] + public OperatingSystemStateTypes OsState {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageProperties.cs new file mode 100644 index 000000000000..7e977ae2253a --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageProperties.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of an Image. + /// + public partial class ImageProperties + { + /// + /// Initializes a new instance of the ImageProperties class. + /// + public ImageProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ImageProperties class. + /// + + /// The source virtual machine from which Image is created. + /// + + /// Specifies the storage settings for the virtual machine disks. + /// + + /// The provisioning state. + /// + + /// Specifies the HyperVGenerationType of the VirtualMachine created from the + /// image. From API Version 2019-03-01 if the image source is a blob, then we + /// need the user to specify the value, if the source is managed resource like + /// disk or snapshot, we may require the user to specify the property if we + /// cannot deduce it from the source managed resource. + /// Possible values include: 'V1', 'V2' + public ImageProperties(SubResource sourceVirtualMachine = default(SubResource), ImageStorageProfile storageProfile = default(ImageStorageProfile), string provisioningState = default(string), string hyperVGeneration = default(string)) + + { + this.SourceVirtualMachine = sourceVirtualMachine; + this.StorageProfile = storageProfile; + this.ProvisioningState = provisioningState; + this.HyperVGeneration = hyperVGeneration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the source virtual machine from which Image is created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceVirtualMachine")] + public SubResource SourceVirtualMachine {get; set; } + + /// + /// Gets or sets specifies the storage settings for the virtual machine disks. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageProfile")] + public ImageStorageProfile StorageProfile {get; set; } + + /// + /// Gets the provisioning state. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets specifies the HyperVGenerationType of the VirtualMachine + /// created from the image. From API Version 2019-03-01 if the image source is + /// a blob, then we need the user to specify the value, if the source is + /// managed resource like disk or snapshot, we may require the user to specify + /// the property if we cannot deduce it from the source managed resource. Possible values include: 'V1', 'V2' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hyperVGeneration")] + public string HyperVGeneration {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + if (this.StorageProfile != null) + { + this.StorageProfile.Validate(); + } + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImagePurchasePlan.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImagePurchasePlan.cs index 491af12db0e4..2aecdbe41617 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ImagePurchasePlan.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImagePurchasePlan.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -30,14 +24,21 @@ public ImagePurchasePlan() /// /// Initializes a new instance of the ImagePurchasePlan class. /// - /// The plan ID. - /// The publisher ID. - /// The product ID. + + /// The plan ID. + /// + + /// The publisher ID. + /// + + /// The product ID. + /// public ImagePurchasePlan(string name = default(string), string publisher = default(string), string product = default(string)) + { - Name = name; - Publisher = publisher; - Product = product; + this.Name = name; + this.Publisher = publisher; + this.Product = product; CustomInit(); } @@ -46,23 +47,23 @@ public ImagePurchasePlan() /// partial void CustomInit(); + /// /// Gets or sets the plan ID. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the publisher ID. /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publisher")] + public string Publisher {get; set; } /// /// Gets or sets the product ID. /// - [JsonProperty(PropertyName = "product")] - public string Product { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "product")] + public string Product {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageReference.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageReference.cs index e1093f302a46..068bc7f06cac 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageReference.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageReference.cs @@ -1,25 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Specifies information about the image to use. You can specify - /// information about platform images, marketplace images, or virtual - /// machine images. This element is required when you want to use a - /// platform image, marketplace image, or virtual machine image, but is not - /// used in other creation operations. NOTE: Image reference publisher and - /// offer can only be set when you create the scale set. + /// Specifies information about the image to use. You can specify information + /// about platform images, marketplace images, or virtual machine images. This + /// element is required when you want to use a platform image, marketplace + /// image, or virtual machine image, but is not used in other creation + /// operations. NOTE: Image reference publisher and offer can only be set when + /// you create the scale set. /// public partial class ImageReference : SubResource { @@ -34,43 +28,55 @@ public ImageReference() /// /// Initializes a new instance of the ImageReference class. /// - /// Resource Id - /// The image publisher. - /// Specifies the offer of the platform image or - /// marketplace image used to create the virtual machine. - /// The image SKU. - /// Specifies the version of the platform image - /// or marketplace image used to create the virtual machine. The - /// allowed formats are Major.Minor.Build or 'latest'. Major, Minor, - /// and Build are decimal numbers. Specify 'latest' to use the latest - /// version of an image available at deploy time. Even if you use - /// 'latest', the VM image will not automatically update after deploy - /// time even if a new version becomes available. Please do not use - /// field 'version' for gallery image deployment, gallery image should - /// always use 'id' field for deployment, to use 'latest' version of - /// gallery image, just set - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' - /// in the 'id' field without version input. - /// Specifies in decimal numbers, the - /// version of platform image or marketplace image used to create the - /// virtual machine. This readonly field differs from 'version', only - /// if the value specified in 'version' field is 'latest'. - /// Specified the shared gallery - /// image unique id for vm deployment. This can be fetched from shared - /// gallery image GET call. - /// Specified the community - /// gallery image unique id for vm deployment. This can be fetched from - /// community gallery image GET call. + + /// Resource Id + /// + + /// The image publisher. + /// + + /// Specifies the offer of the platform image or marketplace image used to + /// create the virtual machine. + /// + + /// The image SKU. + /// + + /// Specifies the version of the platform image or marketplace image used to + /// create the virtual machine. The allowed formats are Major.Minor.Build or + /// 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + /// use the latest version of an image available at deploy time. Even if you + /// use 'latest', the VM image will not automatically update after deploy time + /// even if a new version becomes available. Please do not use field 'version' + /// for gallery image deployment, gallery image should always use 'id' field + /// for deployment, to use 'latest' version of gallery image, just set + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' + /// in the 'id' field without version input. + /// + + /// Specifies in decimal numbers, the version of platform image or marketplace + /// image used to create the virtual machine. This readonly field differs from + /// 'version', only if the value specified in 'version' field is 'latest'. + /// + + /// Specified the shared gallery image unique id for vm deployment. This can be + /// fetched from shared gallery image GET call. + /// + + /// Specified the community gallery image unique id for vm deployment. This can + /// be fetched from community gallery image GET call. + /// public ImageReference(string id = default(string), string publisher = default(string), string offer = default(string), string sku = default(string), string version = default(string), string exactVersion = default(string), string sharedGalleryImageId = default(string), string communityGalleryImageId = default(string)) - : base(id) + + : base(id) { - Publisher = publisher; - Offer = offer; - Sku = sku; - Version = version; - ExactVersion = exactVersion; - SharedGalleryImageId = sharedGalleryImageId; - CommunityGalleryImageId = communityGalleryImageId; + this.Publisher = publisher; + this.Offer = offer; + this.Sku = sku; + this.Version = version; + this.ExactVersion = exactVersion; + this.SharedGalleryImageId = sharedGalleryImageId; + this.CommunityGalleryImageId = communityGalleryImageId; CustomInit(); } @@ -79,65 +85,63 @@ public ImageReference() /// partial void CustomInit(); + /// /// Gets or sets the image publisher. /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publisher")] + public string Publisher {get; set; } /// - /// Gets or sets specifies the offer of the platform image or - /// marketplace image used to create the virtual machine. + /// Gets or sets specifies the offer of the platform image or marketplace image + /// used to create the virtual machine. /// - [JsonProperty(PropertyName = "offer")] - public string Offer { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "offer")] + public string Offer {get; set; } /// /// Gets or sets the image SKU. /// - [JsonProperty(PropertyName = "sku")] - public string Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public string Sku {get; set; } /// - /// Gets or sets specifies the version of the platform image or - /// marketplace image used to create the virtual machine. The allowed - /// formats are Major.Minor.Build or 'latest'. Major, Minor, and Build - /// are decimal numbers. Specify 'latest' to use the latest version of - /// an image available at deploy time. Even if you use 'latest', the VM - /// image will not automatically update after deploy time even if a new - /// version becomes available. Please do not use field 'version' for - /// gallery image deployment, gallery image should always use 'id' - /// field for deployment, to use 'latest' version of gallery image, - /// just set - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' - /// in the 'id' field without version input. + /// Gets or sets specifies the version of the platform image or marketplace + /// image used to create the virtual machine. The allowed formats are + /// Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. + /// Specify 'latest' to use the latest version of an image available at deploy + /// time. Even if you use 'latest', the VM image will not automatically update + /// after deploy time even if a new version becomes available. Please do not + /// use field 'version' for gallery image deployment, gallery image should + /// always use 'id' field for deployment, to use 'latest' version of gallery + /// image, just set + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' + /// in the 'id' field without version input. /// - [JsonProperty(PropertyName = "version")] - public string Version { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "version")] + public string Version {get; set; } /// /// Gets specifies in decimal numbers, the version of platform image or - /// marketplace image used to create the virtual machine. This readonly - /// field differs from 'version', only if the value specified in - /// 'version' field is 'latest'. + /// marketplace image used to create the virtual machine. This readonly field + /// differs from 'version', only if the value specified in 'version' field is + /// 'latest'. /// - [JsonProperty(PropertyName = "exactVersion")] - public string ExactVersion { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "exactVersion")] + public string ExactVersion {get; private set; } /// /// Gets or sets specified the shared gallery image unique id for vm /// deployment. This can be fetched from shared gallery image GET call. /// - [JsonProperty(PropertyName = "sharedGalleryImageId")] - public string SharedGalleryImageId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sharedGalleryImageId")] + public string SharedGalleryImageId {get; set; } /// /// Gets or sets specified the community gallery image unique id for vm - /// deployment. This can be fetched from community gallery image GET - /// call. + /// deployment. This can be fetched from community gallery image GET call. /// - [JsonProperty(PropertyName = "communityGalleryImageId")] - public string CommunityGalleryImageId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "communityGalleryImageId")] + public string CommunityGalleryImageId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageState.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageState.cs index 7b86d3b4d8a7..bc74fbddc2c4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageState.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ImageState. /// + + public static class ImageState { public const string Active = "Active"; public const string ScheduledForDeprecation = "ScheduledForDeprecation"; public const string Deprecated = "Deprecated"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageStorageProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageStorageProfile.cs index 262482c56523..8a9d684a847e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageStorageProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageStorageProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,25 +23,29 @@ public ImageStorageProfile() /// /// Initializes a new instance of the ImageStorageProfile class. /// - /// Specifies information about the operating - /// system disk used by the virtual machine. <br><br> For - /// more information about disks, see [About disks and VHDs for Azure - /// virtual - /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). - /// Specifies the parameters that are used to - /// add a data disk to a virtual machine. <br><br> For more - /// information about disks, see [About disks and VHDs for Azure - /// virtual - /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). - /// Specifies whether an image is zone - /// resilient or not. Default is false. Zone resilient images can be - /// created only in regions that provide Zone Redundant Storage - /// (ZRS). - public ImageStorageProfile(ImageOSDisk osDisk = default(ImageOSDisk), IList dataDisks = default(IList), bool? zoneResilient = default(bool?)) + + /// Specifies information about the operating system disk used by the virtual + /// machine. <br><br> For more information about disks, see [About disks and + /// VHDs for Azure virtual + /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + /// + + /// Specifies the parameters that are used to add a data disk to a virtual + /// machine. <br><br> For more information about disks, see [About disks and + /// VHDs for Azure virtual + /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + /// + + /// Specifies whether an image is zone resilient or not. Default is false. Zone + /// resilient images can be created only in regions that provide Zone Redundant + /// Storage (ZRS). + /// + public ImageStorageProfile(ImageOSDisk osDisk = default(ImageOSDisk), System.Collections.Generic.IList dataDisks = default(System.Collections.Generic.IList), bool? zoneResilient = default(bool?)) + { - OsDisk = osDisk; - DataDisks = dataDisks; - ZoneResilient = zoneResilient; + this.OsDisk = osDisk; + this.DataDisks = dataDisks; + this.ZoneResilient = zoneResilient; CustomInit(); } @@ -58,49 +54,47 @@ public ImageStorageProfile() /// partial void CustomInit(); + /// - /// Gets or sets specifies information about the operating system disk - /// used by the virtual machine. &lt;br&gt;&lt;br&gt; - /// For more information about disks, see [About disks and VHDs for - /// Azure virtual + /// Gets or sets specifies information about the operating system disk used by + /// the virtual machine. <br><br> For more information about disks, see [About + /// disks and VHDs for Azure virtual /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). /// - [JsonProperty(PropertyName = "osDisk")] - public ImageOSDisk OsDisk { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osDisk")] + public ImageOSDisk OsDisk {get; set; } /// - /// Gets or sets specifies the parameters that are used to add a data - /// disk to a virtual machine. &lt;br&gt;&lt;br&gt; For - /// more information about disks, see [About disks and VHDs for Azure - /// virtual + /// Gets or sets specifies the parameters that are used to add a data disk to a + /// virtual machine. <br><br> For more information about disks, see [About + /// disks and VHDs for Azure virtual /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). /// - [JsonProperty(PropertyName = "dataDisks")] - public IList DataDisks { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDisks")] + public System.Collections.Generic.IList DataDisks {get; set; } /// - /// Gets or sets specifies whether an image is zone resilient or not. - /// Default is false. Zone resilient images can be created only in - /// regions that provide Zone Redundant Storage (ZRS). + /// Gets or sets specifies whether an image is zone resilient or not. Default + /// is false. Zone resilient images can be created only in regions that provide + /// Zone Redundant Storage (ZRS). /// - [JsonProperty(PropertyName = "zoneResilient")] - public bool? ZoneResilient { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "zoneResilient")] + public bool? ZoneResilient {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (OsDisk != null) + if (this.OsDisk != null) { - OsDisk.Validate(); + this.OsDisk.Validate(); } - if (DataDisks != null) + if (this.DataDisks != null) { - foreach (var element in DataDisks) + foreach (var element in this.DataDisks) { if (element != null) { @@ -110,4 +104,4 @@ public virtual void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageUpdate.cs index 8d9a073172fc..45bd0b93b60b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageUpdate.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The source user image virtual hard disk. Only tags may be updated. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ImageUpdate : UpdateResource { /// @@ -34,26 +24,33 @@ public ImageUpdate() /// /// Initializes a new instance of the ImageUpdate class. /// - /// Resource tags - /// The source virtual machine from - /// which Image is created. - /// Specifies the storage settings for the - /// virtual machine disks. - /// The provisioning state. - /// Specifies the HyperVGenerationType - /// of the VirtualMachine created from the image. From API Version - /// 2019-03-01 if the image source is a blob, then we need the user to - /// specify the value, if the source is managed resource like disk or - /// snapshot, we may require the user to specify the property if we - /// cannot deduce it from the source managed resource. Possible values - /// include: 'V1', 'V2' - public ImageUpdate(IDictionary tags = default(IDictionary), SubResource sourceVirtualMachine = default(SubResource), ImageStorageProfile storageProfile = default(ImageStorageProfile), string provisioningState = default(string), string hyperVGeneration = default(string)) - : base(tags) + + /// Resource tags + /// + + /// The source virtual machine from which Image is created. + /// + + /// Specifies the storage settings for the virtual machine disks. + /// + + /// The provisioning state. + /// + + /// Specifies the HyperVGenerationType of the VirtualMachine created from the + /// image. From API Version 2019-03-01 if the image source is a blob, then we + /// need the user to specify the value, if the source is managed resource like + /// disk or snapshot, we may require the user to specify the property if we + /// cannot deduce it from the source managed resource. + /// Possible values include: 'V1', 'V2' + public ImageUpdate(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), SubResource sourceVirtualMachine = default(SubResource), ImageStorageProfile storageProfile = default(ImageStorageProfile), string provisioningState = default(string), string hyperVGeneration = default(string)) + + : base(tags) { - SourceVirtualMachine = sourceVirtualMachine; - StorageProfile = storageProfile; - ProvisioningState = provisioningState; - HyperVGeneration = hyperVGeneration; + this.SourceVirtualMachine = sourceVirtualMachine; + this.StorageProfile = storageProfile; + this.ProvisioningState = provisioningState; + this.HyperVGeneration = hyperVGeneration; CustomInit(); } @@ -62,50 +59,49 @@ public ImageUpdate() /// partial void CustomInit(); + /// - /// Gets or sets the source virtual machine from which Image is - /// created. + /// Gets or sets the source virtual machine from which Image is created. /// - [JsonProperty(PropertyName = "properties.sourceVirtualMachine")] - public SubResource SourceVirtualMachine { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourceVirtualMachine")] + public SubResource SourceVirtualMachine {get; set; } /// - /// Gets or sets specifies the storage settings for the virtual machine - /// disks. + /// Gets or sets specifies the storage settings for the virtual machine disks. /// - [JsonProperty(PropertyName = "properties.storageProfile")] - public ImageStorageProfile StorageProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageProfile")] + public ImageStorageProfile StorageProfile {get; set; } /// /// Gets the provisioning state. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets specifies the HyperVGenerationType of the - /// VirtualMachine created from the image. From API Version 2019-03-01 - /// if the image source is a blob, then we need the user to specify the - /// value, if the source is managed resource like disk or snapshot, we - /// may require the user to specify the property if we cannot deduce it - /// from the source managed resource. Possible values include: 'V1', - /// 'V2' + /// Gets or sets specifies the HyperVGenerationType of the VirtualMachine + /// created from the image. From API Version 2019-03-01 if the image source is + /// a blob, then we need the user to specify the value, if the source is + /// managed resource like disk or snapshot, we may require the user to specify + /// the property if we cannot deduce it from the source managed resource. Possible values include: 'V1', 'V2' /// - [JsonProperty(PropertyName = "properties.hyperVGeneration")] - public string HyperVGeneration { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hyperVGeneration")] + public string HyperVGeneration {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (StorageProfile != null) + + if (this.StorageProfile != null) { - StorageProfile.Validate(); + this.StorageProfile.Validate(); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageVersionSecurityProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageVersionSecurityProfile.cs index f4aece728648..dba48573e9cc 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ImageVersionSecurityProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImageVersionSecurityProfile.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class ImageVersionSecurityProfile { /// - /// Initializes a new instance of the ImageVersionSecurityProfile - /// class. + /// Initializes a new instance of the ImageVersionSecurityProfile class. /// public ImageVersionSecurityProfile() { @@ -28,14 +21,15 @@ public ImageVersionSecurityProfile() } /// - /// Initializes a new instance of the ImageVersionSecurityProfile - /// class. + /// Initializes a new instance of the ImageVersionSecurityProfile class. /// - /// Contains UEFI settings for the image - /// version. + + /// Contains UEFI settings for the image version. + /// public ImageVersionSecurityProfile(GalleryImageVersionUefiSettings uefiSettings = default(GalleryImageVersionUefiSettings)) + { - UefiSettings = uefiSettings; + this.UefiSettings = uefiSettings; CustomInit(); } @@ -44,11 +38,11 @@ public ImageVersionSecurityProfile() /// partial void CustomInit(); + /// /// Gets or sets contains UEFI settings for the image version. /// - [JsonProperty(PropertyName = "uefiSettings")] - public GalleryImageVersionUefiSettings UefiSettings { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "uefiSettings")] + public GalleryImageVersionUefiSettings UefiSettings {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImagesCreateOrUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImagesCreateOrUpdateHeaders.cs index 98efc700f60e..77b2674dfcb3 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ImagesCreateOrUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImagesCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class ImagesCreateOrUpdateHeaders { /// - /// Initializes a new instance of the ImagesCreateOrUpdateHeaders - /// class. + /// Initializes a new instance of the ImagesCreateOrUpdateHeaders class. /// public ImagesCreateOrUpdateHeaders() { @@ -28,18 +18,19 @@ public ImagesCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the ImagesCreateOrUpdateHeaders - /// class. + /// Initializes a new instance of the ImagesCreateOrUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public ImagesCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public ImagesCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ImagesUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ImagesUpdateHeaders.cs index 5961f90f00ed..df2d84681cbe 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ImagesUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ImagesUpdateHeaders.cs @@ -1,21 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Update operation. - /// public partial class ImagesUpdateHeaders { /// @@ -29,15 +20,17 @@ public ImagesUpdateHeaders() /// /// Initializes a new instance of the ImagesUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public ImagesUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -46,19 +39,17 @@ public ImagesUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/InnerError.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/InnerError.cs index 781614b2e68e..d8f89332cf2f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/InnerError.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/InnerError.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public InnerError() /// /// Initializes a new instance of the InnerError class. /// - /// The exception type. - /// The internal error message or exception - /// dump. + + /// The exception type. + /// + + /// The internal error message or exception dump. + /// public InnerError(string exceptiontype = default(string), string errordetail = default(string)) + { - Exceptiontype = exceptiontype; - Errordetail = errordetail; + this.Exceptiontype = exceptiontype; + this.Errordetail = errordetail; CustomInit(); } @@ -44,17 +42,17 @@ public InnerError() /// partial void CustomInit(); + /// /// Gets or sets the exception type. /// - [JsonProperty(PropertyName = "exceptiontype")] - public string Exceptiontype { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "exceptiontype")] + public string Exceptiontype {get; set; } /// /// Gets or sets the internal error message or exception dump. /// - [JsonProperty(PropertyName = "errordetail")] - public string Errordetail { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "errordetail")] + public string Errordetail {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/InstanceViewStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/InstanceViewStatus.cs index ce05542f9f87..a632a72c1b0b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/InstanceViewStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/InstanceViewStatus.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,21 +23,29 @@ public InstanceViewStatus() /// /// Initializes a new instance of the InstanceViewStatus class. /// - /// The status code. - /// The level code. Possible values include: - /// 'Info', 'Warning', 'Error' - /// The short localizable label for the - /// status. - /// The detailed status message, including for - /// alerts and error messages. - /// The time of the status. + + /// The status code. + /// + + /// The level code. + /// Possible values include: 'Info', 'Warning', 'Error' + + /// The short localizable label for the status. + /// + + /// The detailed status message, including for alerts and error messages. + /// + + /// The time of the status. + /// public InstanceViewStatus(string code = default(string), StatusLevelTypes? level = default(StatusLevelTypes?), string displayStatus = default(string), string message = default(string), System.DateTime? time = default(System.DateTime?)) + { - Code = code; - Level = level; - DisplayStatus = displayStatus; - Message = message; - Time = time; + this.Code = code; + this.Level = level; + this.DisplayStatus = displayStatus; + this.Message = message; + this.Time = time; CustomInit(); } @@ -52,37 +54,36 @@ public InstanceViewStatus() /// partial void CustomInit(); + /// /// Gets or sets the status code. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } /// - /// Gets or sets the level code. Possible values include: 'Info', - /// 'Warning', 'Error' + /// Gets or sets the level code. Possible values include: 'Info', 'Warning', 'Error' /// - [JsonProperty(PropertyName = "level")] - public StatusLevelTypes? Level { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "level")] + public StatusLevelTypes? Level {get; set; } /// /// Gets or sets the short localizable label for the status. /// - [JsonProperty(PropertyName = "displayStatus")] - public string DisplayStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "displayStatus")] + public string DisplayStatus {get; set; } /// - /// Gets or sets the detailed status message, including for alerts and - /// error messages. + /// Gets or sets the detailed status message, including for alerts and error + /// messages. /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } /// /// Gets or sets the time of the status. /// - [JsonProperty(PropertyName = "time")] - public System.DateTime? Time { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "time")] + public System.DateTime? Time {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/InstanceViewTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/InstanceViewTypes.cs index 69a53962bbac..2634f0a66f99 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/InstanceViewTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/InstanceViewTypes.cs @@ -1,31 +1,24 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for InstanceViewTypes. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum InstanceViewTypes { - [EnumMember(Value = "instanceView")] + [System.Runtime.Serialization.EnumMember(Value = "instanceView")] InstanceView, - [EnumMember(Value = "userData")] + [System.Runtime.Serialization.EnumMember(Value = "userData")] UserData, - [EnumMember(Value = "resiliencyView")] + [System.Runtime.Serialization.EnumMember(Value = "resiliencyView")] ResiliencyView } internal static class InstanceViewTypesEnumExtension @@ -34,7 +27,6 @@ internal static string ToSerializedValue(this InstanceViewTypes? value) { return value == null ? null : ((InstanceViewTypes)value).ToSerializedValue(); } - internal static string ToSerializedValue(this InstanceViewTypes value) { switch( value ) @@ -48,7 +40,6 @@ internal static string ToSerializedValue(this InstanceViewTypes value) } return null; } - internal static InstanceViewTypes? ParseInstanceViewTypes(this string value) { switch( value ) @@ -63,4 +54,4 @@ internal static string ToSerializedValue(this InstanceViewTypes value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/IntervalInMins.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/IntervalInMins.cs index 3438b2d9c359..855c8e1fc600 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/IntervalInMins.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/IntervalInMins.cs @@ -1,33 +1,26 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for IntervalInMins. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum IntervalInMins { - [EnumMember(Value = "ThreeMins")] + [System.Runtime.Serialization.EnumMember(Value = "ThreeMins")] ThreeMins, - [EnumMember(Value = "FiveMins")] + [System.Runtime.Serialization.EnumMember(Value = "FiveMins")] FiveMins, - [EnumMember(Value = "ThirtyMins")] + [System.Runtime.Serialization.EnumMember(Value = "ThirtyMins")] ThirtyMins, - [EnumMember(Value = "SixtyMins")] + [System.Runtime.Serialization.EnumMember(Value = "SixtyMins")] SixtyMins } internal static class IntervalInMinsEnumExtension @@ -36,7 +29,6 @@ internal static string ToSerializedValue(this IntervalInMins? value) { return value == null ? null : ((IntervalInMins)value).ToSerializedValue(); } - internal static string ToSerializedValue(this IntervalInMins value) { switch( value ) @@ -52,7 +44,6 @@ internal static string ToSerializedValue(this IntervalInMins value) } return null; } - internal static IntervalInMins? ParseIntervalInMins(this string value) { switch( value ) @@ -69,4 +60,4 @@ internal static string ToSerializedValue(this IntervalInMins value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/KeyForDiskEncryptionSet.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/KeyForDiskEncryptionSet.cs index c4c109920076..f38ffaf687ae 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/KeyForDiskEncryptionSet.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/KeyForDiskEncryptionSet.cs @@ -1,22 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// - /// Key Vault Key Url to be used for server side encryption of Managed - /// Disks and Snapshots + /// Key Vault Key Url to be used for server side encryption of Managed Disks + /// and Snapshots /// public partial class KeyForDiskEncryptionSet { @@ -31,17 +24,20 @@ public KeyForDiskEncryptionSet() /// /// Initializes a new instance of the KeyForDiskEncryptionSet class. /// - /// Fully versioned Key Url pointing to a key in - /// KeyVault. Version segment of the Url is required regardless of - /// rotationToLatestKeyVersionEnabled value. - /// Resource id of the KeyVault containing - /// the key or secret. This property is optional and cannot be used if - /// the KeyVault subscription is not the same as the Disk Encryption - /// Set subscription. + + /// Resource id of the KeyVault containing the key or secret. This property is + /// optional and cannot be used if the KeyVault subscription is not the same as + /// the Disk Encryption Set subscription. + /// + + /// Fully versioned Key Url pointing to a key in KeyVault. Version segment of + /// the Url is required regardless of rotationToLatestKeyVersionEnabled value. + /// public KeyForDiskEncryptionSet(string keyUrl, SourceVault sourceVault = default(SourceVault)) + { - SourceVault = sourceVault; - KeyUrl = keyUrl; + this.SourceVault = sourceVault; + this.KeyUrl = keyUrl; CustomInit(); } @@ -50,35 +46,36 @@ public KeyForDiskEncryptionSet() /// partial void CustomInit(); + /// - /// Gets or sets resource id of the KeyVault containing the key or - /// secret. This property is optional and cannot be used if the - /// KeyVault subscription is not the same as the Disk Encryption Set - /// subscription. + /// Gets or sets resource id of the KeyVault containing the key or secret. This + /// property is optional and cannot be used if the KeyVault subscription is not + /// the same as the Disk Encryption Set subscription. /// - [JsonProperty(PropertyName = "sourceVault")] - public SourceVault SourceVault { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceVault")] + public SourceVault SourceVault {get; set; } /// - /// Gets or sets fully versioned Key Url pointing to a key in KeyVault. - /// Version segment of the Url is required regardless of + /// Gets or sets fully versioned Key Url pointing to a key in KeyVault. Version + /// segment of the Url is required regardless of /// rotationToLatestKeyVersionEnabled value. /// - [JsonProperty(PropertyName = "keyUrl")] - public string KeyUrl { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "keyUrl")] + public string KeyUrl {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (KeyUrl == null) + if (this.KeyUrl == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "KeyUrl"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "KeyUrl"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultAndKeyReference.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultAndKeyReference.cs index c1ad35762179..f9d087ab15e6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultAndKeyReference.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultAndKeyReference.cs @@ -1,22 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// - /// Key Vault Key Url and vault id of KeK, KeK is optional and when - /// provided is used to unwrap the encryptionKey + /// Key Vault Key Url and vault id of KeK, KeK is optional and when provided is + /// used to unwrap the encryptionKey /// public partial class KeyVaultAndKeyReference { @@ -31,14 +24,17 @@ public KeyVaultAndKeyReference() /// /// Initializes a new instance of the KeyVaultAndKeyReference class. /// - /// Resource id of the KeyVault containing - /// the key or secret - /// Url pointing to a key or secret in - /// KeyVault + + /// Resource id of the KeyVault containing the key or secret + /// + + /// Url pointing to a key or secret in KeyVault + /// public KeyVaultAndKeyReference(SourceVault sourceVault, string keyUrl) + { - SourceVault = sourceVault; - KeyUrl = keyUrl; + this.SourceVault = sourceVault; + this.KeyUrl = keyUrl; CustomInit(); } @@ -47,35 +43,36 @@ public KeyVaultAndKeyReference(SourceVault sourceVault, string keyUrl) /// partial void CustomInit(); + /// - /// Gets or sets resource id of the KeyVault containing the key or - /// secret + /// Gets or sets resource id of the KeyVault containing the key or secret /// - [JsonProperty(PropertyName = "sourceVault")] - public SourceVault SourceVault { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceVault")] + public SourceVault SourceVault {get; set; } /// /// Gets or sets url pointing to a key or secret in KeyVault /// - [JsonProperty(PropertyName = "keyUrl")] - public string KeyUrl { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "keyUrl")] + public string KeyUrl {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (SourceVault == null) + if (this.SourceVault == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "SourceVault"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "SourceVault"); } - if (KeyUrl == null) + if (this.KeyUrl == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "KeyUrl"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "KeyUrl"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultAndSecretReference.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultAndSecretReference.cs index e19c6a5c8cc6..52d6428478ef 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultAndSecretReference.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultAndSecretReference.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,14 +23,17 @@ public KeyVaultAndSecretReference() /// /// Initializes a new instance of the KeyVaultAndSecretReference class. /// - /// Resource id of the KeyVault containing - /// the key or secret - /// Url pointing to a key or secret in - /// KeyVault + + /// Resource id of the KeyVault containing the key or secret + /// + + /// Url pointing to a key or secret in KeyVault + /// public KeyVaultAndSecretReference(SourceVault sourceVault, string secretUrl) + { - SourceVault = sourceVault; - SecretUrl = secretUrl; + this.SourceVault = sourceVault; + this.SecretUrl = secretUrl; CustomInit(); } @@ -46,35 +42,36 @@ public KeyVaultAndSecretReference(SourceVault sourceVault, string secretUrl) /// partial void CustomInit(); + /// - /// Gets or sets resource id of the KeyVault containing the key or - /// secret + /// Gets or sets resource id of the KeyVault containing the key or secret /// - [JsonProperty(PropertyName = "sourceVault")] - public SourceVault SourceVault { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceVault")] + public SourceVault SourceVault {get; set; } /// /// Gets or sets url pointing to a key or secret in KeyVault /// - [JsonProperty(PropertyName = "secretUrl")] - public string SecretUrl { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "secretUrl")] + public string SecretUrl {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (SourceVault == null) + if (this.SourceVault == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "SourceVault"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "SourceVault"); } - if (SecretUrl == null) + if (this.SecretUrl == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "SecretUrl"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "SecretUrl"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultKeyReference.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultKeyReference.cs index 3965245b5f31..177e975da3be 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultKeyReference.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultKeyReference.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,14 +23,17 @@ public KeyVaultKeyReference() /// /// Initializes a new instance of the KeyVaultKeyReference class. /// - /// The URL referencing a key encryption key in - /// Key Vault. - /// The relative URL of the Key Vault - /// containing the key. + + /// The URL referencing a key encryption key in Key Vault. + /// + + /// The relative URL of the Key Vault containing the key. + /// public KeyVaultKeyReference(string keyUrl, SubResource sourceVault) + { - KeyUrl = keyUrl; - SourceVault = sourceVault; + this.KeyUrl = keyUrl; + this.SourceVault = sourceVault; CustomInit(); } @@ -46,34 +42,36 @@ public KeyVaultKeyReference(string keyUrl, SubResource sourceVault) /// partial void CustomInit(); + /// /// Gets or sets the URL referencing a key encryption key in Key Vault. /// - [JsonProperty(PropertyName = "keyUrl")] - public string KeyUrl { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "keyUrl")] + public string KeyUrl {get; set; } /// /// Gets or sets the relative URL of the Key Vault containing the key. /// - [JsonProperty(PropertyName = "sourceVault")] - public SubResource SourceVault { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceVault")] + public SubResource SourceVault {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (KeyUrl == null) + if (this.KeyUrl == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "KeyUrl"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "KeyUrl"); } - if (SourceVault == null) + if (this.SourceVault == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "SourceVault"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "SourceVault"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultProperties.cs index 891346e17c37..4118b0692a6d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultProperties.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; public partial class KeyVaultProperties @@ -26,14 +20,17 @@ public KeyVaultProperties() /// /// Initializes a new instance of the KeyVaultProperties class. /// - /// Key vault uri to access the encryption - /// key. - /// The client ID of the identity which will be - /// used to access key vault. + + /// Key vault uri to access the encryption key. + /// + + /// The client ID of the identity which will be used to access key vault. + /// public KeyVaultProperties(string keyIdentifier = default(string), string identity = default(string)) + { - KeyIdentifier = keyIdentifier; - Identity = identity; + this.KeyIdentifier = keyIdentifier; + this.Identity = identity; CustomInit(); } @@ -42,18 +39,18 @@ public KeyVaultProperties() /// partial void CustomInit(); + /// /// Gets or sets key vault uri to access the encryption key. /// - [JsonProperty(PropertyName = "keyIdentifier")] - public string KeyIdentifier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "keyIdentifier")] + public string KeyIdentifier {get; set; } /// - /// Gets or sets the client ID of the identity which will be used to - /// access key vault. + /// Gets or sets the client ID of the identity which will be used to access key + /// vault. /// - [JsonProperty(PropertyName = "identity")] - public string Identity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public string Identity {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultSecretReference.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultSecretReference.cs index cf99d6b4c143..1cd1a67f7e74 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultSecretReference.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/KeyVaultSecretReference.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,14 +23,17 @@ public KeyVaultSecretReference() /// /// Initializes a new instance of the KeyVaultSecretReference class. /// - /// The URL referencing a secret in a Key - /// Vault. - /// The relative URL of the Key Vault - /// containing the secret. + + /// The URL referencing a secret in a Key Vault. + /// + + /// The relative URL of the Key Vault containing the secret. + /// public KeyVaultSecretReference(string secretUrl, SubResource sourceVault) + { - SecretUrl = secretUrl; - SourceVault = sourceVault; + this.SecretUrl = secretUrl; + this.SourceVault = sourceVault; CustomInit(); } @@ -46,35 +42,36 @@ public KeyVaultSecretReference(string secretUrl, SubResource sourceVault) /// partial void CustomInit(); + /// /// Gets or sets the URL referencing a secret in a Key Vault. /// - [JsonProperty(PropertyName = "secretUrl")] - public string SecretUrl { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "secretUrl")] + public string SecretUrl {get; set; } /// - /// Gets or sets the relative URL of the Key Vault containing the - /// secret. + /// Gets or sets the relative URL of the Key Vault containing the secret. /// - [JsonProperty(PropertyName = "sourceVault")] - public SubResource SourceVault { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceVault")] + public SubResource SourceVault {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (SecretUrl == null) + if (this.SecretUrl == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "SecretUrl"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "SecretUrl"); } - if (SourceVault == null) + if (this.SourceVault == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "SourceVault"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "SourceVault"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/LastPatchInstallationSummary.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/LastPatchInstallationSummary.cs index 3afaee59807a..53072b6df737 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/LastPatchInstallationSummary.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/LastPatchInstallationSummary.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class LastPatchInstallationSummary { /// - /// Initializes a new instance of the LastPatchInstallationSummary - /// class. + /// Initializes a new instance of the LastPatchInstallationSummary class. /// public LastPatchInstallationSummary() { @@ -28,54 +21,64 @@ public LastPatchInstallationSummary() } /// - /// Initializes a new instance of the LastPatchInstallationSummary - /// class. + /// Initializes a new instance of the LastPatchInstallationSummary class. /// - /// The overall success or failure status of the - /// operation. It remains "InProgress" until the operation completes. - /// At that point it will become "Unknown", "Failed", "Succeeded", or - /// "CompletedWithWarnings.". Possible values include: 'Unknown', - /// 'InProgress', 'Failed', 'Succeeded', - /// 'CompletedWithWarnings' - /// The activity ID of the - /// operation that produced this result. It is used to correlate across - /// CRP and extension logs. - /// Describes whether the - /// operation ran out of time before it completed all its intended - /// actions - /// The number of all available - /// patches but not going to be installed because it didn't match a - /// classification or inclusion list entry. - /// The number of all available - /// patches but excluded explicitly by a customer-specified exclusion - /// list match. - /// The number of all available patches - /// expected to be installed over the course of the patch installation - /// operation. - /// The count of patches that - /// successfully installed. - /// The count of patches that failed - /// installation. - /// The UTC timestamp when the operation - /// began. - /// The UTC timestamp when the operation - /// began. - /// The errors that were encountered during - /// execution of the operation. The details array contains the list of - /// them. + + /// The overall success or failure status of the operation. It remains + /// "InProgress" until the operation completes. At that point it will become + /// "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." + /// Possible values include: 'Unknown', 'InProgress', 'Failed', 'Succeeded', + /// 'CompletedWithWarnings' + + /// The activity ID of the operation that produced this result. It is used to + /// correlate across CRP and extension logs. + /// + + /// Describes whether the operation ran out of time before it completed all its + /// intended actions + /// + + /// The number of all available patches but not going to be installed because + /// it didn't match a classification or inclusion list entry. + /// + + /// The number of all available patches but excluded explicitly by a + /// customer-specified exclusion list match. + /// + + /// The number of all available patches expected to be installed over the + /// course of the patch installation operation. + /// + + /// The count of patches that successfully installed. + /// + + /// The count of patches that failed installation. + /// + + /// The UTC timestamp when the operation began. + /// + + /// The UTC timestamp when the operation began. + /// + + /// The errors that were encountered during execution of the operation. The + /// details array contains the list of them. + /// public LastPatchInstallationSummary(string status = default(string), string installationActivityId = default(string), bool? maintenanceWindowExceeded = default(bool?), int? notSelectedPatchCount = default(int?), int? excludedPatchCount = default(int?), int? pendingPatchCount = default(int?), int? installedPatchCount = default(int?), int? failedPatchCount = default(int?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), ApiError error = default(ApiError)) + { - Status = status; - InstallationActivityId = installationActivityId; - MaintenanceWindowExceeded = maintenanceWindowExceeded; - NotSelectedPatchCount = notSelectedPatchCount; - ExcludedPatchCount = excludedPatchCount; - PendingPatchCount = pendingPatchCount; - InstalledPatchCount = installedPatchCount; - FailedPatchCount = failedPatchCount; - StartTime = startTime; - LastModifiedTime = lastModifiedTime; - Error = error; + this.Status = status; + this.InstallationActivityId = installationActivityId; + this.MaintenanceWindowExceeded = maintenanceWindowExceeded; + this.NotSelectedPatchCount = notSelectedPatchCount; + this.ExcludedPatchCount = excludedPatchCount; + this.PendingPatchCount = pendingPatchCount; + this.InstalledPatchCount = installedPatchCount; + this.FailedPatchCount = failedPatchCount; + this.StartTime = startTime; + this.LastModifiedTime = lastModifiedTime; + this.Error = error; CustomInit(); } @@ -84,82 +87,79 @@ public LastPatchInstallationSummary() /// partial void CustomInit(); + /// - /// Gets the overall success or failure status of the operation. It - /// remains "InProgress" until the operation completes. At that point - /// it will become "Unknown", "Failed", "Succeeded", or - /// "CompletedWithWarnings.". Possible values include: 'Unknown', - /// 'InProgress', 'Failed', 'Succeeded', 'CompletedWithWarnings' + /// Gets the overall success or failure status of the operation. It remains + /// "InProgress" until the operation completes. At that point it will become + /// "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." Possible values include: 'Unknown', 'InProgress', 'Failed', 'Succeeded', 'CompletedWithWarnings' /// - [JsonProperty(PropertyName = "status")] - public string Status { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; private set; } /// - /// Gets the activity ID of the operation that produced this result. It - /// is used to correlate across CRP and extension logs. + /// Gets the activity ID of the operation that produced this result. It is used + /// to correlate across CRP and extension logs. /// - [JsonProperty(PropertyName = "installationActivityId")] - public string InstallationActivityId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "installationActivityId")] + public string InstallationActivityId {get; private set; } /// - /// Gets describes whether the operation ran out of time before it - /// completed all its intended actions + /// Gets describes whether the operation ran out of time before it completed + /// all its intended actions /// - [JsonProperty(PropertyName = "maintenanceWindowExceeded")] - public bool? MaintenanceWindowExceeded { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maintenanceWindowExceeded")] + public bool? MaintenanceWindowExceeded {get; private set; } /// - /// Gets the number of all available patches but not going to be - /// installed because it didn't match a classification or inclusion - /// list entry. + /// Gets the number of all available patches but not going to be installed + /// because it didn't match a classification or inclusion list entry. /// - [JsonProperty(PropertyName = "notSelectedPatchCount")] - public int? NotSelectedPatchCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "notSelectedPatchCount")] + public int? NotSelectedPatchCount {get; private set; } /// - /// Gets the number of all available patches but excluded explicitly by - /// a customer-specified exclusion list match. + /// Gets the number of all available patches but excluded explicitly by a + /// customer-specified exclusion list match. /// - [JsonProperty(PropertyName = "excludedPatchCount")] - public int? ExcludedPatchCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "excludedPatchCount")] + public int? ExcludedPatchCount {get; private set; } /// - /// Gets the number of all available patches expected to be installed - /// over the course of the patch installation operation. + /// Gets the number of all available patches expected to be installed over the + /// course of the patch installation operation. /// - [JsonProperty(PropertyName = "pendingPatchCount")] - public int? PendingPatchCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "pendingPatchCount")] + public int? PendingPatchCount {get; private set; } /// /// Gets the count of patches that successfully installed. /// - [JsonProperty(PropertyName = "installedPatchCount")] - public int? InstalledPatchCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "installedPatchCount")] + public int? InstalledPatchCount {get; private set; } /// /// Gets the count of patches that failed installation. /// - [JsonProperty(PropertyName = "failedPatchCount")] - public int? FailedPatchCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "failedPatchCount")] + public int? FailedPatchCount {get; private set; } /// /// Gets the UTC timestamp when the operation began. /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime {get; private set; } /// /// Gets the UTC timestamp when the operation began. /// - [JsonProperty(PropertyName = "lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedTime")] + public System.DateTime? LastModifiedTime {get; private set; } /// - /// Gets the errors that were encountered during execution of the - /// operation. The details array contains the list of them. + /// Gets the errors that were encountered during execution of the operation. + /// The details array contains the list of them. /// - [JsonProperty(PropertyName = "error")] - public ApiError Error { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ApiError Error {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxConfiguration.cs index 81b3a3832357..7908952bfa4e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxConfiguration.cs @@ -1,22 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Specifies the Linux operating system settings on the virtual machine. - /// For a list of supported Linux distributions, see [Linux on - /// Azure-Endorsed + /// Specifies the Linux operating system settings on the virtual machine. For a + /// list of supported Linux distributions, see [Linux on Azure-Endorsed /// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). /// public partial class LinuxConfiguration @@ -32,27 +25,33 @@ public LinuxConfiguration() /// /// Initializes a new instance of the LinuxConfiguration class. /// - /// Specifies whether - /// password authentication should be disabled. - /// Specifies the ssh key configuration for a Linux - /// OS. - /// Indicates whether virtual machine - /// agent should be provisioned on the virtual machine. When this - /// property is not specified in the request body, default behavior is - /// to set it to true. This will ensure that VM Agent is installed on - /// the VM so that extensions can be added to the VM later. - /// [Preview Feature] Specifies settings - /// related to VM Guest Patching on Linux. - /// Indicates whether - /// VMAgent Platform Updates is enabled for the Linux virtual machine. - /// Default value is false. + + /// Specifies whether password authentication should be disabled. + /// + + /// Specifies the ssh key configuration for a Linux OS. + /// + + /// Indicates whether virtual machine agent should be provisioned on the + /// virtual machine. When this property is not specified in the request body, + /// default behavior is to set it to true. This will ensure that VM Agent is + /// installed on the VM so that extensions can be added to the VM later. + /// + + /// [Preview Feature] Specifies settings related to VM Guest Patching on Linux. + /// + + /// Indicates whether VMAgent Platform Updates is enabled for the Linux virtual + /// machine. Default value is false. + /// public LinuxConfiguration(bool? disablePasswordAuthentication = default(bool?), SshConfiguration ssh = default(SshConfiguration), bool? provisionVMAgent = default(bool?), LinuxPatchSettings patchSettings = default(LinuxPatchSettings), bool? enableVMAgentPlatformUpdates = default(bool?)) + { - DisablePasswordAuthentication = disablePasswordAuthentication; - Ssh = ssh; - ProvisionVMAgent = provisionVMAgent; - PatchSettings = patchSettings; - EnableVMAgentPlatformUpdates = enableVMAgentPlatformUpdates; + this.DisablePasswordAuthentication = disablePasswordAuthentication; + this.Ssh = ssh; + this.ProvisionVMAgent = provisionVMAgent; + this.PatchSettings = patchSettings; + this.EnableVMAgentPlatformUpdates = enableVMAgentPlatformUpdates; CustomInit(); } @@ -61,42 +60,40 @@ public LinuxConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets specifies whether password authentication should be - /// disabled. + /// Gets or sets specifies whether password authentication should be disabled. /// - [JsonProperty(PropertyName = "disablePasswordAuthentication")] - public bool? DisablePasswordAuthentication { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "disablePasswordAuthentication")] + public bool? DisablePasswordAuthentication {get; set; } /// /// Gets or sets specifies the ssh key configuration for a Linux OS. /// - [JsonProperty(PropertyName = "ssh")] - public SshConfiguration Ssh { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ssh")] + public SshConfiguration Ssh {get; set; } /// - /// Gets or sets indicates whether virtual machine agent should be - /// provisioned on the virtual machine. When this property is not - /// specified in the request body, default behavior is to set it to - /// true. This will ensure that VM Agent is installed on the VM so that - /// extensions can be added to the VM later. + /// Gets or sets indicates whether virtual machine agent should be provisioned + /// on the virtual machine. When this property is not specified in the request + /// body, default behavior is to set it to true. This will ensure that VM Agent + /// is installed on the VM so that extensions can be added to the VM later. /// - [JsonProperty(PropertyName = "provisionVMAgent")] - public bool? ProvisionVMAgent { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "provisionVMAgent")] + public bool? ProvisionVMAgent {get; set; } /// - /// Gets or sets [Preview Feature] Specifies settings related to VM - /// Guest Patching on Linux. + /// Gets or sets [Preview Feature] Specifies settings related to VM Guest + /// Patching on Linux. /// - [JsonProperty(PropertyName = "patchSettings")] - public LinuxPatchSettings PatchSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "patchSettings")] + public LinuxPatchSettings PatchSettings {get; set; } /// - /// Gets or sets indicates whether VMAgent Platform Updates is enabled - /// for the Linux virtual machine. Default value is false. + /// Gets or sets indicates whether VMAgent Platform Updates is enabled for the + /// Linux virtual machine. Default value is false. /// - [JsonProperty(PropertyName = "enableVMAgentPlatformUpdates")] - public bool? EnableVMAgentPlatformUpdates { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "enableVMAgentPlatformUpdates")] + public bool? EnableVMAgentPlatformUpdates {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxParameters.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxParameters.cs index 4deea634136d..d708bfe657b8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxParameters.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxParameters.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,20 +23,28 @@ public LinuxParameters() /// /// Initializes a new instance of the LinuxParameters class. /// - /// The update classifications - /// to select when installing patches for Linux. - /// packages to include in the - /// patch operation. Format: packageName_packageVersion - /// packages to exclude in the - /// patch operation. Format: packageName_packageVersion - /// This is used as a maintenance run - /// identifier for Auto VM Guest Patching in Linux. - public LinuxParameters(IList classificationsToInclude = default(IList), IList packageNameMasksToInclude = default(IList), IList packageNameMasksToExclude = default(IList), string maintenanceRunId = default(string)) + + /// The update classifications to select when installing patches for Linux. + /// + + /// packages to include in the patch operation. Format: + /// packageName_packageVersion + /// + + /// packages to exclude in the patch operation. Format: + /// packageName_packageVersion + /// + + /// This is used as a maintenance run identifier for Auto VM Guest Patching in + /// Linux. + /// + public LinuxParameters(System.Collections.Generic.IList classificationsToInclude = default(System.Collections.Generic.IList), System.Collections.Generic.IList packageNameMasksToInclude = default(System.Collections.Generic.IList), System.Collections.Generic.IList packageNameMasksToExclude = default(System.Collections.Generic.IList), string maintenanceRunId = default(string)) + { - ClassificationsToInclude = classificationsToInclude; - PackageNameMasksToInclude = packageNameMasksToInclude; - PackageNameMasksToExclude = packageNameMasksToExclude; - MaintenanceRunId = maintenanceRunId; + this.ClassificationsToInclude = classificationsToInclude; + this.PackageNameMasksToInclude = packageNameMasksToInclude; + this.PackageNameMasksToExclude = packageNameMasksToExclude; + this.MaintenanceRunId = maintenanceRunId; CustomInit(); } @@ -53,33 +53,33 @@ public LinuxParameters() /// partial void CustomInit(); + /// - /// Gets or sets the update classifications to select when installing - /// patches for Linux. + /// Gets or sets the update classifications to select when installing patches + /// for Linux. /// - [JsonProperty(PropertyName = "classificationsToInclude")] - public IList ClassificationsToInclude { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "classificationsToInclude")] + public System.Collections.Generic.IList ClassificationsToInclude {get; set; } /// /// Gets or sets packages to include in the patch operation. Format: /// packageName_packageVersion /// - [JsonProperty(PropertyName = "packageNameMasksToInclude")] - public IList PackageNameMasksToInclude { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "packageNameMasksToInclude")] + public System.Collections.Generic.IList PackageNameMasksToInclude {get; set; } /// /// Gets or sets packages to exclude in the patch operation. Format: /// packageName_packageVersion /// - [JsonProperty(PropertyName = "packageNameMasksToExclude")] - public IList PackageNameMasksToExclude { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "packageNameMasksToExclude")] + public System.Collections.Generic.IList PackageNameMasksToExclude {get; set; } /// - /// Gets or sets this is used as a maintenance run identifier for Auto - /// VM Guest Patching in Linux. + /// Gets or sets this is used as a maintenance run identifier for Auto VM Guest + /// Patching in Linux. /// - [JsonProperty(PropertyName = "maintenanceRunId")] - public string MaintenanceRunId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "maintenanceRunId")] + public string MaintenanceRunId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxPatchAssessmentMode.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxPatchAssessmentMode.cs index 51023b6e3dc4..3c0963d45a9c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxPatchAssessmentMode.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxPatchAssessmentMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for LinuxPatchAssessmentMode. /// + + public static class LinuxPatchAssessmentMode { public const string ImageDefault = "ImageDefault"; public const string AutomaticByPlatform = "AutomaticByPlatform"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxPatchSettings.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxPatchSettings.cs index 91a478c786a1..ca9c4ef0d8cd 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxPatchSettings.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxPatchSettings.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,32 +23,31 @@ public LinuxPatchSettings() /// /// Initializes a new instance of the LinuxPatchSettings class. /// - /// Specifies the mode of VM Guest Patching to - /// IaaS virtual machine or virtual machines associated to virtual - /// machine scale set with OrchestrationMode as Flexible.<br - /// /><br /> Possible values are:<br /><br /> - /// **ImageDefault** - The virtual machine's default patching - /// configuration is used. <br /><br /> - /// **AutomaticByPlatform** - The virtual machine will be automatically - /// updated by the platform. The property provisionVMAgent must be - /// true. Possible values include: 'ImageDefault', - /// 'AutomaticByPlatform' - /// Specifies the mode of VM Guest Patch - /// Assessment for the IaaS virtual machine.<br /><br /> - /// Possible values are:<br /><br /> **ImageDefault** - You - /// control the timing of patch assessments on a virtual machine. - /// <br /><br /> **AutomaticByPlatform** - The platform - /// will trigger periodic patch assessments. The property - /// provisionVMAgent must be true. Possible values include: - /// 'ImageDefault', 'AutomaticByPlatform' - /// Specifies additional - /// settings for patch mode AutomaticByPlatform in VM Guest Patching on - /// Linux. + + /// Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + /// machines associated to virtual machine scale set with OrchestrationMode as + /// Flexible.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - + /// The virtual machine's default patching configuration is used. <br /><br /> + /// **AutomaticByPlatform** - The virtual machine will be automatically updated + /// by the platform. The property provisionVMAgent must be true + /// Possible values include: 'ImageDefault', 'AutomaticByPlatform' + + /// Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + /// machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - + /// You control the timing of patch assessments on a virtual machine. <br /><br + /// /> **AutomaticByPlatform** - The platform will trigger periodic patch + /// assessments. The property provisionVMAgent must be true. + /// Possible values include: 'ImageDefault', 'AutomaticByPlatform' + + /// Specifies additional settings for patch mode AutomaticByPlatform in VM + /// Guest Patching on Linux. + /// public LinuxPatchSettings(string patchMode = default(string), string assessmentMode = default(string), LinuxVMGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings = default(LinuxVMGuestPatchAutomaticByPlatformSettings)) + { - PatchMode = patchMode; - AssessmentMode = assessmentMode; - AutomaticByPlatformSettings = automaticByPlatformSettings; + this.PatchMode = patchMode; + this.AssessmentMode = assessmentMode; + this.AutomaticByPlatformSettings = automaticByPlatformSettings; CustomInit(); } @@ -63,40 +56,34 @@ public LinuxPatchSettings() /// partial void CustomInit(); + /// - /// Gets or sets specifies the mode of VM Guest Patching to IaaS - /// virtual machine or virtual machines associated to virtual machine - /// scale set with OrchestrationMode as Flexible.&lt;br - /// /&gt;&lt;br /&gt; Possible values are:&lt;br - /// /&gt;&lt;br /&gt; **ImageDefault** - The virtual - /// machine's default patching configuration is used. &lt;br - /// /&gt;&lt;br /&gt; **AutomaticByPlatform** - The virtual - /// machine will be automatically updated by the platform. The property - /// provisionVMAgent must be true. Possible values include: - /// 'ImageDefault', 'AutomaticByPlatform' + /// Gets or sets specifies the mode of VM Guest Patching to IaaS virtual + /// machine or virtual machines associated to virtual machine scale set with + /// OrchestrationMode as Flexible.<br /><br /> Possible values are:<br /><br /> + /// **ImageDefault** - The virtual machine's default patching configuration is + /// used. <br /><br /> **AutomaticByPlatform** - The virtual machine will be + /// automatically updated by the platform. The property provisionVMAgent must + /// be true Possible values include: 'ImageDefault', 'AutomaticByPlatform' /// - [JsonProperty(PropertyName = "patchMode")] - public string PatchMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "patchMode")] + public string PatchMode {get; set; } /// - /// Gets or sets specifies the mode of VM Guest Patch Assessment for - /// the IaaS virtual machine.&lt;br /&gt;&lt;br /&gt; - /// Possible values are:&lt;br /&gt;&lt;br /&gt; - /// **ImageDefault** - You control the timing of patch assessments on a - /// virtual machine. &lt;br /&gt;&lt;br /&gt; - /// **AutomaticByPlatform** - The platform will trigger periodic patch - /// assessments. The property provisionVMAgent must be true. Possible - /// values include: 'ImageDefault', 'AutomaticByPlatform' + /// Gets or sets specifies the mode of VM Guest Patch Assessment for the IaaS + /// virtual machine.<br /><br /> Possible values are:<br /><br /> + /// **ImageDefault** - You control the timing of patch assessments on a virtual + /// machine. <br /><br /> **AutomaticByPlatform** - The platform will trigger + /// periodic patch assessments. The property provisionVMAgent must be true. Possible values include: 'ImageDefault', 'AutomaticByPlatform' /// - [JsonProperty(PropertyName = "assessmentMode")] - public string AssessmentMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "assessmentMode")] + public string AssessmentMode {get; set; } /// /// Gets or sets specifies additional settings for patch mode /// AutomaticByPlatform in VM Guest Patching on Linux. /// - [JsonProperty(PropertyName = "automaticByPlatformSettings")] - public LinuxVMGuestPatchAutomaticByPlatformSettings AutomaticByPlatformSettings { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "automaticByPlatformSettings")] + public LinuxVMGuestPatchAutomaticByPlatformSettings AutomaticByPlatformSettings {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.cs index 3de6df292b10..41e4a6d5160c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for LinuxVMGuestPatchAutomaticByPlatformRebootSetting. /// + + public static class LinuxVMGuestPatchAutomaticByPlatformRebootSetting { public const string Unknown = "Unknown"; @@ -21,4 +18,4 @@ public static class LinuxVMGuestPatchAutomaticByPlatformRebootSetting public const string Never = "Never"; public const string Always = "Always"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxVMGuestPatchAutomaticByPlatformSettings.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxVMGuestPatchAutomaticByPlatformSettings.cs index f0fd85dd1e24..e54047ad1623 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxVMGuestPatchAutomaticByPlatformSettings.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxVMGuestPatchAutomaticByPlatformSettings.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +14,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class LinuxVMGuestPatchAutomaticByPlatformSettings { /// - /// Initializes a new instance of the - /// LinuxVMGuestPatchAutomaticByPlatformSettings class. + /// Initializes a new instance of the LinuxVMGuestPatchAutomaticByPlatformSettings class. /// public LinuxVMGuestPatchAutomaticByPlatformSettings() { @@ -29,18 +22,20 @@ public LinuxVMGuestPatchAutomaticByPlatformSettings() } /// - /// Initializes a new instance of the - /// LinuxVMGuestPatchAutomaticByPlatformSettings class. + /// Initializes a new instance of the LinuxVMGuestPatchAutomaticByPlatformSettings class. /// - /// Specifies the reboot setting for all - /// AutomaticByPlatform patch installation operations. Possible values - /// include: 'Unknown', 'IfRequired', 'Never', 'Always' - /// Enables - /// customer to schedule patching without accidental upgrades + + /// Specifies the reboot setting for all AutomaticByPlatform patch installation + /// operations. + /// Possible values include: 'Unknown', 'IfRequired', 'Never', 'Always' + + /// Enables customer to schedule patching without accidental upgrades + /// public LinuxVMGuestPatchAutomaticByPlatformSettings(string rebootSetting = default(string), bool? bypassPlatformSafetyChecksOnUserSchedule = default(bool?)) + { - RebootSetting = rebootSetting; - BypassPlatformSafetyChecksOnUserSchedule = bypassPlatformSafetyChecksOnUserSchedule; + this.RebootSetting = rebootSetting; + this.BypassPlatformSafetyChecksOnUserSchedule = bypassPlatformSafetyChecksOnUserSchedule; CustomInit(); } @@ -49,20 +44,19 @@ public LinuxVMGuestPatchAutomaticByPlatformSettings() /// partial void CustomInit(); + /// - /// Gets or sets specifies the reboot setting for all - /// AutomaticByPlatform patch installation operations. Possible values - /// include: 'Unknown', 'IfRequired', 'Never', 'Always' + /// Gets or sets specifies the reboot setting for all AutomaticByPlatform patch + /// installation operations. Possible values include: 'Unknown', 'IfRequired', 'Never', 'Always' /// - [JsonProperty(PropertyName = "rebootSetting")] - public string RebootSetting { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "rebootSetting")] + public string RebootSetting {get; set; } /// - /// Gets or sets enables customer to schedule patching without - /// accidental upgrades + /// Gets or sets enables customer to schedule patching without accidental + /// upgrades /// - [JsonProperty(PropertyName = "bypassPlatformSafetyChecksOnUserSchedule")] - public bool? BypassPlatformSafetyChecksOnUserSchedule { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "bypassPlatformSafetyChecksOnUserSchedule")] + public bool? BypassPlatformSafetyChecksOnUserSchedule {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxVMGuestPatchMode.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxVMGuestPatchMode.cs index 403817291610..cd08992e63f1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxVMGuestPatchMode.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/LinuxVMGuestPatchMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for LinuxVMGuestPatchMode. /// + + public static class LinuxVMGuestPatchMode { public const string ImageDefault = "ImageDefault"; public const string AutomaticByPlatform = "AutomaticByPlatform"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/LocationData.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/LocationData.cs index 3e216b975126..0ac53202e7f9 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/LocationData.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/LocationData.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,20 +23,25 @@ public LocationData() /// /// Initializes a new instance of the LocationData class. /// - /// A canonical name for the geographic or physical - /// location. - /// The city or locality where the resource is - /// located. - /// The district, state, or province where the - /// resource is located. - /// The country or region where the - /// resource is located + + /// A canonical name for the geographic or physical location. + /// + + /// The city or locality where the resource is located. + /// + + /// The district, state, or province where the resource is located. + /// + + /// The country or region where the resource is located + /// public LocationData(string name, string city = default(string), string district = default(string), string countryOrRegion = default(string)) + { - Name = name; - City = city; - District = district; - CountryOrRegion = countryOrRegion; + this.Name = name; + this.City = city; + this.District = district; + this.CountryOrRegion = countryOrRegion; CustomInit(); } @@ -52,51 +50,53 @@ public LocationData() /// partial void CustomInit(); + /// - /// Gets or sets a canonical name for the geographic or physical - /// location. + /// Gets or sets a canonical name for the geographic or physical location. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the city or locality where the resource is located. /// - [JsonProperty(PropertyName = "city")] - public string City { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "city")] + public string City {get; set; } /// /// Gets or sets the district, state, or province where the resource is /// located. /// - [JsonProperty(PropertyName = "district")] - public string District { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "district")] + public string District {get; set; } /// /// Gets or sets the country or region where the resource is located /// - [JsonProperty(PropertyName = "countryOrRegion")] - public string CountryOrRegion { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "countryOrRegion")] + public string CountryOrRegion {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (Name != null) + if (this.Name != null) { - if (Name.Length > 256) + if (this.Name.Length > 256) { - throw new ValidationException(ValidationRules.MaxLength, "Name", 256); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "Name", 256); } } + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/LogAnalyticsInputBase.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/LogAnalyticsInputBase.cs index 925a407294df..07b4ec3b2143 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/LogAnalyticsInputBase.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/LogAnalyticsInputBase.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,30 +23,42 @@ public LogAnalyticsInputBase() /// /// Initializes a new instance of the LogAnalyticsInputBase class. /// - /// SAS Uri of the logging blob - /// container to which LogAnalytics Api writes output logs to. - /// From time of the query - /// To time of the query - /// Group query result by Throttle - /// Policy applied. - /// Group query result by Operation - /// Name. - /// Group query result by Resource - /// Name. - /// Group query result by - /// Client Application ID. - /// Group query result by User - /// Agent. + + /// SAS Uri of the logging blob container to which LogAnalytics Api writes + /// output logs to. + /// + + /// From time of the query + /// + + /// To time of the query + /// + + /// Group query result by Throttle Policy applied. + /// + + /// Group query result by Operation Name. + /// + + /// Group query result by Resource Name. + /// + + /// Group query result by Client Application ID. + /// + + /// Group query result by User Agent. + /// public LogAnalyticsInputBase(string blobContainerSasUri, System.DateTime fromTime, System.DateTime toTime, bool? groupByThrottlePolicy = default(bool?), bool? groupByOperationName = default(bool?), bool? groupByResourceName = default(bool?), bool? groupByClientApplicationId = default(bool?), bool? groupByUserAgent = default(bool?)) + { - BlobContainerSasUri = blobContainerSasUri; - FromTime = fromTime; - ToTime = toTime; - GroupByThrottlePolicy = groupByThrottlePolicy; - GroupByOperationName = groupByOperationName; - GroupByResourceName = groupByResourceName; - GroupByClientApplicationId = groupByClientApplicationId; - GroupByUserAgent = groupByUserAgent; + this.BlobContainerSasUri = blobContainerSasUri; + this.FromTime = fromTime; + this.ToTime = toTime; + this.GroupByThrottlePolicy = groupByThrottlePolicy; + this.GroupByOperationName = groupByOperationName; + this.GroupByResourceName = groupByResourceName; + this.GroupByClientApplicationId = groupByClientApplicationId; + this.GroupByUserAgent = groupByUserAgent; CustomInit(); } @@ -62,67 +67,68 @@ public LogAnalyticsInputBase() /// partial void CustomInit(); + /// - /// Gets or sets SAS Uri of the logging blob container to which - /// LogAnalytics Api writes output logs to. + /// Gets or sets sAS Uri of the logging blob container to which LogAnalytics + /// Api writes output logs to. /// - [JsonProperty(PropertyName = "blobContainerSasUri")] - public string BlobContainerSasUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "blobContainerSasUri")] + public string BlobContainerSasUri {get; set; } /// /// Gets or sets from time of the query /// - [JsonProperty(PropertyName = "fromTime")] - public System.DateTime FromTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "fromTime")] + public System.DateTime FromTime {get; set; } /// /// Gets or sets to time of the query /// - [JsonProperty(PropertyName = "toTime")] - public System.DateTime ToTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "toTime")] + public System.DateTime ToTime {get; set; } /// /// Gets or sets group query result by Throttle Policy applied. /// - [JsonProperty(PropertyName = "groupByThrottlePolicy")] - public bool? GroupByThrottlePolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "groupByThrottlePolicy")] + public bool? GroupByThrottlePolicy {get; set; } /// /// Gets or sets group query result by Operation Name. /// - [JsonProperty(PropertyName = "groupByOperationName")] - public bool? GroupByOperationName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "groupByOperationName")] + public bool? GroupByOperationName {get; set; } /// /// Gets or sets group query result by Resource Name. /// - [JsonProperty(PropertyName = "groupByResourceName")] - public bool? GroupByResourceName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "groupByResourceName")] + public bool? GroupByResourceName {get; set; } /// /// Gets or sets group query result by Client Application ID. /// - [JsonProperty(PropertyName = "groupByClientApplicationId")] - public bool? GroupByClientApplicationId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "groupByClientApplicationId")] + public bool? GroupByClientApplicationId {get; set; } /// /// Gets or sets group query result by User Agent. /// - [JsonProperty(PropertyName = "groupByUserAgent")] - public bool? GroupByUserAgent { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "groupByUserAgent")] + public bool? GroupByUserAgent {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (BlobContainerSasUri == null) + if (this.BlobContainerSasUri == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "BlobContainerSasUri"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "BlobContainerSasUri"); } + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/LogAnalyticsOperationResult.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/LogAnalyticsOperationResult.cs index f2a5fdcb17e3..631cea7d0378 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/LogAnalyticsOperationResult.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/LogAnalyticsOperationResult.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class LogAnalyticsOperationResult { /// - /// Initializes a new instance of the LogAnalyticsOperationResult - /// class. + /// Initializes a new instance of the LogAnalyticsOperationResult class. /// public LogAnalyticsOperationResult() { @@ -28,13 +21,15 @@ public LogAnalyticsOperationResult() } /// - /// Initializes a new instance of the LogAnalyticsOperationResult - /// class. + /// Initializes a new instance of the LogAnalyticsOperationResult class. /// - /// LogAnalyticsOutput + + /// LogAnalyticsOutput + /// public LogAnalyticsOperationResult(LogAnalyticsOutput properties = default(LogAnalyticsOutput)) + { - Properties = properties; + this.Properties = properties; CustomInit(); } @@ -43,11 +38,11 @@ public LogAnalyticsOperationResult() /// partial void CustomInit(); + /// /// Gets logAnalyticsOutput /// - [JsonProperty(PropertyName = "properties")] - public LogAnalyticsOutput Properties { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public LogAnalyticsOutput Properties {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/LogAnalyticsOutput.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/LogAnalyticsOutput.cs index 97b5920a51ff..1899e581f09b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/LogAnalyticsOutput.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/LogAnalyticsOutput.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public LogAnalyticsOutput() /// /// Initializes a new instance of the LogAnalyticsOutput class. /// - /// Output file Uri path to blob - /// container. + + /// Output file Uri path to blob container. + /// public LogAnalyticsOutput(string output = default(string)) + { - Output = output; + this.Output = output; CustomInit(); } @@ -42,11 +38,11 @@ public LogAnalyticsOutput() /// partial void CustomInit(); + /// /// Gets output file Uri path to blob container. /// - [JsonProperty(PropertyName = "output")] - public string Output { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "output")] + public string Output {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/MaintenanceOperationResultCodeTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/MaintenanceOperationResultCodeTypes.cs index fee29be59b26..8959a79532f0 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/MaintenanceOperationResultCodeTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/MaintenanceOperationResultCodeTypes.cs @@ -1,33 +1,26 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for MaintenanceOperationResultCodeTypes. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum MaintenanceOperationResultCodeTypes { - [EnumMember(Value = "None")] + [System.Runtime.Serialization.EnumMember(Value = "None")] None, - [EnumMember(Value = "RetryLater")] + [System.Runtime.Serialization.EnumMember(Value = "RetryLater")] RetryLater, - [EnumMember(Value = "MaintenanceAborted")] + [System.Runtime.Serialization.EnumMember(Value = "MaintenanceAborted")] MaintenanceAborted, - [EnumMember(Value = "MaintenanceCompleted")] + [System.Runtime.Serialization.EnumMember(Value = "MaintenanceCompleted")] MaintenanceCompleted } internal static class MaintenanceOperationResultCodeTypesEnumExtension @@ -36,7 +29,6 @@ internal static string ToSerializedValue(this MaintenanceOperationResultCodeType { return value == null ? null : ((MaintenanceOperationResultCodeTypes)value).ToSerializedValue(); } - internal static string ToSerializedValue(this MaintenanceOperationResultCodeTypes value) { switch( value ) @@ -52,7 +44,6 @@ internal static string ToSerializedValue(this MaintenanceOperationResultCodeType } return null; } - internal static MaintenanceOperationResultCodeTypes? ParseMaintenanceOperationResultCodeTypes(this string value) { switch( value ) @@ -69,4 +60,4 @@ internal static string ToSerializedValue(this MaintenanceOperationResultCodeType return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/MaintenanceRedeployStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/MaintenanceRedeployStatus.cs index 167a3bdf7f87..ff698f463858 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/MaintenanceRedeployStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/MaintenanceRedeployStatus.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,30 +23,38 @@ public MaintenanceRedeployStatus() /// /// Initializes a new instance of the MaintenanceRedeployStatus class. /// - /// True, if - /// customer is allowed to perform Maintenance. - /// Start Time for the Pre - /// Maintenance Window. - /// End Time for the Pre - /// Maintenance Window. - /// Start Time for the - /// Maintenance Window. - /// End Time for the Maintenance - /// Window. - /// The Last Maintenance - /// Operation Result Code. Possible values include: 'None', - /// 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' - /// Message returned for the last - /// Maintenance Operation. + + /// True, if customer is allowed to perform Maintenance. + /// + + /// Start Time for the Pre Maintenance Window. + /// + + /// End Time for the Pre Maintenance Window. + /// + + /// Start Time for the Maintenance Window. + /// + + /// End Time for the Maintenance Window. + /// + + /// The Last Maintenance Operation Result Code. + /// Possible values include: 'None', 'RetryLater', 'MaintenanceAborted', + /// 'MaintenanceCompleted' + + /// Message returned for the last Maintenance Operation. + /// public MaintenanceRedeployStatus(bool? isCustomerInitiatedMaintenanceAllowed = default(bool?), System.DateTime? preMaintenanceWindowStartTime = default(System.DateTime?), System.DateTime? preMaintenanceWindowEndTime = default(System.DateTime?), System.DateTime? maintenanceWindowStartTime = default(System.DateTime?), System.DateTime? maintenanceWindowEndTime = default(System.DateTime?), MaintenanceOperationResultCodeTypes? lastOperationResultCode = default(MaintenanceOperationResultCodeTypes?), string lastOperationMessage = default(string)) + { - IsCustomerInitiatedMaintenanceAllowed = isCustomerInitiatedMaintenanceAllowed; - PreMaintenanceWindowStartTime = preMaintenanceWindowStartTime; - PreMaintenanceWindowEndTime = preMaintenanceWindowEndTime; - MaintenanceWindowStartTime = maintenanceWindowStartTime; - MaintenanceWindowEndTime = maintenanceWindowEndTime; - LastOperationResultCode = lastOperationResultCode; - LastOperationMessage = lastOperationMessage; + this.IsCustomerInitiatedMaintenanceAllowed = isCustomerInitiatedMaintenanceAllowed; + this.PreMaintenanceWindowStartTime = preMaintenanceWindowStartTime; + this.PreMaintenanceWindowEndTime = preMaintenanceWindowEndTime; + this.MaintenanceWindowStartTime = maintenanceWindowStartTime; + this.MaintenanceWindowEndTime = maintenanceWindowEndTime; + this.LastOperationResultCode = lastOperationResultCode; + this.LastOperationMessage = lastOperationMessage; CustomInit(); } @@ -61,49 +63,47 @@ public MaintenanceRedeployStatus() /// partial void CustomInit(); + /// /// Gets or sets true, if customer is allowed to perform Maintenance. /// - [JsonProperty(PropertyName = "isCustomerInitiatedMaintenanceAllowed")] - public bool? IsCustomerInitiatedMaintenanceAllowed { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "isCustomerInitiatedMaintenanceAllowed")] + public bool? IsCustomerInitiatedMaintenanceAllowed {get; set; } /// /// Gets or sets start Time for the Pre Maintenance Window. /// - [JsonProperty(PropertyName = "preMaintenanceWindowStartTime")] - public System.DateTime? PreMaintenanceWindowStartTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "preMaintenanceWindowStartTime")] + public System.DateTime? PreMaintenanceWindowStartTime {get; set; } /// /// Gets or sets end Time for the Pre Maintenance Window. /// - [JsonProperty(PropertyName = "preMaintenanceWindowEndTime")] - public System.DateTime? PreMaintenanceWindowEndTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "preMaintenanceWindowEndTime")] + public System.DateTime? PreMaintenanceWindowEndTime {get; set; } /// /// Gets or sets start Time for the Maintenance Window. /// - [JsonProperty(PropertyName = "maintenanceWindowStartTime")] - public System.DateTime? MaintenanceWindowStartTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maintenanceWindowStartTime")] + public System.DateTime? MaintenanceWindowStartTime {get; set; } /// /// Gets or sets end Time for the Maintenance Window. /// - [JsonProperty(PropertyName = "maintenanceWindowEndTime")] - public System.DateTime? MaintenanceWindowEndTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maintenanceWindowEndTime")] + public System.DateTime? MaintenanceWindowEndTime {get; set; } /// - /// Gets or sets the Last Maintenance Operation Result Code. Possible - /// values include: 'None', 'RetryLater', 'MaintenanceAborted', - /// 'MaintenanceCompleted' + /// Gets or sets the Last Maintenance Operation Result Code. Possible values include: 'None', 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' /// - [JsonProperty(PropertyName = "lastOperationResultCode")] - public MaintenanceOperationResultCodeTypes? LastOperationResultCode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastOperationResultCode")] + public MaintenanceOperationResultCodeTypes? LastOperationResultCode {get; set; } /// /// Gets or sets message returned for the last Maintenance Operation. /// - [JsonProperty(PropertyName = "lastOperationMessage")] - public string LastOperationMessage { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "lastOperationMessage")] + public string LastOperationMessage {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ManagedDiskParameters.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ManagedDiskParameters.cs index d725e5cd8244..526dbfb089b3 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ManagedDiskParameters.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ManagedDiskParameters.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,22 +23,28 @@ public ManagedDiskParameters() /// /// Initializes a new instance of the ManagedDiskParameters class. /// - /// Resource Id - /// Specifies the storage account type - /// for the managed disk. NOTE: UltraSSD_LRS can only be used with data - /// disks, it cannot be used with OS Disk. Possible values include: - /// 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS', - /// 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' - /// Specifies the customer managed disk - /// encryption set resource id for the managed disk. - /// Specifies the security profile for - /// the managed disk. + + /// Resource Id + /// + + /// Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + /// can only be used with data disks, it cannot be used with OS Disk. + /// Possible values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + /// 'UltraSSD_LRS', 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' + + /// Specifies the customer managed disk encryption set resource id for the + /// managed disk. + /// + + /// Specifies the security profile for the managed disk. + /// public ManagedDiskParameters(string id = default(string), string storageAccountType = default(string), DiskEncryptionSetParameters diskEncryptionSet = default(DiskEncryptionSetParameters), VMDiskSecurityProfile securityProfile = default(VMDiskSecurityProfile)) - : base(id) + + : base(id) { - StorageAccountType = storageAccountType; - DiskEncryptionSet = diskEncryptionSet; - SecurityProfile = securityProfile; + this.StorageAccountType = storageAccountType; + this.DiskEncryptionSet = diskEncryptionSet; + this.SecurityProfile = securityProfile; CustomInit(); } @@ -53,28 +53,26 @@ public ManagedDiskParameters() /// partial void CustomInit(); + /// - /// Gets or sets specifies the storage account type for the managed - /// disk. NOTE: UltraSSD_LRS can only be used with data disks, it - /// cannot be used with OS Disk. Possible values include: - /// 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS', - /// 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' + /// Gets or sets specifies the storage account type for the managed disk. NOTE: + /// UltraSSD_LRS can only be used with data disks, it cannot be used with OS + /// Disk. Possible values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS', 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' /// - [JsonProperty(PropertyName = "storageAccountType")] - public string StorageAccountType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountType")] + public string StorageAccountType {get; set; } /// - /// Gets or sets specifies the customer managed disk encryption set - /// resource id for the managed disk. + /// Gets or sets specifies the customer managed disk encryption set resource id + /// for the managed disk. /// - [JsonProperty(PropertyName = "diskEncryptionSet")] - public DiskEncryptionSetParameters DiskEncryptionSet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskEncryptionSet")] + public DiskEncryptionSetParameters DiskEncryptionSet {get; set; } /// /// Gets or sets specifies the security profile for the managed disk. /// - [JsonProperty(PropertyName = "securityProfile")] - public VMDiskSecurityProfile SecurityProfile { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "securityProfile")] + public VMDiskSecurityProfile SecurityProfile {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/MaxInstancePercentPerZonePolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/MaxInstancePercentPerZonePolicy.cs index 948c9513a286..1bcbc99e6a50 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/MaxInstancePercentPerZonePolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/MaxInstancePercentPerZonePolicy.cs @@ -1,28 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// - /// The configuration parameters used to limit the number of virtual - /// machines per availability zone in the virtual machine scale set. + /// The configuration parameters used to limit the number of virtual machines + /// per availability zone in the virtual machine scale set. /// public partial class MaxInstancePercentPerZonePolicy { /// - /// Initializes a new instance of the MaxInstancePercentPerZonePolicy - /// class. + /// Initializes a new instance of the MaxInstancePercentPerZonePolicy class. /// public MaxInstancePercentPerZonePolicy() { @@ -30,19 +22,21 @@ public MaxInstancePercentPerZonePolicy() } /// - /// Initializes a new instance of the MaxInstancePercentPerZonePolicy - /// class. + /// Initializes a new instance of the MaxInstancePercentPerZonePolicy class. /// - /// Specifies whether - /// maxInstancePercentPerZonePolicy should be enabled on the virtual - /// machine scale set. - /// Limit on the number of instances in each zone - /// as a percentage of the total capacity of the virtual machine scale - /// set. + + /// Specifies whether maxInstancePercentPerZonePolicy should be enabled on the + /// virtual machine scale set. + /// + + /// Limit on the number of instances in each zone as a percentage of the total + /// capacity of the virtual machine scale set. + /// public MaxInstancePercentPerZonePolicy(bool? enabled = default(bool?), int? value = default(int?)) + { - Enabled = enabled; - Value = value; + this.Enabled = enabled; + this.Value = value; CustomInit(); } @@ -51,35 +45,35 @@ public MaxInstancePercentPerZonePolicy() /// partial void CustomInit(); + /// - /// Gets or sets specifies whether maxInstancePercentPerZonePolicy - /// should be enabled on the virtual machine scale set. + /// Gets or sets specifies whether maxInstancePercentPerZonePolicy should be + /// enabled on the virtual machine scale set. /// - [JsonProperty(PropertyName = "enabled")] - public bool? Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } /// - /// Gets or sets limit on the number of instances in each zone as a - /// percentage of the total capacity of the virtual machine scale set. + /// Gets or sets limit on the number of instances in each zone as a percentage + /// of the total capacity of the virtual machine scale set. /// - [JsonProperty(PropertyName = "value")] - public int? Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public int? Value {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Value != null) + if (this.Value != null) { - if (Value > 100) + if (this.Value > 100) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Value", 100); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "Value", 100); } } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/MigrateToVirtualMachineScaleSetInput.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/MigrateToVirtualMachineScaleSetInput.cs index c3dfc03ab82b..a690fee5c0fe 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/MigrateToVirtualMachineScaleSetInput.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/MigrateToVirtualMachineScaleSetInput.cs @@ -1,28 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// - /// Describes the Virtual Machine Scale Set to migrate from Availability - /// Set. + /// Describes the Virtual Machine Scale Set to migrate from Availability Set. /// public partial class MigrateToVirtualMachineScaleSetInput { /// - /// Initializes a new instance of the - /// MigrateToVirtualMachineScaleSetInput class. + /// Initializes a new instance of the MigrateToVirtualMachineScaleSetInput class. /// public MigrateToVirtualMachineScaleSetInput() { @@ -30,15 +21,16 @@ public MigrateToVirtualMachineScaleSetInput() } /// - /// Initializes a new instance of the - /// MigrateToVirtualMachineScaleSetInput class. + /// Initializes a new instance of the MigrateToVirtualMachineScaleSetInput class. /// - /// Specifies information - /// about the Virtual Machine Scale Set that the Availability Set - /// should be migrated to. Minimum api‐version: 2024‐11‐01. + + /// Specifies information about the Virtual Machine Scale Set that the + /// Availability Set should be migrated to. Minimum api‐version: 2024‐11‐01. + /// public MigrateToVirtualMachineScaleSetInput(SubResource virtualMachineScaleSetFlexible) + { - VirtualMachineScaleSetFlexible = virtualMachineScaleSetFlexible; + this.VirtualMachineScaleSetFlexible = virtualMachineScaleSetFlexible; CustomInit(); } @@ -47,26 +39,27 @@ public MigrateToVirtualMachineScaleSetInput(SubResource virtualMachineScaleSetFl /// partial void CustomInit(); + /// - /// Gets or sets specifies information about the Virtual Machine Scale - /// Set that the Availability Set should be migrated to. Minimum - /// api‐version: 2024‐11‐01. + /// Gets or sets specifies information about the Virtual Machine Scale Set that + /// the Availability Set should be migrated to. Minimum api‐version: + /// 2024‐11‐01. /// - [JsonProperty(PropertyName = "virtualMachineScaleSetFlexible")] - public SubResource VirtualMachineScaleSetFlexible { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachineScaleSetFlexible")] + public SubResource VirtualMachineScaleSetFlexible {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (VirtualMachineScaleSetFlexible == null) + if (this.VirtualMachineScaleSetFlexible == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "VirtualMachineScaleSetFlexible"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VirtualMachineScaleSetFlexible"); } + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/MigrateVMToVirtualMachineScaleSetInput.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/MigrateVMToVirtualMachineScaleSetInput.cs index 0810876271fa..d2368b39f142 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/MigrateVMToVirtualMachineScaleSetInput.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/MigrateVMToVirtualMachineScaleSetInput.cs @@ -1,27 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// The input of virtual machine migration from Availability Set to - /// Flexible Virtual Machine Scale Set. + /// The input of virtual machine migration from Availability Set to Flexible + /// Virtual Machine Scale Set. /// public partial class MigrateVMToVirtualMachineScaleSetInput { /// - /// Initializes a new instance of the - /// MigrateVMToVirtualMachineScaleSetInput class. + /// Initializes a new instance of the MigrateVMToVirtualMachineScaleSetInput class. /// public MigrateVMToVirtualMachineScaleSetInput() { @@ -29,20 +22,25 @@ public MigrateVMToVirtualMachineScaleSetInput() } /// - /// Initializes a new instance of the - /// MigrateVMToVirtualMachineScaleSetInput class. + /// Initializes a new instance of the MigrateVMToVirtualMachineScaleSetInput class. /// - /// The target zone of VM migration to - /// Flexible Virtual Machine Scale Set. - /// The target compute fault domain of - /// VM migration to Flexible Virtual Machine Scale Set. - /// The target Virtual Machine size of VM - /// migration to Flexible Virtual Machine Scale Set. + + /// The target zone of VM migration to Flexible Virtual Machine Scale Set. + /// + + /// The target compute fault domain of VM migration to Flexible Virtual Machine + /// Scale Set. + /// + + /// The target Virtual Machine size of VM migration to Flexible Virtual Machine + /// Scale Set. + /// public MigrateVMToVirtualMachineScaleSetInput(string targetZone = default(string), int? targetFaultDomain = default(int?), string targetVMSize = default(string)) + { - TargetZone = targetZone; - TargetFaultDomain = targetFaultDomain; - TargetVMSize = targetVMSize; + this.TargetZone = targetZone; + this.TargetFaultDomain = targetFaultDomain; + this.TargetVMSize = targetVMSize; CustomInit(); } @@ -51,26 +49,26 @@ public MigrateVMToVirtualMachineScaleSetInput() /// partial void CustomInit(); + /// - /// Gets or sets the target zone of VM migration to Flexible Virtual - /// Machine Scale Set. + /// Gets or sets the target zone of VM migration to Flexible Virtual Machine + /// Scale Set. /// - [JsonProperty(PropertyName = "targetZone")] - public string TargetZone { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetZone")] + public string TargetZone {get; set; } /// - /// Gets or sets the target compute fault domain of VM migration to - /// Flexible Virtual Machine Scale Set. + /// Gets or sets the target compute fault domain of VM migration to Flexible + /// Virtual Machine Scale Set. /// - [JsonProperty(PropertyName = "targetFaultDomain")] - public int? TargetFaultDomain { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetFaultDomain")] + public int? TargetFaultDomain {get; set; } /// - /// Gets or sets the target Virtual Machine size of VM migration to - /// Flexible Virtual Machine Scale Set. + /// Gets or sets the target Virtual Machine size of VM migration to Flexible + /// Virtual Machine Scale Set. /// - [JsonProperty(PropertyName = "targetVMSize")] - public string TargetVMSize { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "targetVMSize")] + public string TargetVMSize {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Mode.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Mode.cs index b53673264cbe..52f77eabe064 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Mode.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/Mode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for Mode. /// + + public static class Mode { public const string Audit = "Audit"; public const string Enforce = "Enforce"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Modes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Modes.cs index 3c0dfb0ff419..e83a518c6d90 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Modes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/Modes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for Modes. /// + + public static class Modes { public const string Audit = "Audit"; public const string Enforce = "Enforce"; public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkAccessPolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkAccessPolicy.cs index 889fa06a09e9..3a457142b20b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkAccessPolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkAccessPolicy.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for NetworkAccessPolicy. /// + + public static class NetworkAccessPolicy { /// @@ -21,8 +18,8 @@ public static class NetworkAccessPolicy /// public const string AllowAll = "AllowAll"; /// - /// The disk can be exported or uploaded to using a DiskAccess - /// resource's private endpoints. + /// The disk can be exported or uploaded to using a DiskAccess resource's + /// private endpoints. /// public const string AllowPrivate = "AllowPrivate"; /// @@ -30,4 +27,4 @@ public static class NetworkAccessPolicy /// public const string DenyAll = "DenyAll"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkApiVersion.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkApiVersion.cs index f2789a26ed69..a17b638a9925 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkApiVersion.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkApiVersion.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for NetworkApiVersion. /// + + public static class NetworkApiVersion { - public const string TwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne = "2020-11-01"; - public const string TwoZeroTwoTwoHyphenMinusOneOneHyphenMinusZeroOne = "2022-11-01"; + public const string TwoThousandTwenty1101 = "2020-11-01"; + public const string TwoThousandTwentyTwo1101 = "2022-11-01"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkInterfaceAuxiliaryMode.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkInterfaceAuxiliaryMode.cs index 0ecaaa4b2bb9..f981c83bcc0f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkInterfaceAuxiliaryMode.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkInterfaceAuxiliaryMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for NetworkInterfaceAuxiliaryMode. /// + + public static class NetworkInterfaceAuxiliaryMode { public const string None = "None"; public const string AcceleratedConnections = "AcceleratedConnections"; public const string Floating = "Floating"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkInterfaceAuxiliarySku.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkInterfaceAuxiliarySku.cs index 0efa8ec4b9f7..3470b7a176c3 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkInterfaceAuxiliarySku.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkInterfaceAuxiliarySku.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for NetworkInterfaceAuxiliarySku. /// + + public static class NetworkInterfaceAuxiliarySku { public const string None = "None"; @@ -22,4 +19,4 @@ public static class NetworkInterfaceAuxiliarySku public const string A4 = "A4"; public const string A8 = "A8"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkInterfaceReference.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkInterfaceReference.cs index 063e64a641ce..86ded7f8eb30 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkInterfaceReference.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkInterfaceReference.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Describes a network interface reference. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NetworkInterfaceReference : SubResource { /// @@ -32,17 +24,22 @@ public NetworkInterfaceReference() /// /// Initializes a new instance of the NetworkInterfaceReference class. /// - /// Resource Id - /// Specifies the primary network interface in - /// case the virtual machine has more than 1 network interface. - /// Specify what happens to the network - /// interface when the VM is deleted. Possible values include: - /// 'Delete', 'Detach' + + /// Resource Id + /// + + /// Specifies the primary network interface in case the virtual machine has + /// more than 1 network interface. + /// + + /// Specify what happens to the network interface when the VM is deleted + /// Possible values include: 'Delete', 'Detach' public NetworkInterfaceReference(string id = default(string), bool? primary = default(bool?), string deleteOption = default(string)) - : base(id) + + : base(id) { - Primary = primary; - DeleteOption = deleteOption; + this.Primary = primary; + this.DeleteOption = deleteOption; CustomInit(); } @@ -51,19 +48,19 @@ public NetworkInterfaceReference() /// partial void CustomInit(); + /// - /// Gets or sets specifies the primary network interface in case the - /// virtual machine has more than 1 network interface. + /// Gets or sets specifies the primary network interface in case the virtual + /// machine has more than 1 network interface. /// - [JsonProperty(PropertyName = "properties.primary")] - public bool? Primary { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primary")] + public bool? Primary {get; set; } /// - /// Gets or sets specify what happens to the network interface when the - /// VM is deleted. Possible values include: 'Delete', 'Detach' + /// Gets or sets specify what happens to the network interface when the VM is + /// deleted Possible values include: 'Delete', 'Detach' /// - [JsonProperty(PropertyName = "properties.deleteOption")] - public string DeleteOption { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deleteOption")] + public string DeleteOption {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkInterfaceReferenceProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkInterfaceReferenceProperties.cs new file mode 100644 index 000000000000..75c554a49c28 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkInterfaceReferenceProperties.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes a network interface reference properties. + /// + public partial class NetworkInterfaceReferenceProperties + { + /// + /// Initializes a new instance of the NetworkInterfaceReferenceProperties class. + /// + public NetworkInterfaceReferenceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkInterfaceReferenceProperties class. + /// + + /// Specifies the primary network interface in case the virtual machine has + /// more than 1 network interface. + /// + + /// Specify what happens to the network interface when the VM is deleted + /// Possible values include: 'Delete', 'Detach' + public NetworkInterfaceReferenceProperties(bool? primary = default(bool?), string deleteOption = default(string)) + + { + this.Primary = primary; + this.DeleteOption = deleteOption; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets specifies the primary network interface in case the virtual + /// machine has more than 1 network interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primary")] + public bool? Primary {get; set; } + + /// + /// Gets or sets specify what happens to the network interface when the VM is + /// deleted Possible values include: 'Delete', 'Detach' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "deleteOption")] + public string DeleteOption {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkProfile.cs index 0ba955de3e37..8066c77c7097 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/NetworkProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,21 +24,24 @@ public NetworkProfile() /// /// Initializes a new instance of the NetworkProfile class. /// - /// Specifies the list of resource Ids - /// for the network interfaces associated with the virtual - /// machine. - /// specifies the Microsoft.Network API - /// version used when creating networking resources in the Network - /// Interface Configurations. Possible values include: '2020-11-01', - /// '2022-11-01' - /// Specifies the - /// networking configurations that will be used to create the virtual - /// machine networking resources. - public NetworkProfile(IList networkInterfaces = default(IList), string networkApiVersion = default(string), IList networkInterfaceConfigurations = default(IList)) + + /// Specifies the list of resource Ids for the network interfaces associated + /// with the virtual machine. + /// + + /// specifies the Microsoft.Network API version used when creating networking + /// resources in the Network Interface Configurations + /// Possible values include: '2020-11-01', '2022-11-01' + + /// Specifies the networking configurations that will be used to create the + /// virtual machine networking resources. + /// + public NetworkProfile(System.Collections.Generic.IList networkInterfaces = default(System.Collections.Generic.IList), string networkApiVersion = default(string), System.Collections.Generic.IList networkInterfaceConfigurations = default(System.Collections.Generic.IList)) + { - NetworkInterfaces = networkInterfaces; - NetworkApiVersion = networkApiVersion; - NetworkInterfaceConfigurations = networkInterfaceConfigurations; + this.NetworkInterfaces = networkInterfaces; + this.NetworkApiVersion = networkApiVersion; + this.NetworkInterfaceConfigurations = networkInterfaceConfigurations; CustomInit(); } @@ -55,27 +50,26 @@ public NetworkProfile() /// partial void CustomInit(); + /// - /// Gets or sets specifies the list of resource Ids for the network - /// interfaces associated with the virtual machine. + /// Gets or sets specifies the list of resource Ids for the network interfaces + /// associated with the virtual machine. /// - [JsonProperty(PropertyName = "networkInterfaces")] - public IList NetworkInterfaces { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterfaces")] + public System.Collections.Generic.IList NetworkInterfaces {get; set; } /// - /// Gets or sets specifies the Microsoft.Network API version used when - /// creating networking resources in the Network Interface - /// Configurations. Possible values include: '2020-11-01', '2022-11-01' + /// Gets or sets specifies the Microsoft.Network API version used when creating + /// networking resources in the Network Interface Configurations Possible values include: '2020-11-01', '2022-11-01' /// - [JsonProperty(PropertyName = "networkApiVersion")] - public string NetworkApiVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "networkApiVersion")] + public string NetworkApiVersion {get; set; } /// - /// Gets or sets specifies the networking configurations that will be - /// used to create the virtual machine networking resources. + /// Gets or sets specifies the networking configurations that will be used to + /// create the virtual machine networking resources. /// - [JsonProperty(PropertyName = "networkInterfaceConfigurations")] - public IList NetworkInterfaceConfigurations { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterfaceConfigurations")] + public System.Collections.Generic.IList NetworkInterfaceConfigurations {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OSDisk.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OSDisk.cs index 26e0bc7b0d65..480d084e2855 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OSDisk.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OSDisk.cs @@ -1,23 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// - /// Specifies information about the operating system disk used by the - /// virtual machine. For more information about disks, see [About disks and - /// VHDs for Azure virtual + /// Specifies information about the operating system disk used by the virtual + /// machine. For more information about disks, see [About disks and VHDs for + /// Azure virtual /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). /// public partial class OSDisk @@ -33,66 +26,80 @@ public OSDisk() /// /// Initializes a new instance of the OSDisk class. /// - /// Specifies how the virtual machine disk - /// should be created. Possible values are **Attach:** This value is - /// used when you are using a specialized disk to create the virtual - /// machine. **FromImage:** This value is used when you are using an - /// image to create the virtual machine. If you are using a platform - /// image, you should also use the imageReference element described - /// above. If you are using a marketplace image, you should also use - /// the plan element previously described. Possible values include: - /// 'FromImage', 'Empty', 'Attach', 'Copy', 'Restore' - /// This property allows you to specify the type - /// of the OS that is included in the disk if creating a VM from - /// user-image or a specialized VHD. Possible values are: **Windows,** - /// **Linux.**. Possible values include: 'Windows', 'Linux' - /// Specifies the encryption settings - /// for the OS Disk. Minimum api-version: 2015-06-15. - /// The disk name. - /// The virtual hard disk. - /// The source user image virtual hard disk. The - /// virtual hard disk will be copied before being attached to the - /// virtual machine. If SourceImage is provided, the destination - /// virtual hard drive must not exist. - /// Specifies the caching requirements. Possible - /// values are: **None,** **ReadOnly,** **ReadWrite.** The defaulting - /// behavior is: **None for Standard storage. ReadOnly for Premium - /// storage.**. Possible values include: 'None', 'ReadOnly', - /// 'ReadWrite' - /// Specifies whether - /// writeAccelerator should be enabled or disabled on the disk. - /// Specifies the ephemeral Disk - /// Settings for the operating system disk used by the virtual - /// machine. - /// Specifies the size of an empty data disk - /// in gigabytes. This element can be used to overwrite the size of the - /// disk in a virtual machine image. The property 'diskSizeGB' is the - /// number of bytes x 1024^3 for the disk and the value cannot be - /// larger than 1023. - /// The managed disk parameters. - /// Specifies whether OS Disk should be - /// deleted or detached upon VM deletion. Possible values are: - /// **Delete.** If this value is used, the OS disk is deleted when VM - /// is deleted. **Detach.** If this value is used, the os disk is - /// retained after VM is deleted. The default value is set to - /// **Detach**. For an ephemeral OS Disk, the default value is set to - /// **Delete**. The user cannot change the delete option for an - /// ephemeral OS Disk. Possible values include: 'Delete', - /// 'Detach' - public OSDisk(string createOption, OperatingSystemTypes? osType = default(OperatingSystemTypes?), DiskEncryptionSettings encryptionSettings = default(DiskEncryptionSettings), string name = default(string), VirtualHardDisk vhd = default(VirtualHardDisk), VirtualHardDisk image = default(VirtualHardDisk), CachingTypes? caching = default(CachingTypes?), bool? writeAcceleratorEnabled = default(bool?), DiffDiskSettings diffDiskSettings = default(DiffDiskSettings), int? diskSizeGB = default(int?), ManagedDiskParameters managedDisk = default(ManagedDiskParameters), string deleteOption = default(string)) + + /// This property allows you to specify the type of the OS that is included in + /// the disk if creating a VM from user-image or a specialized VHD. Possible + /// values are: **Windows,** **Linux.** + /// Possible values include: 'Windows', 'Linux' + + /// Specifies the encryption settings for the OS Disk. Minimum api-version: + /// 2015-06-15. + /// + + /// The disk name. + /// + + /// The virtual hard disk. + /// + + /// The source user image virtual hard disk. The virtual hard disk will be + /// copied before being attached to the virtual machine. If SourceImage is + /// provided, the destination virtual hard drive must not exist. + /// + + /// Specifies the caching requirements. Possible values are: **None,** + /// **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None for + /// Standard storage. ReadOnly for Premium storage.** + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + + /// Specifies whether writeAccelerator should be enabled or disabled on the + /// disk. + /// + + /// Specifies the ephemeral Disk Settings for the operating system disk used by + /// the virtual machine. + /// + + /// Specifies how the virtual machine disk should be created. Possible values + /// are **Attach:** This value is used when you are using a specialized disk to + /// create the virtual machine. **FromImage:** This value is used when you are + /// using an image to create the virtual machine. If you are using a platform + /// image, you should also use the imageReference element described above. If + /// you are using a marketplace image, you should also use the plan element + /// previously described. + /// Possible values include: 'FromImage', 'Empty', 'Attach', 'Copy', 'Restore' + + /// Specifies the size of an empty data disk in gigabytes. This element can be + /// used to overwrite the size of the disk in a virtual machine image. The + /// property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the + /// value cannot be larger than 1023. + /// + + /// The managed disk parameters. + /// + + /// Specifies whether OS Disk should be deleted or detached upon VM deletion. + /// Possible values are: **Delete.** If this value is used, the OS disk is + /// deleted when VM is deleted. **Detach.** If this value is used, the os disk + /// is retained after VM is deleted. The default value is set to **Detach**. + /// For an ephemeral OS Disk, the default value is set to **Delete**. The user + /// cannot change the delete option for an ephemeral OS Disk. + /// Possible values include: 'Delete', 'Detach' + public OSDisk(string createOption, OperatingSystemTypes? osType = default(OperatingSystemTypes?), DiskEncryptionSettings encryptionSettings = default(DiskEncryptionSettings), string name = default(string), VirtualHardDisk vhd = default(VirtualHardDisk), VirtualHardDisk image = default(VirtualHardDisk), CachingTypes? caching = default(CachingTypes?), bool? writeAcceleratorEnabled = default(bool?), DiffDiskSettings diffDiskSettings = default(DiffDiskSettings), int? diskSizeGb = default(int?), ManagedDiskParameters managedDisk = default(ManagedDiskParameters), string deleteOption = default(string)) + { - OsType = osType; - EncryptionSettings = encryptionSettings; - Name = name; - Vhd = vhd; - Image = image; - Caching = caching; - WriteAcceleratorEnabled = writeAcceleratorEnabled; - DiffDiskSettings = diffDiskSettings; - CreateOption = createOption; - DiskSizeGB = diskSizeGB; - ManagedDisk = managedDisk; - DeleteOption = deleteOption; + this.OsType = osType; + this.EncryptionSettings = encryptionSettings; + this.Name = name; + this.Vhd = vhd; + this.Image = image; + this.Caching = caching; + this.WriteAcceleratorEnabled = writeAcceleratorEnabled; + this.DiffDiskSettings = diffDiskSettings; + this.CreateOption = createOption; + this.DiskSizeGB = diskSizeGb; + this.ManagedDisk = managedDisk; + this.DeleteOption = deleteOption; CustomInit(); } @@ -101,125 +108,127 @@ public OSDisk() /// partial void CustomInit(); + /// - /// Gets or sets this property allows you to specify the type of the OS - /// that is included in the disk if creating a VM from user-image or a - /// specialized VHD. Possible values are: **Windows,** **Linux.**. - /// Possible values include: 'Windows', 'Linux' + /// Gets or sets this property allows you to specify the type of the OS that is + /// included in the disk if creating a VM from user-image or a specialized VHD. + /// Possible values are: **Windows,** **Linux.** Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "osType")] - public OperatingSystemTypes? OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public OperatingSystemTypes? OsType {get; set; } /// - /// Gets or sets specifies the encryption settings for the OS Disk. - /// Minimum api-version: 2015-06-15. + /// Gets or sets specifies the encryption settings for the OS Disk. Minimum + /// api-version: 2015-06-15. /// - [JsonProperty(PropertyName = "encryptionSettings")] - public DiskEncryptionSettings EncryptionSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptionSettings")] + public DiskEncryptionSettings EncryptionSettings {get; set; } /// /// Gets or sets the disk name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the virtual hard disk. /// - [JsonProperty(PropertyName = "vhd")] - public VirtualHardDisk Vhd { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vhd")] + public VirtualHardDisk Vhd {get; set; } /// - /// Gets or sets the source user image virtual hard disk. The virtual - /// hard disk will be copied before being attached to the virtual - /// machine. If SourceImage is provided, the destination virtual hard - /// drive must not exist. + /// Gets or sets the source user image virtual hard disk. The virtual hard disk + /// will be copied before being attached to the virtual machine. If SourceImage + /// is provided, the destination virtual hard drive must not exist. /// - [JsonProperty(PropertyName = "image")] - public VirtualHardDisk Image { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "image")] + public VirtualHardDisk Image {get; set; } /// - /// Gets or sets specifies the caching requirements. Possible values - /// are: **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior - /// is: **None for Standard storage. ReadOnly for Premium storage.**. - /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + /// Gets or sets specifies the caching requirements. Possible values are: + /// **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None + /// for Standard storage. ReadOnly for Premium storage.** Possible values include: 'None', 'ReadOnly', 'ReadWrite' /// - [JsonProperty(PropertyName = "caching")] - public CachingTypes? Caching { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "caching")] + public CachingTypes? Caching {get; set; } /// - /// Gets or sets specifies whether writeAccelerator should be enabled - /// or disabled on the disk. + /// Gets or sets specifies whether writeAccelerator should be enabled or + /// disabled on the disk. /// - [JsonProperty(PropertyName = "writeAcceleratorEnabled")] - public bool? WriteAcceleratorEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "writeAcceleratorEnabled")] + public bool? WriteAcceleratorEnabled {get; set; } /// - /// Gets or sets specifies the ephemeral Disk Settings for the - /// operating system disk used by the virtual machine. + /// Gets or sets specifies the ephemeral Disk Settings for the operating system + /// disk used by the virtual machine. /// - [JsonProperty(PropertyName = "diffDiskSettings")] - public DiffDiskSettings DiffDiskSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diffDiskSettings")] + public DiffDiskSettings DiffDiskSettings {get; set; } /// - /// Gets or sets specifies how the virtual machine disk should be - /// created. Possible values are **Attach:** This value is used when - /// you are using a specialized disk to create the virtual machine. - /// **FromImage:** This value is used when you are using an image to - /// create the virtual machine. If you are using a platform image, you - /// should also use the imageReference element described above. If you - /// are using a marketplace image, you should also use the plan element - /// previously described. Possible values include: 'FromImage', - /// 'Empty', 'Attach', 'Copy', 'Restore' + /// Gets or sets specifies how the virtual machine disk should be created. + /// Possible values are **Attach:** This value is used when you are using a + /// specialized disk to create the virtual machine. **FromImage:** This value + /// is used when you are using an image to create the virtual machine. If you + /// are using a platform image, you should also use the imageReference element + /// described above. If you are using a marketplace image, you should also use + /// the plan element previously described. Possible values include: 'FromImage', 'Empty', 'Attach', 'Copy', 'Restore' /// - [JsonProperty(PropertyName = "createOption")] - public string CreateOption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createOption")] + public string CreateOption {get; set; } /// - /// Gets or sets specifies the size of an empty data disk in gigabytes. - /// This element can be used to overwrite the size of the disk in a - /// virtual machine image. The property 'diskSizeGB' is the number of - /// bytes x 1024^3 for the disk and the value cannot be larger than - /// 1023. + /// Gets or sets specifies the size of an empty data disk in gigabytes. This + /// element can be used to overwrite the size of the disk in a virtual machine + /// image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the + /// disk and the value cannot be larger than 1023. /// - [JsonProperty(PropertyName = "diskSizeGB")] - public int? DiskSizeGB { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeGB")] + public int? DiskSizeGB {get; set; } /// /// Gets or sets the managed disk parameters. /// - [JsonProperty(PropertyName = "managedDisk")] - public ManagedDiskParameters ManagedDisk { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managedDisk")] + public ManagedDiskParameters ManagedDisk {get; set; } /// - /// Gets or sets specifies whether OS Disk should be deleted or - /// detached upon VM deletion. Possible values are: **Delete.** If this - /// value is used, the OS disk is deleted when VM is deleted. - /// **Detach.** If this value is used, the os disk is retained after VM - /// is deleted. The default value is set to **Detach**. For an - /// ephemeral OS Disk, the default value is set to **Delete**. The user - /// cannot change the delete option for an ephemeral OS Disk. Possible - /// values include: 'Delete', 'Detach' + /// Gets or sets specifies whether OS Disk should be deleted or detached upon + /// VM deletion. Possible values are: **Delete.** If this value is used, the OS + /// disk is deleted when VM is deleted. **Detach.** If this value is used, the + /// os disk is retained after VM is deleted. The default value is set to + /// **Detach**. For an ephemeral OS Disk, the default value is set to + /// **Delete**. The user cannot change the delete option for an ephemeral OS + /// Disk. Possible values include: 'Delete', 'Detach' /// - [JsonProperty(PropertyName = "deleteOption")] - public string DeleteOption { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "deleteOption")] + public string DeleteOption {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (CreateOption == null) + if (this.CreateOption == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "CreateOption"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CreateOption"); } - if (EncryptionSettings != null) + + if (this.EncryptionSettings != null) { - EncryptionSettings.Validate(); + this.EncryptionSettings.Validate(); } + + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OSDiskImage.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OSDiskImage.cs index 67e155a05b4b..26df979de956 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OSDiskImage.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OSDiskImage.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public OSDiskImage() /// /// Initializes a new instance of the OSDiskImage class. /// - /// The operating system of the - /// osDiskImage. Possible values include: 'Windows', 'Linux' + + /// The operating system of the osDiskImage. + /// Possible values include: 'Windows', 'Linux' public OSDiskImage(OperatingSystemTypes operatingSystem) + { - OperatingSystem = operatingSystem; + this.OperatingSystem = operatingSystem; CustomInit(); } @@ -42,21 +38,21 @@ public OSDiskImage(OperatingSystemTypes operatingSystem) /// partial void CustomInit(); + /// - /// Gets or sets the operating system of the osDiskImage. Possible - /// values include: 'Windows', 'Linux' + /// Gets or sets the operating system of the osDiskImage. Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "operatingSystem")] - public OperatingSystemTypes OperatingSystem { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "operatingSystem")] + public OperatingSystemTypes OperatingSystem {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OSDiskImageEncryption.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OSDiskImageEncryption.cs index 0f25b4a2d4da..a82af729f14d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OSDiskImageEncryption.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OSDiskImageEncryption.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public OSDiskImageEncryption() /// /// Initializes a new instance of the OSDiskImageEncryption class. /// - /// A relative URI containing the - /// resource ID of the disk encryption set. - /// This property specifies the security - /// profile of an OS disk image. + + /// A relative URI containing the resource ID of the disk encryption set. + /// + + /// This property specifies the security profile of an OS disk image. + /// public OSDiskImageEncryption(string diskEncryptionSetId = default(string), OSDiskImageSecurityProfile securityProfile = default(OSDiskImageSecurityProfile)) - : base(diskEncryptionSetId) + + : base(diskEncryptionSetId) { - SecurityProfile = securityProfile; + this.SecurityProfile = securityProfile; CustomInit(); } @@ -45,12 +42,12 @@ public OSDiskImageEncryption() /// partial void CustomInit(); + /// - /// Gets or sets this property specifies the security profile of an OS - /// disk image. + /// Gets or sets this property specifies the security profile of an OS disk + /// image. /// - [JsonProperty(PropertyName = "securityProfile")] - public OSDiskImageSecurityProfile SecurityProfile { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "securityProfile")] + public OSDiskImageSecurityProfile SecurityProfile {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OSDiskImageSecurityProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OSDiskImageSecurityProfile.cs index 494132703877..a301dfdaf10a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OSDiskImageSecurityProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OSDiskImageSecurityProfile.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,16 +23,18 @@ public OSDiskImageSecurityProfile() /// /// Initializes a new instance of the OSDiskImageSecurityProfile class. /// - /// confidential VM - /// encryption types. Possible values include: - /// 'EncryptedVMGuestStateOnlyWithPmk', 'EncryptedWithPmk', - /// 'EncryptedWithCmk', 'NonPersistedTPM' - /// secure VM disk encryption - /// set id + + /// confidential VM encryption types + /// Possible values include: 'EncryptedVMGuestStateOnlyWithPmk', + /// 'EncryptedWithPmk', 'EncryptedWithCmk', 'NonPersistedTPM' + + /// secure VM disk encryption set id + /// public OSDiskImageSecurityProfile(string confidentialVMEncryptionType = default(string), string secureVMDiskEncryptionSetId = default(string)) + { - ConfidentialVMEncryptionType = confidentialVMEncryptionType; - SecureVMDiskEncryptionSetId = secureVMDiskEncryptionSetId; + this.ConfidentialVMEncryptionType = confidentialVMEncryptionType; + this.SecureVMDiskEncryptionSetId = secureVMDiskEncryptionSetId; CustomInit(); } @@ -47,19 +43,17 @@ public OSDiskImageSecurityProfile() /// partial void CustomInit(); + /// - /// Gets or sets confidential VM encryption types. Possible values - /// include: 'EncryptedVMGuestStateOnlyWithPmk', 'EncryptedWithPmk', - /// 'EncryptedWithCmk', 'NonPersistedTPM' + /// Gets or sets confidential VM encryption types Possible values include: 'EncryptedVMGuestStateOnlyWithPmk', 'EncryptedWithPmk', 'EncryptedWithCmk', 'NonPersistedTPM' /// - [JsonProperty(PropertyName = "confidentialVMEncryptionType")] - public string ConfidentialVMEncryptionType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "confidentialVMEncryptionType")] + public string ConfidentialVMEncryptionType {get; set; } /// /// Gets or sets secure VM disk encryption set id /// - [JsonProperty(PropertyName = "secureVMDiskEncryptionSetId")] - public string SecureVMDiskEncryptionSetId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "secureVMDiskEncryptionSetId")] + public string SecureVMDiskEncryptionSetId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OSImageNotificationProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OSImageNotificationProfile.cs index 0a2ffc4f021f..4de557610e4b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OSImageNotificationProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OSImageNotificationProfile.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; public partial class OSImageNotificationProfile @@ -26,17 +20,20 @@ public OSImageNotificationProfile() /// /// Initializes a new instance of the OSImageNotificationProfile class. /// - /// 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. + + /// 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. + /// public OSImageNotificationProfile(string notBeforeTimeout = default(string), bool? enable = default(bool?)) + { - NotBeforeTimeout = notBeforeTimeout; - Enable = enable; + this.NotBeforeTimeout = notBeforeTimeout; + this.Enable = enable; CustomInit(); } @@ -45,22 +42,21 @@ public OSImageNotificationProfile() /// partial void CustomInit(); + /// - /// Gets or sets 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) + /// Gets or sets 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) /// - [JsonProperty(PropertyName = "notBeforeTimeout")] - public string NotBeforeTimeout { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "notBeforeTimeout")] + public string NotBeforeTimeout {get; set; } /// - /// Gets or sets specifies whether the OS Image Scheduled event is - /// enabled or disabled. + /// Gets or sets specifies whether the OS Image Scheduled event is enabled or + /// disabled. /// - [JsonProperty(PropertyName = "enable")] - public bool? Enable { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "enable")] + public bool? Enable {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OSProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OSProfile.cs index f02183690429..055abd57ca4e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OSProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OSProfile.cs @@ -1,23 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Specifies the operating system settings for the virtual machine. Some - /// of the settings cannot be changed once VM is provisioned. + /// Specifies the operating system settings for the virtual machine. Some of + /// the settings cannot be changed once VM is provisioned. /// public partial class OSProfile { @@ -32,86 +24,91 @@ public OSProfile() /// /// Initializes a new instance of the OSProfile class. /// - /// Specifies the host OS name of the - /// virtual machine. This name cannot be updated after the VM is - /// created. **Max-length (Windows):** 15 characters. **Max-length - /// (Linux):** 64 characters. For naming conventions and restrictions - /// see [Azure infrastructure services implementation - /// guidelines](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules). - /// Specifies the name of the administrator - /// account. <br><br> This property cannot be updated after - /// the VM is created. <br><br> **Windows-only - /// restriction:** Cannot end in "." <br><br> **Disallowed - /// values:** "administrator", "admin", "user", "user1", "test", - /// "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", - /// "adm", "admin2", "aspnet", "backup", "console", "david", "guest", - /// "john", "owner", "root", "server", "sql", "support", - /// "support_388945a0", "sys", "test2", "test3", "user4", "user5". - /// <br><br> **Minimum-length (Linux):** 1 character - /// <br><br> **Max-length (Linux):** 64 characters - /// <br><br> **Max-length (Windows):** 20 - /// characters. - /// Specifies the password of the - /// administrator account. <br><br> **Minimum-length - /// (Windows):** 8 characters <br><br> **Minimum-length - /// (Linux):** 6 characters <br><br> **Max-length - /// (Windows):** 123 characters <br><br> **Max-length - /// (Linux):** 72 characters <br><br> **Complexity - /// requirements:** 3 out of 4 conditions below need to be fulfilled - /// <br> Has lower characters <br>Has upper characters - /// <br> Has a digit <br> Has a special character (Regex - /// match [\W_]) <br><br> **Disallowed values:** "abc@123", - /// "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", - /// "Password!", "Password1", "Password22", "iloveyou!" - /// <br><br> For resetting the password, see [How to reset - /// the Remote Desktop service or its login password in a Windows + + /// Specifies the host OS name of the virtual machine. This name cannot be + /// updated after the VM is created. **Max-length (Windows):** 15 characters. + /// **Max-length (Linux):** 64 characters. For naming conventions and + /// restrictions see [Azure infrastructure services implementation + /// guidelines](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules). + /// + + /// Specifies the name of the administrator account. <br><br> This property + /// cannot be updated after the VM is created. <br><br> **Windows-only + /// restriction:** Cannot end in "." <br><br> **Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", "test1", + /// "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + /// "backup", "console", "david", "guest", "john", "owner", "root", "server", + /// "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", + /// "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> + /// **Max-length (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 + /// characters. + /// + + /// Specifies the password of the administrator account. <br><br> + /// **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length + /// (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters + /// <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity + /// requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has + /// lower characters <br>Has upper characters <br> Has a digit <br> Has a + /// special character (Regex match [\W_]) <br><br> **Disallowed values:** + /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", + /// "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting + /// the password, see [How to reset the Remote Desktop service or its login + /// password in a Windows /// VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) - /// <br><br> For resetting root password, see [Manage - /// users, SSH, and check or repair disks on Azure Linux VMs using the - /// VMAccess - /// Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) - /// Specifies a base-64 encoded string of - /// custom data. The base-64 encoded string is decoded to a binary - /// array that is saved as a file on the Virtual Machine. The maximum - /// length of the binary array is 65535 bytes. **Note: Do not pass any - /// secrets or passwords in customData property.** This property cannot - /// be updated after the VM is created. The property 'customData' is - /// passed to the VM to be saved as a file, for more information see - /// [Custom Data on Azure + /// <br><br> For resetting root password, see [Manage users, SSH, and check or + /// repair disks on Azure Linux VMs using the VMAccess + /// Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) + /// + + /// Specifies a base-64 encoded string of custom data. The base-64 encoded + /// string is decoded to a binary array that is saved as a file on the Virtual + /// Machine. The maximum length of the binary array is 65535 bytes. **Note: Do + /// not pass any secrets or passwords in customData property.** This property + /// cannot be updated after the VM is created. The property 'customData' is + /// passed to the VM to be saved as a file, for more information see [Custom + /// Data on Azure /// VMs](https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/). - /// For using cloud-init for your Linux VM, see [Using cloud-init to - /// customize a Linux VM during - /// creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). - /// Specifies Windows operating - /// system settings on the virtual machine. - /// Specifies the Linux operating - /// system settings on the virtual machine. For a list of supported - /// Linux distributions, see [Linux on Azure-Endorsed - /// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). - /// Specifies set of certificates that should be - /// installed onto the virtual machine. To install certificates on a - /// virtual machine it is recommended to use the [Azure Key Vault - /// virtual machine extension for + /// For using cloud-init for your Linux VM, see [Using cloud-init to customize + /// a Linux VM during + /// creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). + /// + + /// Specifies Windows operating system settings on the virtual machine. + /// + + /// Specifies the Linux operating system settings on the virtual machine. For a + /// list of supported Linux distributions, see [Linux on Azure-Endorsed + /// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + /// + + /// Specifies set of certificates that should be installed onto the virtual + /// machine. To install certificates on a virtual machine it is recommended to + /// use the [Azure Key Vault virtual machine extension for /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) /// or the [Azure Key Vault virtual machine extension for - /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). - /// Specifies whether extension - /// operations should be allowed on the virtual machine. This may only - /// be set to False when no extensions are present on the virtual - /// machine. - /// Optional property which - /// must either be set to True or omitted. - public OSProfile(string computerName = default(string), string adminUsername = default(string), string adminPassword = default(string), string customData = default(string), WindowsConfiguration windowsConfiguration = default(WindowsConfiguration), LinuxConfiguration linuxConfiguration = default(LinuxConfiguration), IList secrets = default(IList), bool? allowExtensionOperations = default(bool?), bool? requireGuestProvisionSignal = default(bool?)) + /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + /// + + /// Specifies whether extension operations should be allowed on the virtual + /// machine. This may only be set to False when no extensions are present on + /// the virtual machine. + /// + + /// Optional property which must either be set to True or omitted. + /// + public OSProfile(string computerName = default(string), string adminUsername = default(string), string adminPassword = default(string), string customData = default(string), WindowsConfiguration windowsConfiguration = default(WindowsConfiguration), LinuxConfiguration linuxConfiguration = default(LinuxConfiguration), System.Collections.Generic.IList secrets = default(System.Collections.Generic.IList), bool? allowExtensionOperations = default(bool?), bool? requireGuestProvisionSignal = default(bool?)) + { - ComputerName = computerName; - AdminUsername = adminUsername; - AdminPassword = adminPassword; - CustomData = customData; - WindowsConfiguration = windowsConfiguration; - LinuxConfiguration = linuxConfiguration; - Secrets = secrets; - AllowExtensionOperations = allowExtensionOperations; - RequireGuestProvisionSignal = requireGuestProvisionSignal; + this.ComputerName = computerName; + this.AdminUsername = adminUsername; + this.AdminPassword = adminPassword; + this.CustomData = customData; + this.WindowsConfiguration = windowsConfiguration; + this.LinuxConfiguration = linuxConfiguration; + this.Secrets = secrets; + this.AllowExtensionOperations = allowExtensionOperations; + this.RequireGuestProvisionSignal = requireGuestProvisionSignal; CustomInit(); } @@ -120,121 +117,107 @@ public OSProfile() /// partial void CustomInit(); + /// - /// Gets or sets specifies the host OS name of the virtual machine. - /// This name cannot be updated after the VM is created. **Max-length - /// (Windows):** 15 characters. **Max-length (Linux):** 64 characters. - /// For naming conventions and restrictions see [Azure infrastructure - /// services implementation + /// Gets or sets specifies the host OS name of the virtual machine. This name + /// cannot be updated after the VM is created. **Max-length (Windows):** 15 + /// characters. **Max-length (Linux):** 64 characters. For naming conventions + /// and restrictions see [Azure infrastructure services implementation /// guidelines](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules). /// - [JsonProperty(PropertyName = "computerName")] - public string ComputerName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "computerName")] + public string ComputerName {get; set; } /// - /// Gets or sets specifies the name of the administrator account. - /// &lt;br&gt;&lt;br&gt; This property cannot be - /// updated after the VM is created. - /// &lt;br&gt;&lt;br&gt; **Windows-only restriction:** - /// Cannot end in "." &lt;br&gt;&lt;br&gt; **Disallowed - /// values:** "administrator", "admin", "user", "user1", "test", - /// "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", - /// "adm", "admin2", "aspnet", "backup", "console", "david", "guest", - /// "john", "owner", "root", "server", "sql", "support", - /// "support_388945a0", "sys", "test2", "test3", "user4", "user5". - /// &lt;br&gt;&lt;br&gt; **Minimum-length (Linux):** 1 - /// character &lt;br&gt;&lt;br&gt; **Max-length - /// (Linux):** 64 characters &lt;br&gt;&lt;br&gt; - /// **Max-length (Windows):** 20 characters. + /// Gets or sets specifies the name of the administrator account. <br><br> This + /// property cannot be updated after the VM is created. <br><br> **Windows-only + /// restriction:** Cannot end in "." <br><br> **Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", "test1", + /// "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + /// "backup", "console", "david", "guest", "john", "owner", "root", "server", + /// "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", + /// "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> + /// **Max-length (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 + /// characters. /// - [JsonProperty(PropertyName = "adminUsername")] - public string AdminUsername { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "adminUsername")] + public string AdminUsername {get; set; } /// - /// Gets or sets specifies the password of the administrator account. - /// &lt;br&gt;&lt;br&gt; **Minimum-length (Windows):** - /// 8 characters &lt;br&gt;&lt;br&gt; **Minimum-length - /// (Linux):** 6 characters &lt;br&gt;&lt;br&gt; - /// **Max-length (Windows):** 123 characters - /// &lt;br&gt;&lt;br&gt; **Max-length (Linux):** 72 - /// characters &lt;br&gt;&lt;br&gt; **Complexity - /// requirements:** 3 out of 4 conditions below need to be fulfilled - /// &lt;br&gt; Has lower characters &lt;br&gt;Has upper - /// characters &lt;br&gt; Has a digit &lt;br&gt; Has a - /// special character (Regex match [\W_]) - /// &lt;br&gt;&lt;br&gt; **Disallowed values:** - /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", - /// "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" - /// &lt;br&gt;&lt;br&gt; For resetting the password, - /// see [How to reset the Remote Desktop service or its login password - /// in a Windows + /// Gets or sets specifies the password of the administrator account. <br><br> + /// **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length + /// (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters + /// <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity + /// requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has + /// lower characters <br>Has upper characters <br> Has a digit <br> Has a + /// special character (Regex match [\W_]) <br><br> **Disallowed values:** + /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", + /// "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting + /// the password, see [How to reset the Remote Desktop service or its login + /// password in a Windows /// VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) - /// &lt;br&gt;&lt;br&gt; For resetting root password, - /// see [Manage users, SSH, and check or repair disks on Azure Linux - /// VMs using the VMAccess + /// <br><br> For resetting root password, see [Manage users, SSH, and check or + /// repair disks on Azure Linux VMs using the VMAccess /// Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) /// - [JsonProperty(PropertyName = "adminPassword")] - public string AdminPassword { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "adminPassword")] + public string AdminPassword {get; set; } /// - /// Gets or sets specifies a base-64 encoded string of custom data. The - /// base-64 encoded string is decoded to a binary array that is saved - /// as a file on the Virtual Machine. The maximum length of the binary - /// array is 65535 bytes. **Note: Do not pass any secrets or passwords - /// in customData property.** This property cannot be updated after the - /// VM is created. The property 'customData' is passed to the VM to be - /// saved as a file, for more information see [Custom Data on Azure + /// Gets or sets specifies a base-64 encoded string of custom data. The base-64 + /// encoded string is decoded to a binary array that is saved as a file on the + /// Virtual Machine. The maximum length of the binary array is 65535 bytes. + /// **Note: Do not pass any secrets or passwords in customData property.** This + /// property cannot be updated after the VM is created. The property + /// 'customData' is passed to the VM to be saved as a file, for more + /// information see [Custom Data on Azure /// VMs](https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/). - /// For using cloud-init for your Linux VM, see [Using cloud-init to - /// customize a Linux VM during + /// For using cloud-init for your Linux VM, see [Using cloud-init to customize + /// a Linux VM during /// creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). /// - [JsonProperty(PropertyName = "customData")] - public string CustomData { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "customData")] + public string CustomData {get; set; } /// - /// Gets or sets specifies Windows operating system settings on the - /// virtual machine. + /// Gets or sets specifies Windows operating system settings on the virtual + /// machine. /// - [JsonProperty(PropertyName = "windowsConfiguration")] - public WindowsConfiguration WindowsConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "windowsConfiguration")] + public WindowsConfiguration WindowsConfiguration {get; set; } /// - /// Gets or sets specifies the Linux operating system settings on the - /// virtual machine. For a list of supported Linux distributions, see - /// [Linux on Azure-Endorsed + /// Gets or sets specifies the Linux operating system settings on the virtual + /// machine. For a list of supported Linux distributions, see [Linux on + /// Azure-Endorsed /// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). /// - [JsonProperty(PropertyName = "linuxConfiguration")] - public LinuxConfiguration LinuxConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "linuxConfiguration")] + public LinuxConfiguration LinuxConfiguration {get; set; } /// - /// Gets or sets specifies set of certificates that should be installed - /// onto the virtual machine. To install certificates on a virtual - /// machine it is recommended to use the [Azure Key Vault virtual - /// machine extension for + /// Gets or sets specifies set of certificates that should be installed onto + /// the virtual machine. To install certificates on a virtual machine it is + /// recommended to use the [Azure Key Vault virtual machine extension for /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) /// or the [Azure Key Vault virtual machine extension for /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). /// - [JsonProperty(PropertyName = "secrets")] - public IList Secrets { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "secrets")] + public System.Collections.Generic.IList Secrets {get; set; } /// - /// Gets or sets specifies whether extension operations should be - /// allowed on the virtual machine. This may only be set to False when - /// no extensions are present on the virtual machine. + /// Gets or sets specifies whether extension operations should be allowed on + /// the virtual machine. This may only be set to False when no extensions are + /// present on the virtual machine. /// - [JsonProperty(PropertyName = "allowExtensionOperations")] - public bool? AllowExtensionOperations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "allowExtensionOperations")] + public bool? AllowExtensionOperations {get; set; } /// - /// Gets or sets optional property which must either be set to True or - /// omitted. + /// Gets or sets optional property which must either be set to True or omitted. /// - [JsonProperty(PropertyName = "requireGuestProvisionSignal")] - public bool? RequireGuestProvisionSignal { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "requireGuestProvisionSignal")] + public bool? RequireGuestProvisionSignal {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OSProfileProvisioningData.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OSProfileProvisioningData.cs index 0248faacb5c3..4aae08b181dd 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OSProfileProvisioningData.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OSProfileProvisioningData.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,41 +23,41 @@ public OSProfileProvisioningData() /// /// Initializes a new instance of the OSProfileProvisioningData class. /// - /// Specifies the password of the - /// administrator account. <br><br> **Minimum-length - /// (Windows):** 8 characters <br><br> **Minimum-length - /// (Linux):** 6 characters <br><br> **Max-length - /// (Windows):** 123 characters <br><br> **Max-length - /// (Linux):** 72 characters <br><br> **Complexity - /// requirements:** 3 out of 4 conditions below need to be fulfilled - /// <br> Has lower characters <br>Has upper characters - /// <br> Has a digit <br> Has a special character (Regex - /// match [\W_]) <br><br> **Disallowed values:** "abc@123", - /// "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", - /// "Password!", "Password1", "Password22", "iloveyou!" - /// <br><br> For resetting the password, see [How to reset - /// the Remote Desktop service or its login password in a Windows + + /// Specifies the password of the administrator account. <br><br> + /// **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length + /// (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters + /// <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity + /// requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has + /// lower characters <br>Has upper characters <br> Has a digit <br> Has a + /// special character (Regex match [\W_]) <br><br> **Disallowed values:** + /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", + /// "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting + /// the password, see [How to reset the Remote Desktop service or its login + /// password in a Windows /// VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) - /// <br><br> For resetting root password, see [Manage - /// users, SSH, and check or repair disks on Azure Linux VMs using the - /// VMAccess - /// Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) - /// Specifies a base-64 encoded string of - /// custom data. The base-64 encoded string is decoded to a binary - /// array that is saved as a file on the Virtual Machine. The maximum - /// length of the binary array is 65535 bytes. **Note: Do not pass any - /// secrets or passwords in customData property.** This property cannot - /// be updated after the VM is created. The property customData is - /// passed to the VM to be saved as a file, for more information see - /// [Custom Data on Azure + /// <br><br> For resetting root password, see [Manage users, SSH, and check or + /// repair disks on Azure Linux VMs using the VMAccess + /// Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) + /// + + /// Specifies a base-64 encoded string of custom data. The base-64 encoded + /// string is decoded to a binary array that is saved as a file on the Virtual + /// Machine. The maximum length of the binary array is 65535 bytes. **Note: Do + /// not pass any secrets or passwords in customData property.** This property + /// cannot be updated after the VM is created. The property customData is + /// passed to the VM to be saved as a file, for more information see [Custom + /// Data on Azure /// VMs](https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/). - /// If using cloud-init for your Linux VM, see [Using cloud-init to - /// customize a Linux VM during - /// creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). + /// If using cloud-init for your Linux VM, see [Using cloud-init to customize a + /// Linux VM during + /// creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). + /// public OSProfileProvisioningData(string adminPassword = default(string), string customData = default(string)) + { - AdminPassword = adminPassword; - CustomData = customData; + this.AdminPassword = adminPassword; + this.CustomData = customData; CustomInit(); } @@ -72,48 +66,41 @@ public OSProfileProvisioningData() /// partial void CustomInit(); + /// - /// Gets or sets specifies the password of the administrator account. - /// &lt;br&gt;&lt;br&gt; **Minimum-length (Windows):** - /// 8 characters &lt;br&gt;&lt;br&gt; **Minimum-length - /// (Linux):** 6 characters &lt;br&gt;&lt;br&gt; - /// **Max-length (Windows):** 123 characters - /// &lt;br&gt;&lt;br&gt; **Max-length (Linux):** 72 - /// characters &lt;br&gt;&lt;br&gt; **Complexity - /// requirements:** 3 out of 4 conditions below need to be fulfilled - /// &lt;br&gt; Has lower characters &lt;br&gt;Has upper - /// characters &lt;br&gt; Has a digit &lt;br&gt; Has a - /// special character (Regex match [\W_]) - /// &lt;br&gt;&lt;br&gt; **Disallowed values:** - /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", - /// "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" - /// &lt;br&gt;&lt;br&gt; For resetting the password, - /// see [How to reset the Remote Desktop service or its login password - /// in a Windows + /// Gets or sets specifies the password of the administrator account. <br><br> + /// **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length + /// (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters + /// <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity + /// requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has + /// lower characters <br>Has upper characters <br> Has a digit <br> Has a + /// special character (Regex match [\W_]) <br><br> **Disallowed values:** + /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", + /// "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting + /// the password, see [How to reset the Remote Desktop service or its login + /// password in a Windows /// VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) - /// &lt;br&gt;&lt;br&gt; For resetting root password, - /// see [Manage users, SSH, and check or repair disks on Azure Linux - /// VMs using the VMAccess + /// <br><br> For resetting root password, see [Manage users, SSH, and check or + /// repair disks on Azure Linux VMs using the VMAccess /// Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) /// - [JsonProperty(PropertyName = "adminPassword")] - public string AdminPassword { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "adminPassword")] + public string AdminPassword {get; set; } /// - /// Gets or sets specifies a base-64 encoded string of custom data. The - /// base-64 encoded string is decoded to a binary array that is saved - /// as a file on the Virtual Machine. The maximum length of the binary - /// array is 65535 bytes. **Note: Do not pass any secrets or passwords - /// in customData property.** This property cannot be updated after the - /// VM is created. The property customData is passed to the VM to be - /// saved as a file, for more information see [Custom Data on Azure + /// Gets or sets specifies a base-64 encoded string of custom data. The base-64 + /// encoded string is decoded to a binary array that is saved as a file on the + /// Virtual Machine. The maximum length of the binary array is 65535 bytes. + /// **Note: Do not pass any secrets or passwords in customData property.** This + /// property cannot be updated after the VM is created. The property customData + /// is passed to the VM to be saved as a file, for more information see [Custom + /// Data on Azure /// VMs](https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/). - /// If using cloud-init for your Linux VM, see [Using cloud-init to - /// customize a Linux VM during + /// If using cloud-init for your Linux VM, see [Using cloud-init to customize a + /// Linux VM during /// creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). /// - [JsonProperty(PropertyName = "customData")] - public string CustomData { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "customData")] + public string CustomData {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OperatingSystemStateTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OperatingSystemStateTypes.cs index 02c8d84ce934..ae6238eda72b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OperatingSystemStateTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OperatingSystemStateTypes.cs @@ -1,29 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for OperatingSystemStateTypes. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum OperatingSystemStateTypes { - [EnumMember(Value = "Generalized")] + [System.Runtime.Serialization.EnumMember(Value = "Generalized")] Generalized, - [EnumMember(Value = "Specialized")] + [System.Runtime.Serialization.EnumMember(Value = "Specialized")] Specialized } internal static class OperatingSystemStateTypesEnumExtension @@ -32,7 +25,6 @@ internal static string ToSerializedValue(this OperatingSystemStateTypes? value) { return value == null ? null : ((OperatingSystemStateTypes)value).ToSerializedValue(); } - internal static string ToSerializedValue(this OperatingSystemStateTypes value) { switch( value ) @@ -44,7 +36,6 @@ internal static string ToSerializedValue(this OperatingSystemStateTypes value) } return null; } - internal static OperatingSystemStateTypes? ParseOperatingSystemStateTypes(this string value) { switch( value ) @@ -57,4 +48,4 @@ internal static string ToSerializedValue(this OperatingSystemStateTypes value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OperatingSystemType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OperatingSystemType.cs index 924d01f97423..1baf484331bf 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OperatingSystemType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OperatingSystemType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for OperatingSystemType. /// + + public static class OperatingSystemType { public const string Windows = "Windows"; public const string Linux = "Linux"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OperatingSystemTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OperatingSystemTypes.cs index e9e9dc929b25..e92d8c67ae4a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OperatingSystemTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OperatingSystemTypes.cs @@ -1,29 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for OperatingSystemTypes. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum OperatingSystemTypes { - [EnumMember(Value = "Windows")] + [System.Runtime.Serialization.EnumMember(Value = "Windows")] Windows, - [EnumMember(Value = "Linux")] + [System.Runtime.Serialization.EnumMember(Value = "Linux")] Linux } internal static class OperatingSystemTypesEnumExtension @@ -32,7 +25,6 @@ internal static string ToSerializedValue(this OperatingSystemTypes? value) { return value == null ? null : ((OperatingSystemTypes)value).ToSerializedValue(); } - internal static string ToSerializedValue(this OperatingSystemTypes value) { switch( value ) @@ -44,7 +36,6 @@ internal static string ToSerializedValue(this OperatingSystemTypes value) } return null; } - internal static OperatingSystemTypes? ParseOperatingSystemTypes(this string value) { switch( value ) @@ -57,4 +48,4 @@ internal static string ToSerializedValue(this OperatingSystemTypes value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OperationStatusResult.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OperationStatusResult.cs index 1742af804574..12c145c812df 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OperationStatusResult.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OperationStatusResult.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,27 +23,41 @@ public OperationStatusResult() /// /// Initializes a new instance of the OperationStatusResult class. /// - /// Operation status. - /// Fully qualified ID for the async - /// operation. - /// Name of the async operation. - /// Percent of the operation that is - /// complete. - /// The start time of the operation. - /// The end time of the operation. - /// The operations list. - /// If present, details of the operation - /// error. - public OperationStatusResult(string status, string id = default(string), string name = default(string), double? percentComplete = default(double?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), IList operations = default(IList), ErrorDetail error = default(ErrorDetail)) + + /// Fully qualified ID for the async operation. + /// + + /// Name of the async operation. + /// + + /// Operation status. + /// + + /// Percent of the operation that is complete. + /// + + /// The start time of the operation. + /// + + /// The end time of the operation. + /// + + /// The operations list. + /// + + /// If present, details of the operation error. + /// + public OperationStatusResult(string status, string id = default(string), string name = default(string), double? percentComplete = default(double?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), System.Collections.Generic.IList operations = default(System.Collections.Generic.IList), ErrorDetail error = default(ErrorDetail)) + { - Id = id; - Name = name; - Status = status; - PercentComplete = percentComplete; - StartTime = startTime; - EndTime = endTime; - Operations = operations; - Error = error; + this.Id = id; + this.Name = name; + this.Status = status; + this.PercentComplete = percentComplete; + this.StartTime = startTime; + this.EndTime = endTime; + this.Operations = operations; + this.Error = error; CustomInit(); } @@ -61,80 +66,83 @@ public OperationStatusResult() /// partial void CustomInit(); + /// /// Gets or sets fully qualified ID for the async operation. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets name of the async operation. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets operation status. /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// /// Gets or sets percent of the operation that is complete. /// - [JsonProperty(PropertyName = "percentComplete")] - public double? PercentComplete { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "percentComplete")] + public double? PercentComplete {get; set; } /// /// Gets or sets the start time of the operation. /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime {get; set; } /// /// Gets or sets the end time of the operation. /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTime? EndTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime {get; set; } /// /// Gets or sets the operations list. /// - [JsonProperty(PropertyName = "operations")] - public IList Operations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "operations")] + public System.Collections.Generic.IList Operations {get; set; } /// /// Gets or sets if present, details of the operation error. /// - [JsonProperty(PropertyName = "error")] - public ErrorDetail Error { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorDetail Error {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Status == null) + if (this.Status == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Status"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Status"); } - if (PercentComplete != null) + + + + if (this.PercentComplete != null) { - if (PercentComplete > 100) + if (this.PercentComplete > 100) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "PercentComplete", 100); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "PercentComplete", 100); } - if (PercentComplete < 0) + if (this.PercentComplete < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "PercentComplete", 0); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "PercentComplete", 0); } } - if (Operations != null) + if (this.Operations != null) { - foreach (var element in Operations) + foreach (var element in this.Operations) { if (element != null) { @@ -142,6 +150,7 @@ public virtual void Validate() } } } + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationMode.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationMode.cs index bf55423160dc..53577ad303e5 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationMode.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for OrchestrationMode. /// + + public static class OrchestrationMode { public const string Uniform = "Uniform"; public const string Flexible = "Flexible"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceNames.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceNames.cs index 930fea34cfbc..f5155b68eb55 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceNames.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceNames.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for OrchestrationServiceNames. /// + + public static class OrchestrationServiceNames { public const string AutomaticRepairs = "AutomaticRepairs"; @@ -22,4 +19,4 @@ public static class OrchestrationServiceNames /// public const string AutomaticZoneRebalancing = "AutomaticZoneRebalancing"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceOperationStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceOperationStatus.cs index d9e23787c1d2..301712aef318 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceOperationStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceOperationStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for OrchestrationServiceOperationStatus. /// + + public static class OrchestrationServiceOperationStatus { /// @@ -25,4 +22,4 @@ public static class OrchestrationServiceOperationStatus /// public const string Completed = "Completed"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceState.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceState.cs index 78a78c39724c..0b35ddcbc49a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceState.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for OrchestrationServiceState. /// + + public static class OrchestrationServiceState { public const string NotRunning = "NotRunning"; public const string Running = "Running"; public const string Suspended = "Suspended"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceStateAction.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceStateAction.cs index 85263f3144c7..ba76cb35ca0a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceStateAction.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceStateAction.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for OrchestrationServiceStateAction. /// + + public static class OrchestrationServiceStateAction { public const string Resume = "Resume"; public const string Suspend = "Suspend"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceStateInput.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceStateInput.cs index bba55827ce33..0eaccc9cfc1d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceStateInput.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceStateInput.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class OrchestrationServiceStateInput { /// - /// Initializes a new instance of the OrchestrationServiceStateInput - /// class. + /// Initializes a new instance of the OrchestrationServiceStateInput class. /// public OrchestrationServiceStateInput() { @@ -29,17 +21,19 @@ public OrchestrationServiceStateInput() } /// - /// Initializes a new instance of the OrchestrationServiceStateInput - /// class. + /// Initializes a new instance of the OrchestrationServiceStateInput class. /// - /// The name of the service. Possible values - /// include: 'AutomaticRepairs', 'AutomaticZoneRebalancing' - /// The action to be performed. Possible values - /// include: 'Resume', 'Suspend' + + /// The name of the service. + /// Possible values include: 'AutomaticRepairs', 'AutomaticZoneRebalancing' + + /// The action to be performed. + /// Possible values include: 'Resume', 'Suspend' public OrchestrationServiceStateInput(string serviceName, string action) + { - ServiceName = serviceName; - Action = action; + this.ServiceName = serviceName; + this.Action = action; CustomInit(); } @@ -48,36 +42,36 @@ public OrchestrationServiceStateInput(string serviceName, string action) /// partial void CustomInit(); + /// - /// Gets or sets the name of the service. Possible values include: - /// 'AutomaticRepairs', 'AutomaticZoneRebalancing' + /// Gets or sets the name of the service. Possible values include: 'AutomaticRepairs', 'AutomaticZoneRebalancing' /// - [JsonProperty(PropertyName = "serviceName")] - public string ServiceName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceName")] + public string ServiceName {get; set; } /// - /// Gets or sets the action to be performed. Possible values include: - /// 'Resume', 'Suspend' + /// Gets or sets the action to be performed. Possible values include: 'Resume', 'Suspend' /// - [JsonProperty(PropertyName = "action")] - public string Action { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "action")] + public string Action {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ServiceName == null) + if (this.ServiceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ServiceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ServiceName"); } - if (Action == null) + if (this.Action == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Action"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Action"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceSummary.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceSummary.cs index 3e66acc96679..abfcef423581 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceSummary.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/OrchestrationServiceSummary.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class OrchestrationServiceSummary { /// - /// Initializes a new instance of the OrchestrationServiceSummary - /// class. + /// Initializes a new instance of the OrchestrationServiceSummary class. /// public OrchestrationServiceSummary() { @@ -28,26 +21,29 @@ public OrchestrationServiceSummary() } /// - /// Initializes a new instance of the OrchestrationServiceSummary - /// class. + /// Initializes a new instance of the OrchestrationServiceSummary class. /// - /// The name of the service. Possible values - /// include: 'AutomaticRepairs', 'AutomaticZoneRebalancing' + + /// The name of the service. + /// Possible values include: 'AutomaticRepairs', 'AutomaticZoneRebalancing' + /// The current state of the service. - /// Possible values include: 'NotRunning', 'Running', - /// 'Suspended' - /// The latest operation status of - /// the service. Minimum API version for this property is 2025-04-01. - /// Possible values include: 'InProgress', 'Completed' - /// The last UTC time when the - /// operation status changed. Minimum API version for this property is - /// 2025-04-01. + /// Possible values include: 'NotRunning', 'Running', 'Suspended' + + /// The latest operation status of the service. Minimum API version for this + /// property is 2025-04-01. + /// Possible values include: 'InProgress', 'Completed' + + /// The last UTC time when the operation status changed. Minimum API version + /// for this property is 2025-04-01. + /// public OrchestrationServiceSummary(string serviceName = default(string), string serviceState = default(string), string latestOperationStatus = default(string), System.DateTime? lastStatusChangeTime = default(System.DateTime?)) + { - ServiceName = serviceName; - ServiceState = serviceState; - LatestOperationStatus = latestOperationStatus; - LastStatusChangeTime = lastStatusChangeTime; + this.ServiceName = serviceName; + this.ServiceState = serviceState; + this.LatestOperationStatus = latestOperationStatus; + this.LastStatusChangeTime = lastStatusChangeTime; CustomInit(); } @@ -56,34 +52,31 @@ public OrchestrationServiceSummary() /// partial void CustomInit(); + /// - /// Gets the name of the service. Possible values include: - /// 'AutomaticRepairs', 'AutomaticZoneRebalancing' + /// Gets the name of the service. Possible values include: 'AutomaticRepairs', 'AutomaticZoneRebalancing' /// - [JsonProperty(PropertyName = "serviceName")] - public string ServiceName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceName")] + public string ServiceName {get; private set; } /// - /// Gets the current state of the service. Possible values include: - /// 'NotRunning', 'Running', 'Suspended' + /// Gets the current state of the service. Possible values include: 'NotRunning', 'Running', 'Suspended' /// - [JsonProperty(PropertyName = "serviceState")] - public string ServiceState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceState")] + public string ServiceState {get; private set; } /// - /// Gets the latest operation status of the service. Minimum API - /// version for this property is 2025-04-01. Possible values include: - /// 'InProgress', 'Completed' + /// Gets the latest operation status of the service. Minimum API version for + /// this property is 2025-04-01. Possible values include: 'InProgress', 'Completed' /// - [JsonProperty(PropertyName = "latestOperationStatus")] - public string LatestOperationStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "latestOperationStatus")] + public string LatestOperationStatus {get; private set; } /// - /// Gets the last UTC time when the operation status changed. Minimum - /// API version for this property is 2025-04-01. + /// Gets the last UTC time when the operation status changed. Minimum API + /// version for this property is 2025-04-01. /// - [JsonProperty(PropertyName = "lastStatusChangeTime")] - public System.DateTime? LastStatusChangeTime { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "lastStatusChangeTime")] + public System.DateTime? LastStatusChangeTime {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Page.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Page.cs index 4476c5e85d42..686094a1c7a3 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Page.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/Page.cs @@ -1,53 +1,43 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [JsonObject] - public class Page : IPage + [Newtonsoft.Json.JsonObject] + public class Page : Microsoft.Rest.Azure.IPage { - /// - /// Gets the link to the next page. - /// - [JsonProperty("")] - public string NextPageLink { get; private set; } - - [JsonProperty("value")] - private IList Items{ get; set; } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() - { - return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Page1.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Page1.cs index 1b1a46379dcb..374829cc7484 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Page1.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/Page1.cs @@ -1,53 +1,43 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [JsonObject] - public class Page1 : IPage + [Newtonsoft.Json.JsonObject] + public class Page1 : Microsoft.Rest.Azure.IPage { - /// - /// Gets the link to the next page. - /// - [JsonProperty("nextLink")] - public string NextPageLink { get; private set; } - - [JsonProperty("value")] - private IList Items{ get; set; } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() - { - return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("nextLink")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PassNames.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PassNames.cs index 9e5d5e8bc306..cd790d13a3f6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PassNames.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PassNames.cs @@ -1,27 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for PassNames. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum PassNames { - [EnumMember(Value = "OobeSystem")] + [System.Runtime.Serialization.EnumMember(Value = "OobeSystem")] OobeSystem } internal static class PassNamesEnumExtension @@ -30,7 +23,6 @@ internal static string ToSerializedValue(this PassNames? value) { return value == null ? null : ((PassNames)value).ToSerializedValue(); } - internal static string ToSerializedValue(this PassNames value) { switch( value ) @@ -40,7 +32,6 @@ internal static string ToSerializedValue(this PassNames value) } return null; } - internal static PassNames? ParsePassNames(this string value) { switch( value ) @@ -51,4 +42,4 @@ internal static string ToSerializedValue(this PassNames value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PatchAssessmentState.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PatchAssessmentState.cs index e38d2040f788..a62f5a2bad6e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PatchAssessmentState.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PatchAssessmentState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for PatchAssessmentState. /// + + public static class PatchAssessmentState { public const string Unknown = "Unknown"; public const string Available = "Available"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PatchInstallationDetail.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PatchInstallationDetail.cs index 6dc51bd5402f..1c4e04f4fa03 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PatchInstallationDetail.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PatchInstallationDetail.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,26 +24,35 @@ public PatchInstallationDetail() /// /// Initializes a new instance of the PatchInstallationDetail class. /// - /// A unique identifier for the patch. - /// The friendly name of the patch. - /// The version string of the package. It may - /// conform to Semantic Versioning. Only applies to Linux. - /// The KBID of the patch. Only applies to Windows - /// patches. - /// The classification(s) of the patch as - /// provided by the patch publisher. - /// The state of the patch after the - /// installation operation completed. Possible values include: - /// 'Unknown', 'Installed', 'Failed', 'Excluded', 'NotSelected', - /// 'Pending' - public PatchInstallationDetail(string patchId = default(string), string name = default(string), string version = default(string), string kbId = default(string), IList classifications = default(IList), string installationState = default(string)) + + /// A unique identifier for the patch. + /// + + /// The friendly name of the patch. + /// + + /// The version string of the package. It may conform to Semantic Versioning. + /// Only applies to Linux. + /// + + /// The KBID of the patch. Only applies to Windows patches. + /// + + /// The classification(s) of the patch as provided by the patch publisher. + /// + + /// The state of the patch after the installation operation completed. + /// Possible values include: 'Unknown', 'Installed', 'Failed', 'Excluded', + /// 'NotSelected', 'Pending' + public PatchInstallationDetail(string patchId = default(string), string name = default(string), string version = default(string), string kbId = default(string), System.Collections.Generic.IList classifications = default(System.Collections.Generic.IList), string installationState = default(string)) + { - PatchId = patchId; - Name = name; - Version = version; - KbId = kbId; - Classifications = classifications; - InstallationState = installationState; + this.PatchId = patchId; + this.Name = name; + this.Version = version; + this.KbId = kbId; + this.Classifications = classifications; + this.InstallationState = installationState; CustomInit(); } @@ -60,45 +61,42 @@ public PatchInstallationDetail() /// partial void CustomInit(); + /// /// Gets a unique identifier for the patch. /// - [JsonProperty(PropertyName = "patchId")] - public string PatchId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "patchId")] + public string PatchId {get; private set; } /// /// Gets the friendly name of the patch. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets the version string of the package. It may conform to Semantic /// Versioning. Only applies to Linux. /// - [JsonProperty(PropertyName = "version")] - public string Version { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "version")] + public string Version {get; private set; } /// /// Gets the KBID of the patch. Only applies to Windows patches. /// - [JsonProperty(PropertyName = "kbId")] - public string KbId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "kbId")] + public string KbId {get; private set; } /// - /// Gets the classification(s) of the patch as provided by the patch - /// publisher. + /// Gets the classification(s) of the patch as provided by the patch publisher. /// - [JsonProperty(PropertyName = "classifications")] - public IList Classifications { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "classifications")] + public System.Collections.Generic.IList Classifications {get; private set; } /// - /// Gets the state of the patch after the installation operation - /// completed. Possible values include: 'Unknown', 'Installed', - /// 'Failed', 'Excluded', 'NotSelected', 'Pending' + /// Gets the state of the patch after the installation operation completed. Possible values include: 'Unknown', 'Installed', 'Failed', 'Excluded', 'NotSelected', 'Pending' /// - [JsonProperty(PropertyName = "installationState")] - public string InstallationState { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "installationState")] + public string InstallationState {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PatchInstallationState.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PatchInstallationState.cs index 6ca7103442ba..a769fc1dda84 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PatchInstallationState.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PatchInstallationState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for PatchInstallationState. /// + + public static class PatchInstallationState { public const string Unknown = "Unknown"; @@ -23,4 +20,4 @@ public static class PatchInstallationState public const string NotSelected = "NotSelected"; public const string Pending = "Pending"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PatchOperationStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PatchOperationStatus.cs index 0d9c96f755a1..a1a9c44e5af0 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PatchOperationStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PatchOperationStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for PatchOperationStatus. /// + + public static class PatchOperationStatus { public const string Unknown = "Unknown"; @@ -22,4 +19,4 @@ public static class PatchOperationStatus public const string Succeeded = "Succeeded"; public const string CompletedWithWarnings = "CompletedWithWarnings"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PatchSettings.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PatchSettings.cs index e4cd9e06e904..ab6090a98dfe 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PatchSettings.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PatchSettings.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,43 +23,43 @@ public PatchSettings() /// /// Initializes a new instance of the PatchSettings class. /// - /// Specifies the mode of VM Guest Patching to - /// IaaS virtual machine or virtual machines associated to virtual - /// machine scale set with OrchestrationMode as Flexible.<br - /// /><br /> Possible values are:<br /><br /> - /// **Manual** - You control the application of patches to a virtual - /// machine. You do this by applying patches manually inside the VM. In - /// this mode, automatic updates are disabled; the property - /// WindowsConfiguration.enableAutomaticUpdates must be false<br - /// /><br /> **AutomaticByOS** - The virtual machine will + + /// Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + /// machines associated to virtual machine scale set with OrchestrationMode as + /// Flexible.<br /><br /> Possible values are:<br /><br /> **Manual** - You + /// control the application of patches to a virtual machine. You do this by + /// applying patches manually inside the VM. In this mode, automatic updates + /// are disabled; the property WindowsConfiguration.enableAutomaticUpdates must + /// be false<br /><br /> **AutomaticByOS** - The virtual machine will /// automatically be updated by the OS. The property - /// WindowsConfiguration.enableAutomaticUpdates must be true. <br - /// /><br /> **AutomaticByPlatform** - the virtual machine - /// will automatically updated by the platform. The properties - /// provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates - /// must be true. Possible values include: 'Manual', 'AutomaticByOS', - /// 'AutomaticByPlatform' - /// Enables customers to patch their - /// Azure VMs without requiring a reboot. For enableHotpatching, the - /// 'provisionVMAgent' must be set to true and 'patchMode' must be set - /// to 'AutomaticByPlatform'. - /// Specifies the mode of VM Guest patch - /// assessment for the IaaS virtual machine.<br /><br /> - /// Possible values are:<br /><br /> **ImageDefault** - You - /// control the timing of patch assessments on a virtual machine.<br - /// /><br /> **AutomaticByPlatform** - The platform will - /// trigger periodic patch assessments. The property provisionVMAgent - /// must be true. Possible values include: 'ImageDefault', - /// 'AutomaticByPlatform' - /// Specifies additional - /// settings for patch mode AutomaticByPlatform in VM Guest Patching on - /// Windows. + /// WindowsConfiguration.enableAutomaticUpdates must be true. <br /><br /> + /// **AutomaticByPlatform** - the virtual machine will automatically updated by + /// the platform. The properties provisionVMAgent and + /// WindowsConfiguration.enableAutomaticUpdates must be true + /// Possible values include: 'Manual', 'AutomaticByOS', 'AutomaticByPlatform' + + /// Enables customers to patch their Azure VMs without requiring a reboot. For + /// enableHotpatching, the 'provisionVMAgent' must be set to true and + /// 'patchMode' must be set to 'AutomaticByPlatform'. + /// + + /// Specifies the mode of VM Guest patch assessment for the IaaS virtual + /// machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - + /// You control the timing of patch assessments on a virtual machine.<br /><br + /// /> **AutomaticByPlatform** - The platform will trigger periodic patch + /// assessments. The property provisionVMAgent must be true. + /// Possible values include: 'ImageDefault', 'AutomaticByPlatform' + + /// Specifies additional settings for patch mode AutomaticByPlatform in VM + /// Guest Patching on Windows. + /// public PatchSettings(string patchMode = default(string), bool? enableHotpatching = default(bool?), string assessmentMode = default(string), WindowsVMGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings = default(WindowsVMGuestPatchAutomaticByPlatformSettings)) + { - PatchMode = patchMode; - EnableHotpatching = enableHotpatching; - AssessmentMode = assessmentMode; - AutomaticByPlatformSettings = automaticByPlatformSettings; + this.PatchMode = patchMode; + this.EnableHotpatching = enableHotpatching; + this.AssessmentMode = assessmentMode; + this.AutomaticByPlatformSettings = automaticByPlatformSettings; CustomInit(); } @@ -74,56 +68,47 @@ public PatchSettings() /// partial void CustomInit(); + /// - /// Gets or sets specifies the mode of VM Guest Patching to IaaS - /// virtual machine or virtual machines associated to virtual machine - /// scale set with OrchestrationMode as Flexible.&lt;br - /// /&gt;&lt;br /&gt; Possible values are:&lt;br - /// /&gt;&lt;br /&gt; **Manual** - You control the - /// application of patches to a virtual machine. You do this by - /// applying patches manually inside the VM. In this mode, automatic - /// updates are disabled; the property - /// WindowsConfiguration.enableAutomaticUpdates must be false&lt;br - /// /&gt;&lt;br /&gt; **AutomaticByOS** - The virtual - /// machine will automatically be updated by the OS. The property - /// WindowsConfiguration.enableAutomaticUpdates must be true. - /// &lt;br /&gt;&lt;br /&gt; **AutomaticByPlatform** - - /// the virtual machine will automatically updated by the platform. The - /// properties provisionVMAgent and - /// WindowsConfiguration.enableAutomaticUpdates must be true. Possible - /// values include: 'Manual', 'AutomaticByOS', 'AutomaticByPlatform' + /// Gets or sets specifies the mode of VM Guest Patching to IaaS virtual + /// machine or virtual machines associated to virtual machine scale set with + /// OrchestrationMode as Flexible.<br /><br /> Possible values are:<br /><br /> + /// **Manual** - You control the application of patches to a virtual machine. + /// You do this by applying patches manually inside the VM. In this mode, + /// automatic updates are disabled; the property + /// WindowsConfiguration.enableAutomaticUpdates must be false<br /><br /> + /// **AutomaticByOS** - The virtual machine will automatically be updated by + /// the OS. The property WindowsConfiguration.enableAutomaticUpdates must be + /// true. <br /><br /> **AutomaticByPlatform** - the virtual machine will + /// automatically updated by the platform. The properties provisionVMAgent and + /// WindowsConfiguration.enableAutomaticUpdates must be true Possible values include: 'Manual', 'AutomaticByOS', 'AutomaticByPlatform' /// - [JsonProperty(PropertyName = "patchMode")] - public string PatchMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "patchMode")] + public string PatchMode {get; set; } /// - /// Gets or sets enables customers to patch their Azure VMs without - /// requiring a reboot. For enableHotpatching, the 'provisionVMAgent' - /// must be set to true and 'patchMode' must be set to - /// 'AutomaticByPlatform'. + /// Gets or sets enables customers to patch their Azure VMs without requiring a + /// reboot. For enableHotpatching, the 'provisionVMAgent' must be set to true + /// and 'patchMode' must be set to 'AutomaticByPlatform'. /// - [JsonProperty(PropertyName = "enableHotpatching")] - public bool? EnableHotpatching { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enableHotpatching")] + public bool? EnableHotpatching {get; set; } /// - /// Gets or sets specifies the mode of VM Guest patch assessment for - /// the IaaS virtual machine.&lt;br /&gt;&lt;br /&gt; - /// Possible values are:&lt;br /&gt;&lt;br /&gt; - /// **ImageDefault** - You control the timing of patch assessments on a - /// virtual machine.&lt;br /&gt;&lt;br /&gt; - /// **AutomaticByPlatform** - The platform will trigger periodic patch - /// assessments. The property provisionVMAgent must be true. Possible - /// values include: 'ImageDefault', 'AutomaticByPlatform' + /// Gets or sets specifies the mode of VM Guest patch assessment for the IaaS + /// virtual machine.<br /><br /> Possible values are:<br /><br /> + /// **ImageDefault** - You control the timing of patch assessments on a virtual + /// machine.<br /><br /> **AutomaticByPlatform** - The platform will trigger + /// periodic patch assessments. The property provisionVMAgent must be true. Possible values include: 'ImageDefault', 'AutomaticByPlatform' /// - [JsonProperty(PropertyName = "assessmentMode")] - public string AssessmentMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "assessmentMode")] + public string AssessmentMode {get; set; } /// /// Gets or sets specifies additional settings for patch mode /// AutomaticByPlatform in VM Guest Patching on Windows. /// - [JsonProperty(PropertyName = "automaticByPlatformSettings")] - public WindowsVMGuestPatchAutomaticByPlatformSettings AutomaticByPlatformSettings { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "automaticByPlatformSettings")] + public WindowsVMGuestPatchAutomaticByPlatformSettings AutomaticByPlatformSettings {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PirCommunityGalleryResource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PirCommunityGalleryResource.cs index bfca0a69345e..62365eb88403 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PirCommunityGalleryResource.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PirCommunityGalleryResource.cs @@ -1,30 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Base information about the community gallery resource in azure compute /// gallery. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PirCommunityGalleryResource { /// - /// Initializes a new instance of the PirCommunityGalleryResource - /// class. + /// Initializes a new instance of the PirCommunityGalleryResource class. /// public PirCommunityGalleryResource() { @@ -32,20 +23,27 @@ public PirCommunityGalleryResource() } /// - /// Initializes a new instance of the PirCommunityGalleryResource - /// class. + /// Initializes a new instance of the PirCommunityGalleryResource class. /// - /// Resource name - /// Resource location - /// Resource type - /// The unique id of this community - /// gallery. + + /// Resource name + /// + + /// Resource location + /// + + /// Resource type + /// + + /// The unique id of this community gallery. + /// public PirCommunityGalleryResource(string name = default(string), string location = default(string), string type = default(string), string uniqueId = default(string)) + { - Name = name; - Location = location; - Type = type; - UniqueId = uniqueId; + this.Name = name; + this.Location = location; + this.Type = type; + this.UniqueId = uniqueId; CustomInit(); } @@ -54,29 +52,29 @@ public PirCommunityGalleryResource() /// partial void CustomInit(); + /// /// Gets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets the unique id of this community gallery. /// - [JsonProperty(PropertyName = "identifier.uniqueId")] - public string UniqueId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "identifier.uniqueId")] + public string UniqueId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PirResource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PirResource.cs index 7a1e494e0651..eb3f60bd9d68 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PirResource.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PirResource.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public PirResource() /// /// Initializes a new instance of the PirResource class. /// - /// Resource name - /// Resource location + + /// Resource name + /// + + /// Resource location + /// public PirResource(string name = default(string), string location = default(string)) + { - Name = name; - Location = location; + this.Name = name; + this.Location = location; CustomInit(); } @@ -43,17 +42,17 @@ public PirResource() /// partial void CustomInit(); + /// /// Gets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PirSharedGalleryResource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PirSharedGalleryResource.cs index 1ee9785ad48c..91ce3778bb5b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PirSharedGalleryResource.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PirSharedGalleryResource.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Base information about the shared gallery resource in pir. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PirSharedGalleryResource : PirResource { /// @@ -32,14 +24,20 @@ public PirSharedGalleryResource() /// /// Initializes a new instance of the PirSharedGalleryResource class. /// - /// Resource name - /// Resource location - /// The unique id of this shared - /// gallery. + + /// Resource name + /// + + /// Resource location + /// + + /// The unique id of this shared gallery. + /// public PirSharedGalleryResource(string name = default(string), string location = default(string), string uniqueId = default(string)) - : base(name, location) + + : base(name, location) { - UniqueId = uniqueId; + this.UniqueId = uniqueId; CustomInit(); } @@ -48,11 +46,11 @@ public PirSharedGalleryResource() /// partial void CustomInit(); + /// /// Gets or sets the unique id of this shared gallery. /// - [JsonProperty(PropertyName = "identifier.uniqueId")] - public string UniqueId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "identifier.uniqueId")] + public string UniqueId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Placement.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Placement.cs index d4937a15c497..575584ed0cd2 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Placement.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/Placement.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,29 +23,32 @@ public Placement() /// /// Initializes a new instance of the Placement class. /// - /// Specifies the policy for - /// resource's placement in availability zone. Possible values are: - /// **Any** (used for Virtual Machines), **Auto** (used for Virtual - /// Machine Scale Sets) - An availability zone will be automatically - /// picked by system as part of resource creation. Possible values - /// include: 'Any', 'Auto' - /// This property supplements the - /// 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to - /// 'Any'/'Auto', availability zone selected by the system must be - /// present in the list of availability zones passed with - /// 'includeZones'. If 'includeZones' is not provided, all availability - /// zones in region will be considered for selection. - /// This property supplements the - /// 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to - /// 'Any'/'Auto', availability zone selected by the system must not be - /// present in the list of availability zones passed with - /// 'excludeZones'. If 'excludeZones' is not provided, all availability - /// zones in region will be considered for selection. - public Placement(string zonePlacementPolicy = default(string), IList includeZones = default(IList), IList excludeZones = default(IList)) + + /// Specifies the policy for resource's placement in availability zone. + /// Possible values are: **Any** (used for Virtual Machines), **Auto** (used + /// for Virtual Machine Scale Sets) - An availability zone will be + /// automatically picked by system as part of resource creation. + /// Possible values include: 'Any', 'Auto' + + /// This property supplements the 'zonePlacementPolicy' property. If + /// 'zonePlacementPolicy' is set to 'Any'/'Auto', availability zone selected by + /// the system must be present in the list of availability zones passed with + /// 'includeZones'. If 'includeZones' is not provided, all availability zones + /// in region will be considered for selection. + /// + + /// This property supplements the 'zonePlacementPolicy' property. If + /// 'zonePlacementPolicy' is set to 'Any'/'Auto', availability zone selected by + /// the system must not be present in the list of availability zones passed + /// with 'excludeZones'. If 'excludeZones' is not provided, all availability + /// zones in region will be considered for selection. + /// + public Placement(string zonePlacementPolicy = default(string), System.Collections.Generic.IList includeZones = default(System.Collections.Generic.IList), System.Collections.Generic.IList excludeZones = default(System.Collections.Generic.IList)) + { - ZonePlacementPolicy = zonePlacementPolicy; - IncludeZones = includeZones; - ExcludeZones = excludeZones; + this.ZonePlacementPolicy = zonePlacementPolicy; + this.IncludeZones = includeZones; + this.ExcludeZones = excludeZones; CustomInit(); } @@ -62,37 +57,34 @@ public Placement() /// partial void CustomInit(); + /// - /// Gets or sets specifies the policy for resource's placement in - /// availability zone. Possible values are: **Any** (used for Virtual - /// Machines), **Auto** (used for Virtual Machine Scale Sets) - An - /// availability zone will be automatically picked by system as part of - /// resource creation. Possible values include: 'Any', 'Auto' + /// Gets or sets specifies the policy for resource's placement in availability + /// zone. Possible values are: **Any** (used for Virtual Machines), **Auto** + /// (used for Virtual Machine Scale Sets) - An availability zone will be + /// automatically picked by system as part of resource creation. Possible values include: 'Any', 'Auto' /// - [JsonProperty(PropertyName = "zonePlacementPolicy")] - public string ZonePlacementPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zonePlacementPolicy")] + public string ZonePlacementPolicy {get; set; } /// - /// Gets or sets this property supplements the 'zonePlacementPolicy' - /// property. If 'zonePlacementPolicy' is set to 'Any'/'Auto', - /// availability zone selected by the system must be present in the - /// list of availability zones passed with 'includeZones'. If - /// 'includeZones' is not provided, all availability zones in region - /// will be considered for selection. + /// Gets or sets this property supplements the 'zonePlacementPolicy' property. + /// If 'zonePlacementPolicy' is set to 'Any'/'Auto', availability zone selected + /// by the system must be present in the list of availability zones passed with + /// 'includeZones'. If 'includeZones' is not provided, all availability zones + /// in region will be considered for selection. /// - [JsonProperty(PropertyName = "includeZones")] - public IList IncludeZones { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "includeZones")] + public System.Collections.Generic.IList IncludeZones {get; set; } /// - /// Gets or sets this property supplements the 'zonePlacementPolicy' - /// property. If 'zonePlacementPolicy' is set to 'Any'/'Auto', - /// availability zone selected by the system must not be present in the - /// list of availability zones passed with 'excludeZones'. If - /// 'excludeZones' is not provided, all availability zones in region - /// will be considered for selection. + /// Gets or sets this property supplements the 'zonePlacementPolicy' property. + /// If 'zonePlacementPolicy' is set to 'Any'/'Auto', availability zone selected + /// by the system must not be present in the list of availability zones passed + /// with 'excludeZones'. If 'excludeZones' is not provided, all availability + /// zones in region will be considered for selection. /// - [JsonProperty(PropertyName = "excludeZones")] - public IList ExcludeZones { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "excludeZones")] + public System.Collections.Generic.IList ExcludeZones {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Plan.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Plan.cs index 73554c036fdd..61f0c8a271d6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Plan.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/Plan.cs @@ -1,26 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// /// Specifies information about the marketplace image used to create the - /// virtual machine. This element is only used for marketplace images. - /// Before you can use a marketplace image from an API, you must enable the - /// image for programmatic use. In the Azure portal, find the marketplace - /// image that you want to use and then click **Want to deploy - /// programmatically, Get Started ->**. Enter any required information - /// and then click **Save**. + /// virtual machine. This element is only used for marketplace images. Before + /// you can use a marketplace image from an API, you must enable the image for + /// programmatic use. In the Azure portal, find the marketplace image that you + /// want to use and then click **Want to deploy programmatically, Get Started + /// ->**. Enter any required information and then click **Save**. /// public partial class Plan { @@ -35,18 +28,26 @@ public Plan() /// /// Initializes a new instance of the Plan class. /// - /// The plan ID. - /// The publisher ID. - /// Specifies the product of the image from the - /// marketplace. This is the same value as Offer under the - /// imageReference element. - /// The promotion code. + + /// The plan ID. + /// + + /// The publisher ID. + /// + + /// Specifies the product of the image from the marketplace. This is the same + /// value as Offer under the imageReference element. + /// + + /// The promotion code. + /// public Plan(string name = default(string), string publisher = default(string), string product = default(string), string promotionCode = default(string)) + { - Name = name; - Publisher = publisher; - Product = product; - PromotionCode = promotionCode; + this.Name = name; + this.Publisher = publisher; + this.Product = product; + this.PromotionCode = promotionCode; CustomInit(); } @@ -55,31 +56,30 @@ public Plan() /// partial void CustomInit(); + /// /// Gets or sets the plan ID. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the publisher ID. /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publisher")] + public string Publisher {get; set; } /// - /// Gets or sets specifies the product of the image from the - /// marketplace. This is the same value as Offer under the - /// imageReference element. + /// Gets or sets specifies the product of the image from the marketplace. This + /// is the same value as Offer under the imageReference element. /// - [JsonProperty(PropertyName = "product")] - public string Product { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "product")] + public string Product {get; set; } /// /// Gets or sets the promotion code. /// - [JsonProperty(PropertyName = "promotionCode")] - public string PromotionCode { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "promotionCode")] + public string PromotionCode {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PlatformAttribute.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PlatformAttribute.cs index 02399cfea63f..788cfe395b1c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PlatformAttribute.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PlatformAttribute.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,18 @@ public PlatformAttribute() /// /// Initializes a new instance of the PlatformAttribute class. /// - /// This property specifies the name of the - /// platformAttribute. It is read-only. - /// This property specifies the value of the - /// corresponding name property. It is read-only. + + /// This property specifies the name of the platformAttribute. It is read-only. + /// + + /// This property specifies the value of the corresponding name property. It is + /// read-only. + /// public PlatformAttribute(string name = default(string), string value = default(string)) + { - Name = name; - Value = value; + this.Name = name; + this.Value = value; CustomInit(); } @@ -45,19 +43,19 @@ public PlatformAttribute() /// partial void CustomInit(); + /// - /// Gets this property specifies the name of the platformAttribute. It - /// is read-only. + /// Gets this property specifies the name of the platformAttribute. It is + /// read-only. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// - /// Gets this property specifies the value of the corresponding name - /// property. It is read-only. + /// Gets this property specifies the value of the corresponding name property. + /// It is read-only. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PolicyViolation.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PolicyViolation.cs index e359888274a2..4db9cc75cf3c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PolicyViolation.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PolicyViolation.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,15 +23,18 @@ public PolicyViolation() /// /// Initializes a new instance of the PolicyViolation class. /// - /// Describes the nature of the policy - /// violation. Possible values include: 'Other', 'ImageFlaggedUnsafe', - /// 'CopyrightValidation', 'IpTheft' - /// Describes specific details about why this - /// policy violation was reported. + + /// Describes the nature of the policy violation. + /// Possible values include: 'Other', 'ImageFlaggedUnsafe', + /// 'CopyrightValidation', 'IpTheft' + + /// Describes specific details about why this policy violation was reported. + /// public PolicyViolation(string category = default(string), string details = default(string)) + { - Category = category; - Details = details; + this.Category = category; + this.Details = details; CustomInit(); } @@ -46,20 +43,18 @@ public PolicyViolation() /// partial void CustomInit(); + /// - /// Gets or sets describes the nature of the policy violation. Possible - /// values include: 'Other', 'ImageFlaggedUnsafe', - /// 'CopyrightValidation', 'IpTheft' + /// Gets or sets describes the nature of the policy violation. Possible values include: 'Other', 'ImageFlaggedUnsafe', 'CopyrightValidation', 'IpTheft' /// - [JsonProperty(PropertyName = "category")] - public string Category { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "category")] + public string Category {get; set; } /// - /// Gets or sets describes specific details about why this policy - /// violation was reported. + /// Gets or sets describes specific details about why this policy violation was + /// reported. /// - [JsonProperty(PropertyName = "details")] - public string Details { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public string Details {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PolicyViolationCategory.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PolicyViolationCategory.cs index 951ef2663c78..a693c447232d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PolicyViolationCategory.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PolicyViolationCategory.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for PolicyViolationCategory. /// + + public static class PolicyViolationCategory { public const string Other = "Other"; @@ -21,4 +18,4 @@ public static class PolicyViolationCategory public const string CopyrightValidation = "CopyrightValidation"; public const string IpTheft = "IpTheft"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PriorityMixPolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PriorityMixPolicy.cs index 3b8bcbc3fffe..5fa849690f41 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PriorityMixPolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PriorityMixPolicy.cs @@ -1,25 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// /// Specifies the target splits for Spot and Regular priority VMs within a - /// scale set with flexible orchestration mode. With this property the - /// customer is able to specify the base number of regular priority VMs - /// created as the VMSS flex instance scales out and the split between Spot - /// and Regular priority VMs after this base target has been reached. + /// scale set with flexible orchestration mode. With this property the customer + /// is able to specify the base number of regular priority VMs created as the + /// VMSS flex instance scales out and the split between Spot and Regular + /// priority VMs after this base target has been reached. /// public partial class PriorityMixPolicy { @@ -34,16 +27,19 @@ public PriorityMixPolicy() /// /// Initializes a new instance of the PriorityMixPolicy class. /// - /// The base number of regular - /// priority VMs that will be created in this scale set as it scales - /// out. - /// The percentage of - /// VM instances, after the base regular priority count has been - /// reached, that are expected to use regular priority. + + /// The base number of regular priority VMs that will be created in this scale + /// set as it scales out. + /// + + /// The percentage of VM instances, after the base regular priority count has + /// been reached, that are expected to use regular priority. + /// public PriorityMixPolicy(int? baseRegularPriorityCount = default(int?), int? regularPriorityPercentageAboveBase = default(int?)) + { - BaseRegularPriorityCount = baseRegularPriorityCount; - RegularPriorityPercentageAboveBase = regularPriorityPercentageAboveBase; + this.BaseRegularPriorityCount = baseRegularPriorityCount; + this.RegularPriorityPercentageAboveBase = regularPriorityPercentageAboveBase; CustomInit(); } @@ -52,36 +48,35 @@ public PriorityMixPolicy() /// partial void CustomInit(); + /// - /// Gets or sets the base number of regular priority VMs that will be - /// created in this scale set as it scales out. + /// Gets or sets the base number of regular priority VMs that will be created + /// in this scale set as it scales out. /// - [JsonProperty(PropertyName = "baseRegularPriorityCount")] - public int? BaseRegularPriorityCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "baseRegularPriorityCount")] + public int? BaseRegularPriorityCount {get; set; } /// /// Gets or sets the percentage of VM instances, after the base regular - /// priority count has been reached, that are expected to use regular - /// priority. + /// priority count has been reached, that are expected to use regular priority. /// - [JsonProperty(PropertyName = "regularPriorityPercentageAboveBase")] - public int? RegularPriorityPercentageAboveBase { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "regularPriorityPercentageAboveBase")] + public int? RegularPriorityPercentageAboveBase {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RegularPriorityPercentageAboveBase != null) + if (this.RegularPriorityPercentageAboveBase != null) { - if (RegularPriorityPercentageAboveBase > 100) + if (this.RegularPriorityPercentageAboveBase > 100) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "RegularPriorityPercentageAboveBase", 100); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "RegularPriorityPercentageAboveBase", 100); } } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpoint.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpoint.cs index ef7080558242..fa72aa17f728 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpoint.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpoint.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public PrivateEndpoint() /// /// Initializes a new instance of the PrivateEndpoint class. /// - /// The ARM identifier for Private Endpoint + + /// The ARM identifier for Private Endpoint + /// public PrivateEndpoint(string id = default(string)) + { - Id = id; + this.Id = id; CustomInit(); } @@ -41,11 +38,11 @@ public PrivateEndpoint() /// partial void CustomInit(); + /// /// Gets the ARM identifier for Private Endpoint /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpointConnection.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpointConnection.cs index 110fd414d3a0..37702db2ed9e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpointConnection.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpointConnection.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// The Private Endpoint Connection resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PrivateEndpointConnection : ProxyResource { /// @@ -32,23 +24,32 @@ public PrivateEndpointConnection() /// /// Initializes a new instance of the PrivateEndpointConnection class. /// - /// A collection of - /// information about the state of the connection between DiskAccess - /// and Virtual Network. - /// Resource Id - /// Resource name - /// Resource type - /// The resource of private end - /// point. - /// The provisioning state of the - /// private endpoint connection resource. Possible values include: - /// 'Succeeded', 'Creating', 'Deleting', 'Failed' - public PrivateEndpointConnection(PrivateLinkServiceConnectionState privateLinkServiceConnectionState, string id = default(string), string name = default(string), string type = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), string provisioningState = default(string)) - : base(id, name, type) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// The resource of private end point. + /// + + /// A collection of information about the state of the connection between + /// DiskAccess and Virtual Network. + /// + + /// The provisioning state of the private endpoint connection resource. + /// Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed' + public PrivateEndpointConnection(string id = default(string), string name = default(string), string type = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), string provisioningState = default(string)) + + : base(id, name, type) { - PrivateEndpoint = privateEndpoint; - PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; - ProvisioningState = provisioningState; + this.PrivateEndpoint = privateEndpoint; + this.PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -57,39 +58,24 @@ public PrivateEndpointConnection() /// partial void CustomInit(); - /// - /// Gets the resource of private end point. - /// - [JsonProperty(PropertyName = "properties.privateEndpoint")] - public PrivateEndpoint PrivateEndpoint { get; private set; } /// - /// Gets or sets a collection of information about the state of the - /// connection between DiskAccess and Virtual Network. + /// Gets the resource of private end point. /// - [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] - public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateEndpoint")] + public PrivateEndpoint PrivateEndpoint {get; private set; } /// - /// Gets the provisioning state of the private endpoint connection - /// resource. Possible values include: 'Succeeded', 'Creating', - /// 'Deleting', 'Failed' + /// Gets or sets a collection of information about the state of the connection + /// between DiskAccess and Virtual Network. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] + public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState {get; set; } /// - /// Validate the object. + /// Gets the provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed' /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (PrivateLinkServiceConnectionState == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "PrivateLinkServiceConnectionState"); - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpointConnectionProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpointConnectionProperties.cs new file mode 100644 index 000000000000..e571eafc996c --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpointConnectionProperties.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Properties of the PrivateEndpointConnectProperties. + /// + public partial class PrivateEndpointConnectionProperties + { + /// + /// Initializes a new instance of the PrivateEndpointConnectionProperties class. + /// + public PrivateEndpointConnectionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpointConnectionProperties class. + /// + + /// The resource of private end point. + /// + + /// A collection of information about the state of the connection between + /// DiskAccess and Virtual Network. + /// + + /// The provisioning state of the private endpoint connection resource. + /// Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed' + public PrivateEndpointConnectionProperties(PrivateLinkServiceConnectionState privateLinkServiceConnectionState, PrivateEndpoint privateEndpoint = default(PrivateEndpoint), string provisioningState = default(string)) + + { + this.PrivateEndpoint = privateEndpoint; + this.PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the resource of private end point. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateEndpoint")] + public PrivateEndpoint PrivateEndpoint {get; private set; } + + /// + /// Gets or sets a collection of information about the state of the connection + /// between DiskAccess and Virtual Network. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateLinkServiceConnectionState")] + public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState {get; set; } + + /// + /// Gets the provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.PrivateLinkServiceConnectionState == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PrivateLinkServiceConnectionState"); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpointConnectionProvisioningState.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpointConnectionProvisioningState.cs index a5faa7278f6f..3c9822a0ccf7 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpointConnectionProvisioningState.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpointConnectionProvisioningState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for PrivateEndpointConnectionProvisioningState. /// + + public static class PrivateEndpointConnectionProvisioningState { public const string Succeeded = "Succeeded"; @@ -21,4 +18,4 @@ public static class PrivateEndpointConnectionProvisioningState public const string Deleting = "Deleting"; public const string Failed = "Failed"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpointServiceConnectionStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpointServiceConnectionStatus.cs index 7563361c9555..aef187b60344 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpointServiceConnectionStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateEndpointServiceConnectionStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for PrivateEndpointServiceConnectionStatus. /// + + public static class PrivateEndpointServiceConnectionStatus { public const string Pending = "Pending"; public const string Approved = "Approved"; public const string Rejected = "Rejected"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateLinkResource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateLinkResource.cs index 5c8516507969..78b649243c8e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateLinkResource.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateLinkResource.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// A private link resource /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PrivateLinkResource { /// @@ -34,22 +24,33 @@ public PrivateLinkResource() /// /// Initializes a new instance of the PrivateLinkResource class. /// - /// The private link resource group id. - /// The private link resource required - /// member names. - /// The private link resource DNS zone - /// name. - /// private link resource Id - /// private link resource name - /// private link resource type - public PrivateLinkResource(string groupId = default(string), IList requiredMembers = default(IList), IList requiredZoneNames = default(IList), string id = default(string), string name = default(string), string type = default(string)) + + /// private link resource Id + /// + + /// private link resource name + /// + + /// private link resource type + /// + + /// The private link resource group id. + /// + + /// The private link resource required member names. + /// + + /// The private link resource DNS zone name. + /// + public PrivateLinkResource(string id = default(string), string name = default(string), string type = default(string), string groupId = default(string), System.Collections.Generic.IList requiredMembers = default(System.Collections.Generic.IList), System.Collections.Generic.IList requiredZoneNames = default(System.Collections.Generic.IList)) + { - GroupId = groupId; - RequiredMembers = requiredMembers; - RequiredZoneNames = requiredZoneNames; - Id = id; - Name = name; - Type = type; + this.Id = id; + this.Name = name; + this.Type = type; + this.GroupId = groupId; + this.RequiredMembers = requiredMembers; + this.RequiredZoneNames = requiredZoneNames; CustomInit(); } @@ -58,41 +59,41 @@ public PrivateLinkResource() /// partial void CustomInit(); + /// - /// Gets the private link resource group id. + /// Gets private link resource Id /// - [JsonProperty(PropertyName = "properties.groupId")] - public string GroupId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// - /// Gets the private link resource required member names. + /// Gets private link resource name /// - [JsonProperty(PropertyName = "properties.requiredMembers")] - public IList RequiredMembers { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// - /// Gets or sets the private link resource DNS zone name. + /// Gets private link resource type /// - [JsonProperty(PropertyName = "properties.requiredZoneNames")] - public IList RequiredZoneNames { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets private link resource Id + /// Gets the private link resource group id. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.groupId")] + public string GroupId {get; private set; } /// - /// Gets private link resource name + /// Gets the private link resource required member names. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requiredMembers")] + public System.Collections.Generic.IList RequiredMembers {get; private set; } /// - /// Gets private link resource type + /// Gets or sets the private link resource DNS zone name. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.requiredZoneNames")] + public System.Collections.Generic.IList RequiredZoneNames {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateLinkResourceListResult.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateLinkResourceListResult.cs index 74345e724609..bb3b5f772962 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateLinkResourceListResult.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateLinkResourceListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class PrivateLinkResourceListResult { /// - /// Initializes a new instance of the PrivateLinkResourceListResult - /// class. + /// Initializes a new instance of the PrivateLinkResourceListResult class. /// public PrivateLinkResourceListResult() { @@ -30,13 +21,15 @@ public PrivateLinkResourceListResult() } /// - /// Initializes a new instance of the PrivateLinkResourceListResult - /// class. + /// Initializes a new instance of the PrivateLinkResourceListResult class. /// - /// Array of private link resources - public PrivateLinkResourceListResult(IList value = default(IList)) + + /// Array of private link resources + /// + public PrivateLinkResourceListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -45,11 +38,11 @@ public PrivateLinkResourceListResult() /// partial void CustomInit(); + /// /// Gets or sets array of private link resources /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateLinkResourceProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateLinkResourceProperties.cs new file mode 100644 index 000000000000..ea85a4535aef --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateLinkResourceProperties.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Properties of a private link resource. + /// + public partial class PrivateLinkResourceProperties + { + /// + /// Initializes a new instance of the PrivateLinkResourceProperties class. + /// + public PrivateLinkResourceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkResourceProperties class. + /// + + /// The private link resource group id. + /// + + /// The private link resource required member names. + /// + + /// The private link resource DNS zone name. + /// + public PrivateLinkResourceProperties(string groupId = default(string), System.Collections.Generic.IList requiredMembers = default(System.Collections.Generic.IList), System.Collections.Generic.IList requiredZoneNames = default(System.Collections.Generic.IList)) + + { + this.GroupId = groupId; + this.RequiredMembers = requiredMembers; + this.RequiredZoneNames = requiredZoneNames; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the private link resource group id. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "groupId")] + public string GroupId {get; private set; } + + /// + /// Gets the private link resource required member names. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "requiredMembers")] + public System.Collections.Generic.IList RequiredMembers {get; private set; } + + /// + /// Gets or sets the private link resource DNS zone name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "requiredZoneNames")] + public System.Collections.Generic.IList RequiredZoneNames {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateLinkServiceConnectionState.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateLinkServiceConnectionState.cs index fd42da8e3751..24452c15b94c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateLinkServiceConnectionState.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PrivateLinkServiceConnectionState.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +14,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class PrivateLinkServiceConnectionState { /// - /// Initializes a new instance of the PrivateLinkServiceConnectionState - /// class. + /// Initializes a new instance of the PrivateLinkServiceConnectionState class. /// public PrivateLinkServiceConnectionState() { @@ -29,21 +22,25 @@ public PrivateLinkServiceConnectionState() } /// - /// Initializes a new instance of the PrivateLinkServiceConnectionState - /// class. + /// Initializes a new instance of the PrivateLinkServiceConnectionState class. /// - /// Indicates whether the connection has been - /// Approved/Rejected/Removed by the owner of the service. Possible - /// values include: 'Pending', 'Approved', 'Rejected' - /// The reason for approval/rejection of the - /// connection. - /// A message indicating if changes on - /// the service provider require any updates on the consumer. + + /// Indicates whether the connection has been Approved/Rejected/Removed by the + /// owner of the service. + /// Possible values include: 'Pending', 'Approved', 'Rejected' + + /// The reason for approval/rejection of the connection. + /// + + /// A message indicating if changes on the service provider require any updates + /// on the consumer. + /// public PrivateLinkServiceConnectionState(string status = default(string), string description = default(string), string actionsRequired = default(string)) + { - Status = status; - Description = description; - ActionsRequired = actionsRequired; + this.Status = status; + this.Description = description; + this.ActionsRequired = actionsRequired; CustomInit(); } @@ -52,26 +49,25 @@ public PrivateLinkServiceConnectionState() /// partial void CustomInit(); + /// /// Gets or sets indicates whether the connection has been - /// Approved/Rejected/Removed by the owner of the service. Possible - /// values include: 'Pending', 'Approved', 'Rejected' + /// Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected' /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// /// Gets or sets the reason for approval/rejection of the connection. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// - /// Gets or sets a message indicating if changes on the service - /// provider require any updates on the consumer. + /// Gets or sets a message indicating if changes on the service provider + /// require any updates on the consumer. /// - [JsonProperty(PropertyName = "actionsRequired")] - public string ActionsRequired { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "actionsRequired")] + public string ActionsRequired {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PropertyUpdatesInProgress.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PropertyUpdatesInProgress.cs index c929b3b9f106..8ea7dcc46764 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PropertyUpdatesInProgress.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PropertyUpdatesInProgress.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,14 @@ public PropertyUpdatesInProgress() /// /// Initializes a new instance of the PropertyUpdatesInProgress class. /// - /// The target performance tier of the disk if - /// a tier change operation is in progress. + + /// The target performance tier of the disk if a tier change operation is in + /// progress. + /// public PropertyUpdatesInProgress(string targetTier = default(string)) + { - TargetTier = targetTier; + this.TargetTier = targetTier; CustomInit(); } @@ -42,12 +39,12 @@ public PropertyUpdatesInProgress() /// partial void CustomInit(); + /// - /// Gets or sets the target performance tier of the disk if a tier - /// change operation is in progress. + /// Gets or sets the target performance tier of the disk if a tier change + /// operation is in progress. /// - [JsonProperty(PropertyName = "targetTier")] - public string TargetTier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "targetTier")] + public string TargetTier {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ProtocolTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ProtocolTypes.cs index a8ac8d6cedb0..7ddce3f0128f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ProtocolTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ProtocolTypes.cs @@ -1,29 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for ProtocolTypes. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum ProtocolTypes { - [EnumMember(Value = "Http")] + [System.Runtime.Serialization.EnumMember(Value = "Http")] Http, - [EnumMember(Value = "Https")] + [System.Runtime.Serialization.EnumMember(Value = "Https")] Https } internal static class ProtocolTypesEnumExtension @@ -32,7 +25,6 @@ internal static string ToSerializedValue(this ProtocolTypes? value) { return value == null ? null : ((ProtocolTypes)value).ToSerializedValue(); } - internal static string ToSerializedValue(this ProtocolTypes value) { switch( value ) @@ -44,7 +36,6 @@ internal static string ToSerializedValue(this ProtocolTypes value) } return null; } - internal static ProtocolTypes? ParseProtocolTypes(this string value) { switch( value ) @@ -57,4 +48,4 @@ internal static string ToSerializedValue(this ProtocolTypes value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ProvisionedBandwidthCopyOption.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ProvisionedBandwidthCopyOption.cs index f7dca517e8c8..96b89f3550e8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ProvisionedBandwidthCopyOption.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ProvisionedBandwidthCopyOption.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ProvisionedBandwidthCopyOption. /// + + public static class ProvisionedBandwidthCopyOption { public const string None = "None"; public const string Enhanced = "Enhanced"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroup.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroup.cs index a8836c88e894..5832c37f8168 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroup.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroup.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specifies information about the proximity placement group. /// - [Rest.Serialization.JsonTransformation] - public partial class ProximityPlacementGroup : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class ProximityPlacementGroup : TrackedResource { /// /// Initializes a new instance of the ProximityPlacementGroup class. @@ -34,38 +24,58 @@ public ProximityPlacementGroup() /// /// Initializes a new instance of the ProximityPlacementGroup class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// Specifies the type of the - /// proximity placement group. Possible values are: **Standard** : - /// Co-locate resources within an Azure region or Availability Zone. - /// **Ultra** : For future use. Possible values include: 'Standard', - /// 'Ultra' - /// A list of references to all virtual - /// machines in the proximity placement group. - /// A list of references to all - /// virtual machine scale sets in the proximity placement - /// group. - /// A list of references to all - /// availability sets in the proximity placement group. - /// Describes colocation status of the - /// Proximity Placement Group. - /// Specifies the user intent of the proximity - /// placement group. - /// The availability zones. - public ProximityPlacementGroup(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string proximityPlacementGroupType = default(string), IList virtualMachines = default(IList), IList virtualMachineScaleSets = default(IList), IList availabilitySets = default(IList), InstanceViewStatus colocationStatus = default(InstanceViewStatus), ProximityPlacementGroupPropertiesIntent intent = default(ProximityPlacementGroupPropertiesIntent), IList zones = default(IList)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// The availability zones. + /// + + /// Specifies the type of the proximity placement group. Possible values are: + /// **Standard** : Co-locate resources within an Azure region or Availability + /// Zone. **Ultra** : For future use. + /// Possible values include: 'Standard', 'Ultra' + + /// A list of references to all virtual machines in the proximity placement + /// group. + /// + + /// A list of references to all virtual machine scale sets in the proximity + /// placement group. + /// + + /// A list of references to all availability sets in the proximity placement + /// group. + /// + + /// Describes colocation status of the Proximity Placement Group. + /// + + /// Specifies the user intent of the proximity placement group. + /// + public ProximityPlacementGroup(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), string proximityPlacementGroupType = default(string), System.Collections.Generic.IList virtualMachines = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualMachineScaleSets = default(System.Collections.Generic.IList), System.Collections.Generic.IList availabilitySets = default(System.Collections.Generic.IList), InstanceViewStatus colocationStatus = default(InstanceViewStatus), ProximityPlacementGroupPropertiesIntent intent = default(ProximityPlacementGroupPropertiesIntent)) + + : base(location, id, name, type, tags) { - ProximityPlacementGroupType = proximityPlacementGroupType; - VirtualMachines = virtualMachines; - VirtualMachineScaleSets = virtualMachineScaleSets; - AvailabilitySets = availabilitySets; - ColocationStatus = colocationStatus; - Intent = intent; - Zones = zones; + this.Zones = zones; + this.ProximityPlacementGroupType = proximityPlacementGroupType; + this.VirtualMachines = virtualMachines; + this.VirtualMachineScaleSets = virtualMachineScaleSets; + this.AvailabilitySets = availabilitySets; + this.ColocationStatus = colocationStatus; + this.Intent = intent; CustomInit(); } @@ -74,65 +84,69 @@ public ProximityPlacementGroup() /// partial void CustomInit(); + /// - /// Gets or sets specifies the type of the proximity placement group. - /// Possible values are: **Standard** : Co-locate resources within an - /// Azure region or Availability Zone. **Ultra** : For future use. - /// Possible values include: 'Standard', 'Ultra' + /// Gets or sets the availability zones. /// - [JsonProperty(PropertyName = "properties.proximityPlacementGroupType")] - public string ProximityPlacementGroupType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } + + /// + /// Gets or sets specifies the type of the proximity placement group. Possible + /// values are: **Standard** : Co-locate resources within an Azure region or + /// Availability Zone. **Ultra** : For future use. Possible values include: 'Standard', 'Ultra' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.proximityPlacementGroupType")] + public string ProximityPlacementGroupType {get; set; } /// /// Gets a list of references to all virtual machines in the proximity /// placement group. /// - [JsonProperty(PropertyName = "properties.virtualMachines")] - public IList VirtualMachines { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachines")] + public System.Collections.Generic.IList VirtualMachines {get; private set; } /// /// Gets a list of references to all virtual machine scale sets in the /// proximity placement group. /// - [JsonProperty(PropertyName = "properties.virtualMachineScaleSets")] - public IList VirtualMachineScaleSets { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachineScaleSets")] + public System.Collections.Generic.IList VirtualMachineScaleSets {get; private set; } /// /// Gets a list of references to all availability sets in the proximity /// placement group. /// - [JsonProperty(PropertyName = "properties.availabilitySets")] - public IList AvailabilitySets { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.availabilitySets")] + public System.Collections.Generic.IList AvailabilitySets {get; private set; } /// - /// Gets or sets describes colocation status of the Proximity Placement - /// Group. + /// Gets or sets describes colocation status of the Proximity Placement Group. /// - [JsonProperty(PropertyName = "properties.colocationStatus")] - public InstanceViewStatus ColocationStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.colocationStatus")] + public InstanceViewStatus ColocationStatus {get; set; } /// - /// Gets or sets specifies the user intent of the proximity placement - /// group. + /// Gets or sets specifies the user intent of the proximity placement group. /// - [JsonProperty(PropertyName = "properties.intent")] - public ProximityPlacementGroupPropertiesIntent Intent { get; set; } - - /// - /// Gets or sets the availability zones. - /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.intent")] + public ProximityPlacementGroupPropertiesIntent Intent {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroupProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroupProperties.cs new file mode 100644 index 000000000000..f795f45c603c --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroupProperties.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a Proximity Placement Group. + /// + public partial class ProximityPlacementGroupProperties + { + /// + /// Initializes a new instance of the ProximityPlacementGroupProperties class. + /// + public ProximityPlacementGroupProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProximityPlacementGroupProperties class. + /// + + /// Specifies the type of the proximity placement group. Possible values are: + /// **Standard** : Co-locate resources within an Azure region or Availability + /// Zone. **Ultra** : For future use. + /// Possible values include: 'Standard', 'Ultra' + + /// A list of references to all virtual machines in the proximity placement + /// group. + /// + + /// A list of references to all virtual machine scale sets in the proximity + /// placement group. + /// + + /// A list of references to all availability sets in the proximity placement + /// group. + /// + + /// Describes colocation status of the Proximity Placement Group. + /// + + /// Specifies the user intent of the proximity placement group. + /// + public ProximityPlacementGroupProperties(string proximityPlacementGroupType = default(string), System.Collections.Generic.IList virtualMachines = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualMachineScaleSets = default(System.Collections.Generic.IList), System.Collections.Generic.IList availabilitySets = default(System.Collections.Generic.IList), InstanceViewStatus colocationStatus = default(InstanceViewStatus), ProximityPlacementGroupPropertiesIntent intent = default(ProximityPlacementGroupPropertiesIntent)) + + { + this.ProximityPlacementGroupType = proximityPlacementGroupType; + this.VirtualMachines = virtualMachines; + this.VirtualMachineScaleSets = virtualMachineScaleSets; + this.AvailabilitySets = availabilitySets; + this.ColocationStatus = colocationStatus; + this.Intent = intent; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets specifies the type of the proximity placement group. Possible + /// values are: **Standard** : Co-locate resources within an Azure region or + /// Availability Zone. **Ultra** : For future use. Possible values include: 'Standard', 'Ultra' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "proximityPlacementGroupType")] + public string ProximityPlacementGroupType {get; set; } + + /// + /// Gets a list of references to all virtual machines in the proximity + /// placement group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachines")] + public System.Collections.Generic.IList VirtualMachines {get; private set; } + + /// + /// Gets a list of references to all virtual machine scale sets in the + /// proximity placement group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachineScaleSets")] + public System.Collections.Generic.IList VirtualMachineScaleSets {get; private set; } + + /// + /// Gets a list of references to all availability sets in the proximity + /// placement group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "availabilitySets")] + public System.Collections.Generic.IList AvailabilitySets {get; private set; } + + /// + /// Gets or sets describes colocation status of the Proximity Placement Group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "colocationStatus")] + public InstanceViewStatus ColocationStatus {get; set; } + + /// + /// Gets or sets specifies the user intent of the proximity placement group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "intent")] + public ProximityPlacementGroupPropertiesIntent Intent {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroupPropertiesIntent.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroupPropertiesIntent.cs index 9b3bb104ae2a..f202eb5c3103 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroupPropertiesIntent.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroupPropertiesIntent.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class ProximityPlacementGroupPropertiesIntent { /// - /// Initializes a new instance of the - /// ProximityPlacementGroupPropertiesIntent class. + /// Initializes a new instance of the ProximityPlacementGroupPropertiesIntent class. /// public ProximityPlacementGroupPropertiesIntent() { @@ -30,14 +21,16 @@ public ProximityPlacementGroupPropertiesIntent() } /// - /// Initializes a new instance of the - /// ProximityPlacementGroupPropertiesIntent class. + /// Initializes a new instance of the ProximityPlacementGroupPropertiesIntent class. /// - /// Specifies possible sizes of virtual machines - /// that can be created in the proximity placement group. - public ProximityPlacementGroupPropertiesIntent(IList vmSizes = default(IList)) + + /// Specifies possible sizes of virtual machines that can be created in the + /// proximity placement group. + /// + public ProximityPlacementGroupPropertiesIntent(System.Collections.Generic.IList vmSizes = default(System.Collections.Generic.IList)) + { - VmSizes = vmSizes; + this.VmSizes = vmSizes; CustomInit(); } @@ -46,12 +39,12 @@ public ProximityPlacementGroupPropertiesIntent() /// partial void CustomInit(); + /// - /// Gets or sets specifies possible sizes of virtual machines that can - /// be created in the proximity placement group. + /// Gets or sets specifies possible sizes of virtual machines that can be + /// created in the proximity placement group. /// - [JsonProperty(PropertyName = "vmSizes")] - public IList VmSizes { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "vmSizes")] + public System.Collections.Generic.IList VmSizes {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroupType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroupType.cs index 9d5fc5433049..a617853332f6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroupType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroupType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ProximityPlacementGroupType. /// + + public static class ProximityPlacementGroupType { public const string Standard = "Standard"; public const string Ultra = "Ultra"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroupUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroupUpdate.cs index 0343a07d68f6..db5feed94431 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroupUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ProximityPlacementGroupUpdate.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class ProximityPlacementGroupUpdate : UpdateResource { /// - /// Initializes a new instance of the ProximityPlacementGroupUpdate - /// class. + /// Initializes a new instance of the ProximityPlacementGroupUpdate class. /// public ProximityPlacementGroupUpdate() { @@ -29,12 +21,14 @@ public ProximityPlacementGroupUpdate() } /// - /// Initializes a new instance of the ProximityPlacementGroupUpdate - /// class. + /// Initializes a new instance of the ProximityPlacementGroupUpdate class. /// - /// Resource tags - public ProximityPlacementGroupUpdate(IDictionary tags = default(IDictionary)) - : base(tags) + + /// Resource tags + /// + public ProximityPlacementGroupUpdate(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + + : base(tags) { CustomInit(); } @@ -45,4 +39,4 @@ public ProximityPlacementGroupUpdate() partial void CustomInit(); } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ProxyAgentSettings.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ProxyAgentSettings.cs index dd3a4ee063a2..9ad75f85d03d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ProxyAgentSettings.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ProxyAgentSettings.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Specifies ProxyAgent settings for the virtual machine or virtual - /// machine scale set. Minimum api-version: 2023-09-01. + /// Specifies ProxyAgent settings for the virtual machine or virtual machine + /// scale set. Minimum api-version: 2023-09-01. /// public partial class ProxyAgentSettings { @@ -30,33 +24,40 @@ public ProxyAgentSettings() /// /// Initializes a new instance of the ProxyAgentSettings class. /// - /// Specifies whether ProxyAgent feature should - /// be enabled on the virtual machine or virtual machine scale - /// set. - /// Specifies the mode that ProxyAgent will execute - /// on. Warning: this property has been deprecated, please specify - /// 'mode' under particular hostendpoint setting. Possible values - /// include: 'Audit', 'Enforce' - /// Increase the value of this property - /// allows users to reset the key used for securing communication - /// channel between guest and host. - /// Specifies the Wire Server endpoint - /// settings while creating the virtual machine or virtual machine - /// scale set. Minimum api-version: 2024-03-01. - /// Specifies the IMDS endpoint settings while - /// creating the virtual machine or virtual machine scale set. Minimum - /// api-version: 2024-03-01. - /// Specify whether to implicitly - /// install the ProxyAgent Extension. This option is currently - /// applicable only for Linux Os. + + /// Specifies whether ProxyAgent feature should be enabled on the virtual + /// machine or virtual machine scale set. + /// + + /// Specifies the mode that ProxyAgent will execute on. Warning: this property + /// has been deprecated, please specify 'mode' under particular hostendpoint + /// setting. + /// Possible values include: 'Audit', 'Enforce' + + /// Increase the value of this property allows users to reset the key used for + /// securing communication channel between guest and host. + /// + + /// Specifies the Wire Server endpoint settings while creating the virtual + /// machine or virtual machine scale set. Minimum api-version: 2024-03-01. + /// + + /// Specifies the IMDS endpoint settings while creating the virtual machine or + /// virtual machine scale set. Minimum api-version: 2024-03-01. + /// + + /// Specify whether to implicitly install the ProxyAgent Extension. This option + /// is currently applicable only for Linux Os. + /// public ProxyAgentSettings(bool? enabled = default(bool?), string mode = default(string), int? keyIncarnationId = default(int?), HostEndpointSettings wireServer = default(HostEndpointSettings), HostEndpointSettings imds = default(HostEndpointSettings), bool? addProxyAgentExtension = default(bool?)) + { - Enabled = enabled; - Mode = mode; - KeyIncarnationId = keyIncarnationId; - WireServer = wireServer; - Imds = imds; - AddProxyAgentExtension = addProxyAgentExtension; + this.Enabled = enabled; + this.Mode = mode; + this.KeyIncarnationId = keyIncarnationId; + this.WireServer = wireServer; + this.Imds = imds; + this.AddProxyAgentExtension = addProxyAgentExtension; CustomInit(); } @@ -65,52 +66,50 @@ public ProxyAgentSettings() /// partial void CustomInit(); + /// - /// Gets or sets specifies whether ProxyAgent feature should be enabled - /// on the virtual machine or virtual machine scale set. + /// Gets or sets specifies whether ProxyAgent feature should be enabled on the + /// virtual machine or virtual machine scale set. /// - [JsonProperty(PropertyName = "enabled")] - public bool? Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } /// - /// Gets or sets specifies the mode that ProxyAgent will execute on. - /// Warning: this property has been deprecated, please specify 'mode' - /// under particular hostendpoint setting. Possible values include: - /// 'Audit', 'Enforce' + /// Gets or sets specifies the mode that ProxyAgent will execute on. Warning: + /// this property has been deprecated, please specify 'mode' under particular + /// hostendpoint setting. Possible values include: 'Audit', 'Enforce' /// - [JsonProperty(PropertyName = "mode")] - public string Mode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "mode")] + public string Mode {get; set; } /// - /// Gets or sets increase the value of this property allows users to - /// reset the key used for securing communication channel between guest - /// and host. + /// Gets or sets increase the value of this property allows users to reset the + /// key used for securing communication channel between guest and host. /// - [JsonProperty(PropertyName = "keyIncarnationId")] - public int? KeyIncarnationId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "keyIncarnationId")] + public int? KeyIncarnationId {get; set; } /// - /// Gets or sets specifies the Wire Server endpoint settings while - /// creating the virtual machine or virtual machine scale set. Minimum - /// api-version: 2024-03-01. + /// Gets or sets specifies the Wire Server endpoint settings while creating the + /// virtual machine or virtual machine scale set. Minimum api-version: + /// 2024-03-01. /// - [JsonProperty(PropertyName = "wireServer")] - public HostEndpointSettings WireServer { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "wireServer")] + public HostEndpointSettings WireServer {get; set; } /// - /// Gets or sets specifies the IMDS endpoint settings while creating - /// the virtual machine or virtual machine scale set. Minimum - /// api-version: 2024-03-01. + /// Gets or sets specifies the IMDS endpoint settings while creating the + /// virtual machine or virtual machine scale set. Minimum api-version: + /// 2024-03-01. /// - [JsonProperty(PropertyName = "imds")] - public HostEndpointSettings Imds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "imds")] + public HostEndpointSettings Imds {get; set; } /// /// Gets or sets specify whether to implicitly install the ProxyAgent /// Extension. This option is currently applicable only for Linux Os. /// - [JsonProperty(PropertyName = "addProxyAgentExtension")] - public bool? AddProxyAgentExtension { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "addProxyAgentExtension")] + public bool? AddProxyAgentExtension {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ProxyResource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ProxyResource.cs index d30ac30ee4ef..812fa1e86ea8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ProxyResource.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ProxyResource.cs @@ -1,25 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; using System.Linq; /// - /// The resource model definition for an Azure Resource Manager proxy - /// resource. It will not have tags and a location + /// The resource model definition for an Azure Resource Manager proxy resource. + /// It will not have tags and a location /// - public partial class ProxyResource : IResource + public partial class ProxyResource : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the ProxyResource class. @@ -32,14 +24,21 @@ public ProxyResource() /// /// Initializes a new instance of the ProxyResource class. /// - /// Resource Id - /// Resource name - /// Resource type + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) + { - Id = id; - Name = name; - Type = type; + this.Id = id; + this.Name = name; + this.Type = type; CustomInit(); } @@ -48,23 +47,23 @@ public ProxyResource() /// partial void CustomInit(); + /// /// Gets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PublicIPAddressSku.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PublicIPAddressSku.cs index 7c58f0e6e932..43f819263f23 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PublicIPAddressSku.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PublicIPAddressSku.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Describes the public IP Sku. It can only be set with OrchestrationMode - /// as Flexible. + /// Describes the public IP Sku. It can only be set with OrchestrationMode as + /// Flexible. /// public partial class PublicIPAddressSku { @@ -30,14 +24,17 @@ public PublicIPAddressSku() /// /// Initializes a new instance of the PublicIPAddressSku class. /// - /// Specify public IP sku name. Possible values - /// include: 'Basic', 'Standard' - /// Specify public IP sku tier. Possible values - /// include: 'Regional', 'Global' + + /// Specify public IP sku name + /// Possible values include: 'Basic', 'Standard' + + /// Specify public IP sku tier + /// Possible values include: 'Regional', 'Global' public PublicIPAddressSku(string name = default(string), string tier = default(string)) + { - Name = name; - Tier = tier; + this.Name = name; + this.Tier = tier; CustomInit(); } @@ -46,19 +43,17 @@ public PublicIPAddressSku() /// partial void CustomInit(); + /// - /// Gets or sets specify public IP sku name. Possible values include: - /// 'Basic', 'Standard' + /// Gets or sets specify public IP sku name Possible values include: 'Basic', 'Standard' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets specify public IP sku tier. Possible values include: - /// 'Regional', 'Global' + /// Gets or sets specify public IP sku tier Possible values include: 'Regional', 'Global' /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + public string Tier {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PublicIPAddressSkuName.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PublicIPAddressSkuName.cs index aff7662690df..5219fc9ebb6b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PublicIPAddressSkuName.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PublicIPAddressSkuName.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for PublicIPAddressSkuName. /// + + public static class PublicIPAddressSkuName { public const string Basic = "Basic"; public const string Standard = "Standard"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PublicIPAddressSkuTier.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PublicIPAddressSkuTier.cs index 6e4f2b7c20cc..9b260eaf904f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PublicIPAddressSkuTier.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PublicIPAddressSkuTier.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for PublicIPAddressSkuTier. /// + + public static class PublicIPAddressSkuTier { public const string Regional = "Regional"; public const string Global = "Global"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PublicIPAllocationMethod.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PublicIPAllocationMethod.cs index da2ad835e97f..7fb90287bea7 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PublicIPAllocationMethod.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PublicIPAllocationMethod.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for PublicIPAllocationMethod. /// + + public static class PublicIPAllocationMethod { public const string Dynamic = "Dynamic"; public const string Static = "Static"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PublicNetworkAccess.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PublicNetworkAccess.cs index bf95aa396f39..674910382d21 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PublicNetworkAccess.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PublicNetworkAccess.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,21 +9,23 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for PublicNetworkAccess. /// + + public static class PublicNetworkAccess { /// - /// You can generate a SAS URI to access the underlying data of the - /// disk publicly on the internet when NetworkAccessPolicy is set to - /// AllowAll. You can access the data via the SAS URI only from your - /// trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. + /// You can generate a SAS URI to access the underlying data of the disk + /// publicly on the internet when NetworkAccessPolicy is set to AllowAll. You + /// can access the data via the SAS URI only from your trusted Azure VNET when + /// NetworkAccessPolicy is set to AllowPrivate. /// public const string Enabled = "Enabled"; /// - /// You cannot access the underlying data of the disk publicly on the - /// internet even when NetworkAccessPolicy is set to AllowAll. You can - /// access the data via the SAS URI only from your trusted Azure VNET - /// when NetworkAccessPolicy is set to AllowPrivate. + /// You cannot access the underlying data of the disk publicly on the internet + /// even when NetworkAccessPolicy is set to AllowAll. You can access the data + /// via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy + /// is set to AllowPrivate. /// public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/PurchasePlan.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/PurchasePlan.cs index bb15635d96a2..c1d5fa8a99d1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/PurchasePlan.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/PurchasePlan.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -31,18 +24,26 @@ public PurchasePlan() /// /// Initializes a new instance of the PurchasePlan class. /// - /// The plan ID. - /// The publisher ID. - /// Specifies the product of the image from the - /// marketplace. This is the same value as Offer under the - /// imageReference element. - /// The Offer Promotion Code. - public PurchasePlan(string name, string publisher, string product, string promotionCode = default(string)) + + /// The publisher ID. + /// + + /// The plan ID. + /// + + /// Specifies the product of the image from the marketplace. This is the same + /// value as Offer under the imageReference element. + /// + + /// The Offer Promotion Code. + /// + public PurchasePlan(string publisher, string name, string product, string promotionCode = default(string)) + { - Name = name; - Publisher = publisher; - Product = product; - PromotionCode = promotionCode; + this.Publisher = publisher; + this.Name = name; + this.Product = product; + this.PromotionCode = promotionCode; CustomInit(); } @@ -51,52 +52,55 @@ public PurchasePlan() /// partial void CustomInit(); + /// - /// Gets or sets the plan ID. + /// Gets or sets the publisher ID. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publisher")] + public string Publisher {get; set; } /// - /// Gets or sets the publisher ID. + /// Gets or sets the plan ID. /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets specifies the product of the image from the - /// marketplace. This is the same value as Offer under the - /// imageReference element. + /// Gets or sets specifies the product of the image from the marketplace. This + /// is the same value as Offer under the imageReference element. /// - [JsonProperty(PropertyName = "product")] - public string Product { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "product")] + public string Product {get; set; } /// /// Gets or sets the Offer Promotion Code. /// - [JsonProperty(PropertyName = "promotionCode")] - public string PromotionCode { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "promotionCode")] + public string PromotionCode {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Publisher == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Publisher"); } - if (Publisher == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Publisher"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (Product == null) + if (this.Product == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Product"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Product"); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RebalanceBehavior.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RebalanceBehavior.cs index dd9638b58c92..7bb93e8dbf67 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RebalanceBehavior.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RebalanceBehavior.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for RebalanceBehavior. /// + + public static class RebalanceBehavior { public const string CreateBeforeDelete = "CreateBeforeDelete"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RebalanceStrategy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RebalanceStrategy.cs index 8f3e2228937d..4fb21026810b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RebalanceStrategy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RebalanceStrategy.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for RebalanceStrategy. /// + + public static class RebalanceStrategy { public const string Recreate = "Recreate"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RecommendedMachineConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RecommendedMachineConfiguration.cs index 0b928b167932..be3697ed04ff 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RecommendedMachineConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RecommendedMachineConfiguration.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +14,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class RecommendedMachineConfiguration { /// - /// Initializes a new instance of the RecommendedMachineConfiguration - /// class. + /// Initializes a new instance of the RecommendedMachineConfiguration class. /// public RecommendedMachineConfiguration() { @@ -29,15 +22,19 @@ public RecommendedMachineConfiguration() } /// - /// Initializes a new instance of the RecommendedMachineConfiguration - /// class. + /// Initializes a new instance of the RecommendedMachineConfiguration class. /// - /// Describes the resource range. - /// Describes the resource range. - public RecommendedMachineConfiguration(ResourceRange vCPUs = default(ResourceRange), ResourceRange memory = default(ResourceRange)) + + /// Describes the resource range. + /// + + /// Describes the resource range. + /// + public RecommendedMachineConfiguration(ResourceRange vcpUs = default(ResourceRange), ResourceRange memory = default(ResourceRange)) + { - VCPUs = vCPUs; - Memory = memory; + this.VCPUs = vcpUs; + this.Memory = memory; CustomInit(); } @@ -46,17 +43,17 @@ public RecommendedMachineConfiguration() /// partial void CustomInit(); + /// /// Gets or sets describes the resource range. /// - [JsonProperty(PropertyName = "vCPUs")] - public ResourceRange VCPUs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vCPUs")] + public ResourceRange VCPUs {get; set; } /// /// Gets or sets describes the resource range. /// - [JsonProperty(PropertyName = "memory")] - public ResourceRange Memory { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "memory")] + public ResourceRange Memory {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RecoveryWalkResponse.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RecoveryWalkResponse.cs index f72a34d7fe44..aa2f598fd576 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RecoveryWalkResponse.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RecoveryWalkResponse.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,15 +23,18 @@ public RecoveryWalkResponse() /// /// Initializes a new instance of the RecoveryWalkResponse class. /// - /// Whether the recovery walk was - /// performed - /// The next update domain that - /// needs to be walked. Null means walk spanning all update domains has - /// been completed + + /// Whether the recovery walk was performed + /// + + /// The next update domain that needs to be walked. Null means walk spanning + /// all update domains has been completed + /// public RecoveryWalkResponse(bool? walkPerformed = default(bool?), int? nextPlatformUpdateDomain = default(int?)) + { - WalkPerformed = walkPerformed; - NextPlatformUpdateDomain = nextPlatformUpdateDomain; + this.WalkPerformed = walkPerformed; + this.NextPlatformUpdateDomain = nextPlatformUpdateDomain; CustomInit(); } @@ -46,18 +43,18 @@ public RecoveryWalkResponse() /// partial void CustomInit(); + /// /// Gets whether the recovery walk was performed /// - [JsonProperty(PropertyName = "walkPerformed")] - public bool? WalkPerformed { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "walkPerformed")] + public bool? WalkPerformed {get; private set; } /// - /// Gets the next update domain that needs to be walked. Null means - /// walk spanning all update domains has been completed + /// Gets the next update domain that needs to be walked. Null means walk + /// spanning all update domains has been completed /// - [JsonProperty(PropertyName = "nextPlatformUpdateDomain")] - public int? NextPlatformUpdateDomain { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextPlatformUpdateDomain")] + public int? NextPlatformUpdateDomain {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RegionalReplicationStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RegionalReplicationStatus.cs index a40af552a406..3ab1d59b64f2 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RegionalReplicationStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RegionalReplicationStatus.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,21 +23,25 @@ public RegionalReplicationStatus() /// /// Initializes a new instance of the RegionalReplicationStatus class. /// - /// The region to which the gallery image version - /// is being replicated to. + + /// The region to which the gallery image version is being replicated to. + /// + /// This is the regional replication state. - /// Possible values include: 'Unknown', 'Replicating', 'Completed', - /// 'Failed' - /// The details of the replication - /// status. - /// It indicates progress of the replication - /// job. + /// Possible values include: 'Unknown', 'Replicating', 'Completed', 'Failed' + + /// The details of the replication status. + /// + + /// It indicates progress of the replication job. + /// public RegionalReplicationStatus(string region = default(string), string state = default(string), string details = default(string), int? progress = default(int?)) + { - Region = region; - State = state; - Details = details; - Progress = progress; + this.Region = region; + this.State = state; + this.Details = details; + this.Progress = progress; CustomInit(); } @@ -52,31 +50,29 @@ public RegionalReplicationStatus() /// partial void CustomInit(); + /// - /// Gets the region to which the gallery image version is being - /// replicated to. + /// Gets the region to which the gallery image version is being replicated to. /// - [JsonProperty(PropertyName = "region")] - public string Region { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "region")] + public string Region {get; private set; } /// - /// Gets this is the regional replication state. Possible values - /// include: 'Unknown', 'Replicating', 'Completed', 'Failed' + /// Gets this is the regional replication state. Possible values include: 'Unknown', 'Replicating', 'Completed', 'Failed' /// - [JsonProperty(PropertyName = "state")] - public string State { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; private set; } /// /// Gets the details of the replication status. /// - [JsonProperty(PropertyName = "details")] - public string Details { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public string Details {get; private set; } /// /// Gets it indicates progress of the replication job. /// - [JsonProperty(PropertyName = "progress")] - public int? Progress { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "progress")] + public int? Progress {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RegionalSharingStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RegionalSharingStatus.cs index 8e25eeb8fb04..a253f07924b8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RegionalSharingStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RegionalSharingStatus.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,21 @@ public RegionalSharingStatus() /// /// Initializes a new instance of the RegionalSharingStatus class. /// - /// Region name - /// Gallery sharing state in current region. - /// Possible values include: 'Succeeded', 'InProgress', 'Failed', - /// 'Unknown' - /// Details of gallery regional sharing - /// failure. + + /// Region name + /// + + /// Gallery sharing state in current region + /// Possible values include: 'Succeeded', 'InProgress', 'Failed', 'Unknown' + + /// Details of gallery regional sharing failure. + /// public RegionalSharingStatus(string region = default(string), string state = default(string), string details = default(string)) + { - Region = region; - State = state; - Details = details; + this.Region = region; + this.State = state; + this.Details = details; CustomInit(); } @@ -48,24 +46,23 @@ public RegionalSharingStatus() /// partial void CustomInit(); + /// /// Gets or sets region name /// - [JsonProperty(PropertyName = "region")] - public string Region { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "region")] + public string Region {get; set; } /// - /// Gets gallery sharing state in current region. Possible values - /// include: 'Succeeded', 'InProgress', 'Failed', 'Unknown' + /// Gets gallery sharing state in current region Possible values include: 'Succeeded', 'InProgress', 'Failed', 'Unknown' /// - [JsonProperty(PropertyName = "state")] - public string State { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; private set; } /// /// Gets or sets details of gallery regional sharing failure. /// - [JsonProperty(PropertyName = "details")] - public string Details { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public string Details {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RepairAction.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RepairAction.cs index 93036df29aa9..259ff4e3874c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RepairAction.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RepairAction.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for RepairAction. /// + + public static class RepairAction { public const string Replace = "Replace"; public const string Restart = "Restart"; public const string Reimage = "Reimage"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ReplicationMode.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ReplicationMode.cs index dda2287ee863..768eca53116a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ReplicationMode.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ReplicationMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ReplicationMode. /// + + public static class ReplicationMode { public const string Full = "Full"; public const string Shallow = "Shallow"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ReplicationState.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ReplicationState.cs index f7fc0b93a288..337b73bcc8b0 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ReplicationState.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ReplicationState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ReplicationState. /// + + public static class ReplicationState { public const string Unknown = "Unknown"; @@ -21,4 +18,4 @@ public static class ReplicationState public const string Completed = "Completed"; public const string Failed = "Failed"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ReplicationStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ReplicationStatus.cs index 5263ab577613..b7fc09cf1251 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ReplicationStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ReplicationStatus.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,16 +23,18 @@ public ReplicationStatus() /// /// Initializes a new instance of the ReplicationStatus class. /// - /// This is the aggregated replication - /// status based on all the regional replication status flags. Possible - /// values include: 'Unknown', 'InProgress', 'Completed', - /// 'Failed' - /// This is a summary of replication status for - /// each region. - public ReplicationStatus(string aggregatedState = default(string), IList summary = default(IList)) + + /// This is the aggregated replication status based on all the regional + /// replication status flags. + /// Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed' + + /// This is a summary of replication status for each region. + /// + public ReplicationStatus(string aggregatedState = default(string), System.Collections.Generic.IList summary = default(System.Collections.Generic.IList)) + { - AggregatedState = aggregatedState; - Summary = summary; + this.AggregatedState = aggregatedState; + this.Summary = summary; CustomInit(); } @@ -49,19 +43,18 @@ public ReplicationStatus() /// partial void CustomInit(); + /// - /// Gets this is the aggregated replication status based on all the - /// regional replication status flags. Possible values include: - /// 'Unknown', 'InProgress', 'Completed', 'Failed' + /// Gets this is the aggregated replication status based on all the regional + /// replication status flags. Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed' /// - [JsonProperty(PropertyName = "aggregatedState")] - public string AggregatedState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "aggregatedState")] + public string AggregatedState {get; private set; } /// /// Gets this is a summary of replication status for each region. /// - [JsonProperty(PropertyName = "summary")] - public IList Summary { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "summary")] + public System.Collections.Generic.IList Summary {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ReplicationStatusTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ReplicationStatusTypes.cs index d95ba99ecab3..f660b193f215 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ReplicationStatusTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ReplicationStatusTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ReplicationStatusTypes. /// + + public static class ReplicationStatusTypes { public const string ReplicationStatus = "ReplicationStatus"; public const string UefiSettings = "UefiSettings"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RequestRateByIntervalInput.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RequestRateByIntervalInput.cs index a8fe7e5d4b1c..5228437aaeaa 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RequestRateByIntervalInput.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RequestRateByIntervalInput.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,27 +23,39 @@ public RequestRateByIntervalInput() /// /// Initializes a new instance of the RequestRateByIntervalInput class. /// - /// SAS Uri of the logging blob - /// container to which LogAnalytics Api writes output logs to. - /// From time of the query - /// To time of the query - /// Interval value in minutes used to - /// create LogAnalytics call rate logs. Possible values include: - /// 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins' - /// Group query result by Throttle - /// Policy applied. - /// Group query result by Operation - /// Name. - /// Group query result by Resource - /// Name. - /// Group query result by - /// Client Application ID. - /// Group query result by User - /// Agent. + + /// SAS Uri of the logging blob container to which LogAnalytics Api writes + /// output logs to. + /// + + /// From time of the query + /// + + /// To time of the query + /// + + /// Group query result by Throttle Policy applied. + /// + + /// Group query result by Operation Name. + /// + + /// Group query result by Resource Name. + /// + + /// Group query result by Client Application ID. + /// + + /// Group query result by User Agent. + /// + + /// Interval value in minutes used to create LogAnalytics call rate logs. + /// Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins' public RequestRateByIntervalInput(string blobContainerSasUri, System.DateTime fromTime, System.DateTime toTime, IntervalInMins intervalLength, bool? groupByThrottlePolicy = default(bool?), bool? groupByOperationName = default(bool?), bool? groupByResourceName = default(bool?), bool? groupByClientApplicationId = default(bool?), bool? groupByUserAgent = default(bool?)) - : base(blobContainerSasUri, fromTime, toTime, groupByThrottlePolicy, groupByOperationName, groupByResourceName, groupByClientApplicationId, groupByUserAgent) + + : base(blobContainerSasUri, fromTime, toTime, groupByThrottlePolicy, groupByOperationName, groupByResourceName, groupByClientApplicationId, groupByUserAgent) { - IntervalLength = intervalLength; + this.IntervalLength = intervalLength; CustomInit(); } @@ -58,23 +64,23 @@ public RequestRateByIntervalInput() /// partial void CustomInit(); + /// - /// Gets or sets interval value in minutes used to create LogAnalytics - /// call rate logs. Possible values include: 'ThreeMins', 'FiveMins', - /// 'ThirtyMins', 'SixtyMins' + /// Gets or sets interval value in minutes used to create LogAnalytics call + /// rate logs. Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins' /// - [JsonProperty(PropertyName = "intervalLength")] - public IntervalInMins IntervalLength { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "intervalLength")] + public IntervalInMins IntervalLength {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ReservationType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ReservationType.cs index 6ed18c10e141..885310f64cbc 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ReservationType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ReservationType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ReservationType. /// + + public static class ReservationType { /// @@ -22,9 +19,9 @@ public static class ReservationType /// public const string Targeted = "Targeted"; /// - /// To consume scheduled allocated block capacity reservation when a - /// capacity reservation group is provided. + /// To consume scheduled allocated block capacity reservation when a capacity + /// reservation group is provided. /// public const string Block = "Block"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResiliencyPolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResiliencyPolicy.cs index e30784057390..bb0ef4ee4c23 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResiliencyPolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResiliencyPolicy.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -30,20 +24,25 @@ public ResiliencyPolicy() /// /// Initializes a new instance of the ResiliencyPolicy class. /// - /// The configuration - /// parameters used while performing resilient VM creation. - /// The configuration - /// parameters used while performing resilient VM deletion. - /// The configuration - /// parameters used while performing automatic AZ balancing. - /// The configuration parameters - /// used while performing zone allocation. + + /// The configuration parameters used while performing resilient VM creation. + /// + + /// The configuration parameters used while performing resilient VM deletion. + /// + + /// The configuration parameters used while performing automatic AZ balancing. + /// + + /// The configuration parameters used while performing zone allocation. + /// public ResiliencyPolicy(ResilientVMCreationPolicy resilientVMCreationPolicy = default(ResilientVMCreationPolicy), ResilientVMDeletionPolicy resilientVMDeletionPolicy = default(ResilientVMDeletionPolicy), AutomaticZoneRebalancingPolicy automaticZoneRebalancingPolicy = default(AutomaticZoneRebalancingPolicy), ZoneAllocationPolicy zoneAllocationPolicy = default(ZoneAllocationPolicy)) + { - ResilientVMCreationPolicy = resilientVMCreationPolicy; - ResilientVMDeletionPolicy = resilientVMDeletionPolicy; - AutomaticZoneRebalancingPolicy = automaticZoneRebalancingPolicy; - ZoneAllocationPolicy = zoneAllocationPolicy; + this.ResilientVMCreationPolicy = resilientVMCreationPolicy; + this.ResilientVMDeletionPolicy = resilientVMDeletionPolicy; + this.AutomaticZoneRebalancingPolicy = automaticZoneRebalancingPolicy; + this.ZoneAllocationPolicy = zoneAllocationPolicy; CustomInit(); } @@ -52,46 +51,49 @@ public ResiliencyPolicy() /// partial void CustomInit(); + /// - /// Gets or sets the configuration parameters used while performing - /// resilient VM creation. + /// Gets or sets the configuration parameters used while performing resilient + /// VM creation. /// - [JsonProperty(PropertyName = "resilientVMCreationPolicy")] - public ResilientVMCreationPolicy ResilientVMCreationPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resilientVMCreationPolicy")] + public ResilientVMCreationPolicy ResilientVMCreationPolicy {get; set; } /// - /// Gets or sets the configuration parameters used while performing - /// resilient VM deletion. + /// Gets or sets the configuration parameters used while performing resilient + /// VM deletion. /// - [JsonProperty(PropertyName = "resilientVMDeletionPolicy")] - public ResilientVMDeletionPolicy ResilientVMDeletionPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resilientVMDeletionPolicy")] + public ResilientVMDeletionPolicy ResilientVMDeletionPolicy {get; set; } /// - /// Gets or sets the configuration parameters used while performing - /// automatic AZ balancing. + /// Gets or sets the configuration parameters used while performing automatic + /// AZ balancing. /// - [JsonProperty(PropertyName = "automaticZoneRebalancingPolicy")] - public AutomaticZoneRebalancingPolicy AutomaticZoneRebalancingPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "automaticZoneRebalancingPolicy")] + public AutomaticZoneRebalancingPolicy AutomaticZoneRebalancingPolicy {get; set; } /// - /// Gets or sets the configuration parameters used while performing - /// zone allocation. + /// Gets or sets the configuration parameters used while performing zone + /// allocation. /// - [JsonProperty(PropertyName = "zoneAllocationPolicy")] - public ZoneAllocationPolicy ZoneAllocationPolicy { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "zoneAllocationPolicy")] + public ZoneAllocationPolicy ZoneAllocationPolicy {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ZoneAllocationPolicy != null) + + + + if (this.ZoneAllocationPolicy != null) { - ZoneAllocationPolicy.Validate(); + this.ZoneAllocationPolicy.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResilientVMCreationPolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResilientVMCreationPolicy.cs index 8e413cd3acd2..4274e1c228c8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResilientVMCreationPolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResilientVMCreationPolicy.cs @@ -1,21 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// The configuration parameters used while performing resilient VM - /// creation. + /// The configuration parameters used while performing resilient VM creation. /// public partial class ResilientVMCreationPolicy { @@ -30,12 +23,14 @@ public ResilientVMCreationPolicy() /// /// Initializes a new instance of the ResilientVMCreationPolicy class. /// - /// Specifies whether resilient VM creation - /// should be enabled on the virtual machine scale set. The default - /// value is false. + + /// Specifies whether resilient VM creation should be enabled on the virtual + /// machine scale set. The default value is false. + /// public ResilientVMCreationPolicy(bool? enabled = default(bool?)) + { - Enabled = enabled; + this.Enabled = enabled; CustomInit(); } @@ -44,13 +39,12 @@ public ResilientVMCreationPolicy() /// partial void CustomInit(); + /// - /// Gets or sets specifies whether resilient VM creation should be - /// enabled on the virtual machine scale set. The default value is - /// false. + /// Gets or sets specifies whether resilient VM creation should be enabled on + /// the virtual machine scale set. The default value is false. /// - [JsonProperty(PropertyName = "enabled")] - public bool? Enabled { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResilientVMDeletionPolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResilientVMDeletionPolicy.cs index a98da9b0ce6d..cd16f4ce4937 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResilientVMDeletionPolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResilientVMDeletionPolicy.cs @@ -1,21 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// The configuration parameters used while performing resilient VM - /// deletion. + /// The configuration parameters used while performing resilient VM deletion. /// public partial class ResilientVMDeletionPolicy { @@ -30,12 +23,14 @@ public ResilientVMDeletionPolicy() /// /// Initializes a new instance of the ResilientVMDeletionPolicy class. /// - /// Specifies whether resilient VM deletion - /// should be enabled on the virtual machine scale set. The default - /// value is false. + + /// Specifies whether resilient VM deletion should be enabled on the virtual + /// machine scale set. The default value is false. + /// public ResilientVMDeletionPolicy(bool? enabled = default(bool?)) + { - Enabled = enabled; + this.Enabled = enabled; CustomInit(); } @@ -44,13 +39,12 @@ public ResilientVMDeletionPolicy() /// partial void CustomInit(); + /// - /// Gets or sets specifies whether resilient VM deletion should be - /// enabled on the virtual machine scale set. The default value is - /// false. + /// Gets or sets specifies whether resilient VM deletion should be enabled on + /// the virtual machine scale set. The default value is false. /// - [JsonProperty(PropertyName = "enabled")] - public bool? Enabled { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResilientVMDeletionStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResilientVMDeletionStatus.cs index d1e09a63ba43..40876f71fe08 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResilientVMDeletionStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResilientVMDeletionStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ResilientVMDeletionStatus. /// + + public static class ResilientVMDeletionStatus { public const string Enabled = "Enabled"; @@ -21,4 +18,4 @@ public static class ResilientVMDeletionStatus public const string InProgress = "InProgress"; public const string Failed = "Failed"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Resource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Resource.cs deleted file mode 100644 index ec2892fb8f54..000000000000 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Resource.cs +++ /dev/null @@ -1,100 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The Resource model definition. - /// - public partial class Resource : IResource - { - /// - /// Initializes a new instance of the Resource class. - /// - public Resource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Resource class. - /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) - { - Id = id; - Name = name; - Type = type; - Location = location; - Tags = tags; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets resource Id - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets resource name - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets resource type - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - /// - /// Gets or sets resource location - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets resource tags - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } - } - } -} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceIdOptionsForGetCapacityReservationGroups.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceIdOptionsForGetCapacityReservationGroups.cs index 3d591ff0eccb..b93e031c059b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceIdOptionsForGetCapacityReservationGroups.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceIdOptionsForGetCapacityReservationGroups.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ResourceIdOptionsForGetCapacityReservationGroups. /// + + public static class ResourceIdOptionsForGetCapacityReservationGroups { public const string CreatedInSubscription = "CreatedInSubscription"; public const string SharedWithSubscription = "SharedWithSubscription"; public const string All = "All"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceIdentityType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceIdentityType.cs index fe0d168fb4cb..dffeab8eaaba 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceIdentityType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceIdentityType.cs @@ -1,33 +1,26 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for ResourceIdentityType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum ResourceIdentityType { - [EnumMember(Value = "SystemAssigned")] + [System.Runtime.Serialization.EnumMember(Value = "SystemAssigned")] SystemAssigned, - [EnumMember(Value = "UserAssigned")] + [System.Runtime.Serialization.EnumMember(Value = "UserAssigned")] UserAssigned, - [EnumMember(Value = "SystemAssigned, UserAssigned")] + [System.Runtime.Serialization.EnumMember(Value = "SystemAssigned, UserAssigned")] SystemAssignedUserAssigned, - [EnumMember(Value = "None")] + [System.Runtime.Serialization.EnumMember(Value = "None")] None } internal static class ResourceIdentityTypeEnumExtension @@ -36,7 +29,6 @@ internal static string ToSerializedValue(this ResourceIdentityType? value) { return value == null ? null : ((ResourceIdentityType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this ResourceIdentityType value) { switch( value ) @@ -52,7 +44,6 @@ internal static string ToSerializedValue(this ResourceIdentityType value) } return null; } - internal static ResourceIdentityType? ParseResourceIdentityType(this string value) { switch( value ) @@ -69,4 +60,4 @@ internal static string ToSerializedValue(this ResourceIdentityType value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceOriginal.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceOriginal.cs index 10a31771c5ef..241ef43fe43a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceOriginal.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceOriginal.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The Resource model definition. /// - public partial class ResourceOriginal : IResource + public partial class ResourceOriginal : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the ResourceOriginal class. @@ -33,18 +23,29 @@ public ResourceOriginal() /// /// Initializes a new instance of the ResourceOriginal class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags. - public ResourceOriginal(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags. + /// + public ResourceOriginal(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { - Id = id; - Name = name; - Type = type; - Location = location; - Tags = tags; + this.Id = id; + this.Name = name; + this.Type = type; + this.Location = location; + this.Tags = tags; CustomInit(); } @@ -53,48 +54,53 @@ public ResourceOriginal() /// partial void CustomInit(); + /// /// Gets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets resource tags. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Location == null) + if (this.Location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceRange.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceRange.cs index e5a444752082..3539e8a5251f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceRange.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceRange.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public ResourceRange() /// /// Initializes a new instance of the ResourceRange class. /// - /// The minimum number of the resource. - /// The maximum number of the resource. + + /// The minimum number of the resource. + /// + + /// The maximum number of the resource. + /// public ResourceRange(int? min = default(int?), int? max = default(int?)) + { - Min = min; - Max = max; + this.Min = min; + this.Max = max; CustomInit(); } @@ -43,17 +42,17 @@ public ResourceRange() /// partial void CustomInit(); + /// /// Gets or sets the minimum number of the resource. /// - [JsonProperty(PropertyName = "min")] - public int? Min { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "min")] + public int? Min {get; set; } /// /// Gets or sets the maximum number of the resource. /// - [JsonProperty(PropertyName = "max")] - public int? Max { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "max")] + public int? Max {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSharingProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSharingProfile.cs index d00ebe07354c..f4cda04db764 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSharingProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSharingProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; public partial class ResourceSharingProfile @@ -28,15 +20,16 @@ public ResourceSharingProfile() /// /// Initializes a new instance of the ResourceSharingProfile class. /// - /// Specifies an array of subscription - /// resource IDs that capacity reservation group is shared with. Block - /// Capacity Reservations does not support sharing across - /// subscriptions. **Note:** Minimum api-version: 2023-09-01. Please - /// refer to https://aka.ms/computereservationsharing for more - /// details. - public ResourceSharingProfile(IList subscriptionIds = default(IList)) + + /// Specifies an array of subscription resource IDs that capacity reservation + /// group is shared with. Block Capacity Reservations does not support sharing + /// across subscriptions. **Note:** Minimum api-version: 2023-09-01. Please + /// refer to https://aka.ms/computereservationsharing for more details. + /// + public ResourceSharingProfile(System.Collections.Generic.IList subscriptionIds = default(System.Collections.Generic.IList)) + { - SubscriptionIds = subscriptionIds; + this.SubscriptionIds = subscriptionIds; CustomInit(); } @@ -45,15 +38,15 @@ public ResourceSharingProfile() /// partial void CustomInit(); + /// - /// Gets or sets specifies an array of subscription resource IDs that - /// capacity reservation group is shared with. Block Capacity - /// Reservations does not support sharing across subscriptions. - /// **Note:** Minimum api-version: 2023-09-01. Please refer to - /// https://aka.ms/computereservationsharing for more details. + /// Gets or sets specifies an array of subscription resource IDs that capacity + /// reservation group is shared with. Block Capacity Reservations does not + /// support sharing across subscriptions. **Note:** Minimum api-version: + /// 2023-09-01. Please refer to https://aka.ms/computereservationsharing for + /// more details. /// - [JsonProperty(PropertyName = "subscriptionIds")] - public IList SubscriptionIds { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "subscriptionIds")] + public System.Collections.Generic.IList SubscriptionIds {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSku.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSku.cs index c643ae3728b2..7411ea4c0c5d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSku.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSku.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,45 +23,64 @@ public ResourceSku() /// /// Initializes a new instance of the ResourceSku class. /// - /// The type of resource the SKU applies - /// to. - /// The name of SKU. - /// Specifies the tier of virtual machines in a - /// scale set.<br /><br /> Possible Values:<br - /// /><br /> **Standard**<br /><br /> - /// **Basic** - /// The Size of the SKU. - /// The Family of this particular SKU. - /// The Kind of resources that are supported in this - /// SKU. - /// Specifies the number of virtual machines in - /// the scale set. - /// The set of locations that the SKU is - /// available. - /// A list of locations and availability - /// zones in those locations where the SKU is available. - /// The api versions that support this - /// SKU. - /// Metadata for retrieving price info. - /// A name value pair to describe the - /// capability. - /// The restrictions because of which SKU - /// cannot be used. This is empty if there are no restrictions. - public ResourceSku(string resourceType = default(string), string name = default(string), string tier = default(string), string size = default(string), string family = default(string), string kind = default(string), ResourceSkuCapacity capacity = default(ResourceSkuCapacity), IList locations = default(IList), IList locationInfo = default(IList), IList apiVersions = default(IList), IList costs = default(IList), IList capabilities = default(IList), IList restrictions = default(IList)) + + /// The type of resource the SKU applies to. + /// + + /// The name of SKU. + /// + + /// Specifies the tier of virtual machines in a scale set.<br /><br /> Possible + /// Values:<br /><br /> **Standard**<br /><br /> **Basic** + /// + + /// The Size of the SKU. + /// + + /// The Family of this particular SKU. + /// + + /// The Kind of resources that are supported in this SKU. + /// + + /// Specifies the number of virtual machines in the scale set. + /// + + /// The set of locations that the SKU is available. + /// + + /// A list of locations and availability zones in those locations where the SKU + /// is available. + /// + + /// The api versions that support this SKU. + /// + + /// Metadata for retrieving price info. + /// + + /// A name value pair to describe the capability. + /// + + /// The restrictions because of which SKU cannot be used. This is empty if + /// there are no restrictions. + /// + public ResourceSku(string resourceType = default(string), string name = default(string), string tier = default(string), string size = default(string), string family = default(string), string kind = default(string), ResourceSkuCapacity capacity = default(ResourceSkuCapacity), System.Collections.Generic.IList locations = default(System.Collections.Generic.IList), System.Collections.Generic.IList locationInfo = default(System.Collections.Generic.IList), System.Collections.Generic.IList apiVersions = default(System.Collections.Generic.IList), System.Collections.Generic.IList costs = default(System.Collections.Generic.IList), System.Collections.Generic.IList capabilities = default(System.Collections.Generic.IList), System.Collections.Generic.IList restrictions = default(System.Collections.Generic.IList)) + { - ResourceType = resourceType; - Name = name; - Tier = tier; - Size = size; - Family = family; - Kind = kind; - Capacity = capacity; - Locations = locations; - LocationInfo = locationInfo; - ApiVersions = apiVersions; - Costs = costs; - Capabilities = capabilities; - Restrictions = restrictions; + this.ResourceType = resourceType; + this.Name = name; + this.Tier = tier; + this.Size = size; + this.Family = family; + this.Kind = kind; + this.Capacity = capacity; + this.Locations = locations; + this.LocationInfo = locationInfo; + this.ApiVersions = apiVersions; + this.Costs = costs; + this.Capabilities = capabilities; + this.Restrictions = restrictions; CustomInit(); } @@ -78,88 +89,86 @@ public ResourceSku() /// partial void CustomInit(); + /// /// Gets the type of resource the SKU applies to. /// - [JsonProperty(PropertyName = "resourceType")] - public string ResourceType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceType")] + public string ResourceType {get; private set; } /// /// Gets the name of SKU. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// - /// Gets specifies the tier of virtual machines in a scale - /// set.&lt;br /&gt;&lt;br /&gt; Possible - /// Values:&lt;br /&gt;&lt;br /&gt; - /// **Standard**&lt;br /&gt;&lt;br /&gt; **Basic** + /// Gets specifies the tier of virtual machines in a scale set.<br /><br /> + /// Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + public string Tier {get; private set; } /// /// Gets the Size of the SKU. /// - [JsonProperty(PropertyName = "size")] - public string Size { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "size")] + public string Size {get; private set; } /// /// Gets the Family of this particular SKU. /// - [JsonProperty(PropertyName = "family")] - public string Family { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "family")] + public string Family {get; private set; } /// /// Gets the Kind of resources that are supported in this SKU. /// - [JsonProperty(PropertyName = "kind")] - public string Kind { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "kind")] + public string Kind {get; private set; } /// /// Gets specifies the number of virtual machines in the scale set. /// - [JsonProperty(PropertyName = "capacity")] - public ResourceSkuCapacity Capacity { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "capacity")] + public ResourceSkuCapacity Capacity {get; private set; } /// /// Gets the set of locations that the SKU is available. /// - [JsonProperty(PropertyName = "locations")] - public IList Locations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "locations")] + public System.Collections.Generic.IList Locations {get; private set; } /// - /// Gets a list of locations and availability zones in those locations - /// where the SKU is available. + /// Gets a list of locations and availability zones in those locations where + /// the SKU is available. /// - [JsonProperty(PropertyName = "locationInfo")] - public IList LocationInfo { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "locationInfo")] + public System.Collections.Generic.IList LocationInfo {get; private set; } /// /// Gets the api versions that support this SKU. /// - [JsonProperty(PropertyName = "apiVersions")] - public IList ApiVersions { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "apiVersions")] + public System.Collections.Generic.IList ApiVersions {get; private set; } /// /// Gets metadata for retrieving price info. /// - [JsonProperty(PropertyName = "costs")] - public IList Costs { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "costs")] + public System.Collections.Generic.IList Costs {get; private set; } /// /// Gets a name value pair to describe the capability. /// - [JsonProperty(PropertyName = "capabilities")] - public IList Capabilities { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "capabilities")] + public System.Collections.Generic.IList Capabilities {get; private set; } /// - /// Gets the restrictions because of which SKU cannot be used. This is - /// empty if there are no restrictions. + /// Gets the restrictions because of which SKU cannot be used. This is empty if + /// there are no restrictions. /// - [JsonProperty(PropertyName = "restrictions")] - public IList Restrictions { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "restrictions")] + public System.Collections.Generic.IList Restrictions {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuCapabilities.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuCapabilities.cs index 272bb901e726..019eb742a21e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuCapabilities.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuCapabilities.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public ResourceSkuCapabilities() /// /// Initializes a new instance of the ResourceSkuCapabilities class. /// - /// An invariant to describe the feature. - /// An invariant if the feature is measured by - /// quantity. + + /// An invariant to describe the feature. + /// + + /// An invariant if the feature is measured by quantity. + /// public ResourceSkuCapabilities(string name = default(string), string value = default(string)) + { - Name = name; - Value = value; + this.Name = name; + this.Value = value; CustomInit(); } @@ -44,17 +42,17 @@ public ResourceSkuCapabilities() /// partial void CustomInit(); + /// /// Gets an invariant to describe the feature. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets an invariant if the feature is measured by quantity. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuCapacity.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuCapacity.cs index 7ff7b7d0c818..4423185188e3 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuCapacity.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuCapacity.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,25 @@ public ResourceSkuCapacity() /// /// Initializes a new instance of the ResourceSkuCapacity class. /// - /// The minimum capacity. - /// The maximum capacity that can be set. - /// The default capacity. + + /// The minimum capacity. + /// + + /// The maximum capacity that can be set. + /// + + /// The default capacity. + /// + /// The scale type applicable to the sku. - /// Possible values include: 'Automatic', 'Manual', 'None' + /// Possible values include: 'Automatic', 'Manual', 'None' public ResourceSkuCapacity(long? minimum = default(long?), long? maximum = default(long?), long? defaultProperty = default(long?), ResourceSkuCapacityScaleType? scaleType = default(ResourceSkuCapacityScaleType?)) + { - Minimum = minimum; - Maximum = maximum; - DefaultProperty = defaultProperty; - ScaleType = scaleType; + this.Minimum = minimum; + this.Maximum = maximum; + this.DefaultProperty = defaultProperty; + this.ScaleType = scaleType; CustomInit(); } @@ -48,30 +50,29 @@ public ResourceSkuCapacity() /// partial void CustomInit(); + /// /// Gets the minimum capacity. /// - [JsonProperty(PropertyName = "minimum")] - public long? Minimum { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "minimum")] + public long? Minimum {get; private set; } /// /// Gets the maximum capacity that can be set. /// - [JsonProperty(PropertyName = "maximum")] - public long? Maximum { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maximum")] + public long? Maximum {get; private set; } /// /// Gets the default capacity. /// - [JsonProperty(PropertyName = "default")] - public long? DefaultProperty { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "default")] + public long? DefaultProperty {get; private set; } /// - /// Gets the scale type applicable to the sku. Possible values include: - /// 'Automatic', 'Manual', 'None' + /// Gets the scale type applicable to the sku. Possible values include: 'Automatic', 'Manual', 'None' /// - [JsonProperty(PropertyName = "scaleType")] - public ResourceSkuCapacityScaleType? ScaleType { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "scaleType")] + public ResourceSkuCapacityScaleType? ScaleType {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuCapacityScaleType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuCapacityScaleType.cs index cf50ce88d490..bd890e918b72 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuCapacityScaleType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuCapacityScaleType.cs @@ -1,31 +1,24 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for ResourceSkuCapacityScaleType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum ResourceSkuCapacityScaleType { - [EnumMember(Value = "Automatic")] + [System.Runtime.Serialization.EnumMember(Value = "Automatic")] Automatic, - [EnumMember(Value = "Manual")] + [System.Runtime.Serialization.EnumMember(Value = "Manual")] Manual, - [EnumMember(Value = "None")] + [System.Runtime.Serialization.EnumMember(Value = "None")] None } internal static class ResourceSkuCapacityScaleTypeEnumExtension @@ -34,7 +27,6 @@ internal static string ToSerializedValue(this ResourceSkuCapacityScaleType? valu { return value == null ? null : ((ResourceSkuCapacityScaleType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this ResourceSkuCapacityScaleType value) { switch( value ) @@ -48,7 +40,6 @@ internal static string ToSerializedValue(this ResourceSkuCapacityScaleType value } return null; } - internal static ResourceSkuCapacityScaleType? ParseResourceSkuCapacityScaleType(this string value) { switch( value ) @@ -63,4 +54,4 @@ internal static string ToSerializedValue(this ResourceSkuCapacityScaleType value return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuCosts.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuCosts.cs index 6c0cbaaacedd..99ccfbf202e5 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuCosts.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuCosts.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,17 +23,21 @@ public ResourceSkuCosts() /// /// Initializes a new instance of the ResourceSkuCosts class. /// - /// Used for querying price from - /// commerce. - /// The multiplier is needed to extend the base - /// metered cost. - /// An invariant to show the extended - /// unit. - public ResourceSkuCosts(string meterID = default(string), long? quantity = default(long?), string extendedUnit = default(string)) + + /// Used for querying price from commerce. + /// + + /// The multiplier is needed to extend the base metered cost. + /// + + /// An invariant to show the extended unit. + /// + public ResourceSkuCosts(string meterId = default(string), long? quantity = default(long?), string extendedUnit = default(string)) + { - MeterID = meterID; - Quantity = quantity; - ExtendedUnit = extendedUnit; + this.MeterID = meterId; + this.Quantity = quantity; + this.ExtendedUnit = extendedUnit; CustomInit(); } @@ -48,23 +46,23 @@ public ResourceSkuCosts() /// partial void CustomInit(); + /// /// Gets used for querying price from commerce. /// - [JsonProperty(PropertyName = "meterID")] - public string MeterID { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "meterID")] + public string MeterID {get; private set; } /// /// Gets the multiplier is needed to extend the base metered cost. /// - [JsonProperty(PropertyName = "quantity")] - public long? Quantity { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "quantity")] + public long? Quantity {get; private set; } /// /// Gets an invariant to show the extended unit. /// - [JsonProperty(PropertyName = "extendedUnit")] - public string ExtendedUnit { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedUnit")] + public string ExtendedUnit {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuLocationInfo.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuLocationInfo.cs index 827efc95d4ed..8371bdcba223 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuLocationInfo.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuLocationInfo.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,22 +23,29 @@ public ResourceSkuLocationInfo() /// /// Initializes a new instance of the ResourceSkuLocationInfo class. /// - /// Location of the SKU - /// List of availability zones where the SKU is - /// supported. - /// Details of capabilities available to a - /// SKU in specific zones. - /// The names of extended - /// locations. - /// The type of the extended location. Possible - /// values include: 'EdgeZone' - public ResourceSkuLocationInfo(string location = default(string), IList zones = default(IList), IList zoneDetails = default(IList), IList extendedLocations = default(IList), string type = default(string)) + + /// Location of the SKU + /// + + /// List of availability zones where the SKU is supported. + /// + + /// Details of capabilities available to a SKU in specific zones. + /// + + /// The names of extended locations. + /// + + /// The type of the extended location. + /// Possible values include: 'EdgeZone' + public ResourceSkuLocationInfo(string location = default(string), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), System.Collections.Generic.IList zoneDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IList extendedLocations = default(System.Collections.Generic.IList), string type = default(string)) + { - Location = location; - Zones = zones; - ZoneDetails = zoneDetails; - ExtendedLocations = extendedLocations; - Type = type; + this.Location = location; + this.Zones = zones; + this.ZoneDetails = zoneDetails; + this.ExtendedLocations = extendedLocations; + this.Type = type; CustomInit(); } @@ -55,36 +54,35 @@ public ResourceSkuLocationInfo() /// partial void CustomInit(); + /// /// Gets location of the SKU /// - [JsonProperty(PropertyName = "location")] - public string Location { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; private set; } /// /// Gets list of availability zones where the SKU is supported. /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; private set; } /// /// Gets details of capabilities available to a SKU in specific zones. /// - [JsonProperty(PropertyName = "zoneDetails")] - public IList ZoneDetails { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zoneDetails")] + public System.Collections.Generic.IList ZoneDetails {get; private set; } /// /// Gets the names of extended locations. /// - [JsonProperty(PropertyName = "extendedLocations")] - public IList ExtendedLocations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocations")] + public System.Collections.Generic.IList ExtendedLocations {get; private set; } /// - /// Gets the type of the extended location. Possible values include: - /// 'EdgeZone' + /// Gets the type of the extended location. Possible values include: 'EdgeZone' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuRestrictionInfo.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuRestrictionInfo.cs index a0fc83459405..770bac662189 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuRestrictionInfo.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuRestrictionInfo.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,14 +23,17 @@ public ResourceSkuRestrictionInfo() /// /// Initializes a new instance of the ResourceSkuRestrictionInfo class. /// - /// Locations where the SKU is - /// restricted - /// List of availability zones where the SKU is - /// restricted. - public ResourceSkuRestrictionInfo(IList locations = default(IList), IList zones = default(IList)) + + /// Locations where the SKU is restricted + /// + + /// List of availability zones where the SKU is restricted. + /// + public ResourceSkuRestrictionInfo(System.Collections.Generic.IList locations = default(System.Collections.Generic.IList), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList)) + { - Locations = locations; - Zones = zones; + this.Locations = locations; + this.Zones = zones; CustomInit(); } @@ -47,17 +42,17 @@ public ResourceSkuRestrictionInfo() /// partial void CustomInit(); + /// /// Gets locations where the SKU is restricted /// - [JsonProperty(PropertyName = "locations")] - public IList Locations { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "locations")] + public System.Collections.Generic.IList Locations {get; private set; } /// /// Gets list of availability zones where the SKU is restricted. /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuRestrictions.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuRestrictions.cs index 46a7fb12e40d..d32d3ea39ad8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuRestrictions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuRestrictions.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,21 +23,26 @@ public ResourceSkuRestrictions() /// /// Initializes a new instance of the ResourceSkuRestrictions class. /// - /// The type of restrictions. Possible values - /// include: 'Location', 'Zone' - /// The value of restrictions. If the restriction - /// type is set to location. This would be different locations where - /// the SKU is restricted. - /// The information about the restriction - /// where the SKU cannot be used. - /// The reason for restriction. Possible - /// values include: 'QuotaId', 'NotAvailableForSubscription' - public ResourceSkuRestrictions(ResourceSkuRestrictionsType? type = default(ResourceSkuRestrictionsType?), IList values = default(IList), ResourceSkuRestrictionInfo restrictionInfo = default(ResourceSkuRestrictionInfo), ResourceSkuRestrictionsReasonCode? reasonCode = default(ResourceSkuRestrictionsReasonCode?)) + + /// The type of restrictions. + /// Possible values include: 'Location', 'Zone' + + /// The value of restrictions. If the restriction type is set to location. This + /// would be different locations where the SKU is restricted. + /// + + /// The information about the restriction where the SKU cannot be used. + /// + + /// The reason for restriction. + /// Possible values include: 'QuotaId', 'NotAvailableForSubscription' + public ResourceSkuRestrictions(ResourceSkuRestrictionsType? type = default(ResourceSkuRestrictionsType?), System.Collections.Generic.IList values = default(System.Collections.Generic.IList), ResourceSkuRestrictionInfo restrictionInfo = default(ResourceSkuRestrictionInfo), ResourceSkuRestrictionsReasonCode? reasonCode = default(ResourceSkuRestrictionsReasonCode?)) + { - Type = type; - Values = values; - RestrictionInfo = restrictionInfo; - ReasonCode = reasonCode; + this.Type = type; + this.Values = values; + this.RestrictionInfo = restrictionInfo; + this.ReasonCode = reasonCode; CustomInit(); } @@ -54,34 +51,30 @@ public ResourceSkuRestrictions() /// partial void CustomInit(); + /// - /// Gets the type of restrictions. Possible values include: 'Location', - /// 'Zone' + /// Gets the type of restrictions. Possible values include: 'Location', 'Zone' /// - [JsonProperty(PropertyName = "type")] - public ResourceSkuRestrictionsType? Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public ResourceSkuRestrictionsType? Type {get; private set; } /// - /// Gets the value of restrictions. If the restriction type is set to - /// location. This would be different locations where the SKU is - /// restricted. + /// Gets the value of restrictions. If the restriction type is set to location. + /// This would be different locations where the SKU is restricted. /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "values")] + public System.Collections.Generic.IList Values {get; private set; } /// - /// Gets the information about the restriction where the SKU cannot be - /// used. + /// Gets the information about the restriction where the SKU cannot be used. /// - [JsonProperty(PropertyName = "restrictionInfo")] - public ResourceSkuRestrictionInfo RestrictionInfo { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "restrictionInfo")] + public ResourceSkuRestrictionInfo RestrictionInfo {get; private set; } /// - /// Gets the reason for restriction. Possible values include: - /// 'QuotaId', 'NotAvailableForSubscription' + /// Gets the reason for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription' /// - [JsonProperty(PropertyName = "reasonCode")] - public ResourceSkuRestrictionsReasonCode? ReasonCode { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "reasonCode")] + public ResourceSkuRestrictionsReasonCode? ReasonCode {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuRestrictionsReasonCode.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuRestrictionsReasonCode.cs index 2cf4b4bc828f..63a1aff9d856 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuRestrictionsReasonCode.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuRestrictionsReasonCode.cs @@ -1,29 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for ResourceSkuRestrictionsReasonCode. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum ResourceSkuRestrictionsReasonCode { - [EnumMember(Value = "QuotaId")] + [System.Runtime.Serialization.EnumMember(Value = "QuotaId")] QuotaId, - [EnumMember(Value = "NotAvailableForSubscription")] + [System.Runtime.Serialization.EnumMember(Value = "NotAvailableForSubscription")] NotAvailableForSubscription } internal static class ResourceSkuRestrictionsReasonCodeEnumExtension @@ -32,7 +25,6 @@ internal static string ToSerializedValue(this ResourceSkuRestrictionsReasonCode? { return value == null ? null : ((ResourceSkuRestrictionsReasonCode)value).ToSerializedValue(); } - internal static string ToSerializedValue(this ResourceSkuRestrictionsReasonCode value) { switch( value ) @@ -44,7 +36,6 @@ internal static string ToSerializedValue(this ResourceSkuRestrictionsReasonCode } return null; } - internal static ResourceSkuRestrictionsReasonCode? ParseResourceSkuRestrictionsReasonCode(this string value) { switch( value ) @@ -57,4 +48,4 @@ internal static string ToSerializedValue(this ResourceSkuRestrictionsReasonCode return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuRestrictionsType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuRestrictionsType.cs index 220256fb869d..342baadd1bef 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuRestrictionsType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuRestrictionsType.cs @@ -1,29 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for ResourceSkuRestrictionsType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum ResourceSkuRestrictionsType { - [EnumMember(Value = "Location")] + [System.Runtime.Serialization.EnumMember(Value = "Location")] Location, - [EnumMember(Value = "Zone")] + [System.Runtime.Serialization.EnumMember(Value = "Zone")] Zone } internal static class ResourceSkuRestrictionsTypeEnumExtension @@ -32,7 +25,6 @@ internal static string ToSerializedValue(this ResourceSkuRestrictionsType? value { return value == null ? null : ((ResourceSkuRestrictionsType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this ResourceSkuRestrictionsType value) { switch( value ) @@ -44,7 +36,6 @@ internal static string ToSerializedValue(this ResourceSkuRestrictionsType value) } return null; } - internal static ResourceSkuRestrictionsType? ParseResourceSkuRestrictionsType(this string value) { switch( value ) @@ -57,4 +48,4 @@ internal static string ToSerializedValue(this ResourceSkuRestrictionsType value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuZoneDetails.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuZoneDetails.cs index fa0077964171..84b6f9e31734 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuZoneDetails.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceSkuZoneDetails.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,14 +23,19 @@ public ResourceSkuZoneDetails() /// /// Initializes a new instance of the ResourceSkuZoneDetails class. /// - /// The set of zones that the SKU is available in - /// with the specified capabilities. - /// A list of capabilities that are - /// available for the SKU in the specified list of zones. - public ResourceSkuZoneDetails(IList name = default(IList), IList capabilities = default(IList)) + + /// The set of zones that the SKU is available in with the specified + /// capabilities. + /// + + /// A list of capabilities that are available for the SKU in the specified list + /// of zones. + /// + public ResourceSkuZoneDetails(System.Collections.Generic.IList name = default(System.Collections.Generic.IList), System.Collections.Generic.IList capabilities = default(System.Collections.Generic.IList)) + { - Name = name; - Capabilities = capabilities; + this.Name = name; + this.Capabilities = capabilities; CustomInit(); } @@ -47,19 +44,19 @@ public ResourceSkuZoneDetails() /// partial void CustomInit(); + /// - /// Gets the set of zones that the SKU is available in with the - /// specified capabilities. + /// Gets the set of zones that the SKU is available in with the specified + /// capabilities. /// - [JsonProperty(PropertyName = "name")] - public IList Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public System.Collections.Generic.IList Name {get; private set; } /// - /// Gets a list of capabilities that are available for the SKU in the - /// specified list of zones. + /// Gets a list of capabilities that are available for the SKU in the specified + /// list of zones. /// - [JsonProperty(PropertyName = "capabilities")] - public IList Capabilities { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "capabilities")] + public System.Collections.Generic.IList Capabilities {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceWithOptionalLocation.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceWithOptionalLocation.cs index 7d90f61f8fc2..15bf579ba695 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceWithOptionalLocation.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ResourceWithOptionalLocation.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class ResourceWithOptionalLocation { /// - /// Initializes a new instance of the ResourceWithOptionalLocation - /// class. + /// Initializes a new instance of the ResourceWithOptionalLocation class. /// public ResourceWithOptionalLocation() { @@ -30,21 +21,31 @@ public ResourceWithOptionalLocation() } /// - /// Initializes a new instance of the ResourceWithOptionalLocation - /// class. + /// Initializes a new instance of the ResourceWithOptionalLocation class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - public ResourceWithOptionalLocation(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + + /// Resource location + /// + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource tags + /// + public ResourceWithOptionalLocation(string location = default(string), string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { - Location = location; - Id = id; - Name = name; - Type = type; - Tags = tags; + this.Location = location; + this.Id = id; + this.Name = name; + this.Type = type; + this.Tags = tags; CustomInit(); } @@ -53,35 +54,35 @@ public ResourceWithOptionalLocation() /// partial void CustomInit(); + /// /// Gets or sets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePoint.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePoint.cs index a4fc424acfa5..1667a4eecc87 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePoint.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePoint.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Restore Point details. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class RestorePoint : ProxyResource { /// @@ -34,37 +24,53 @@ public RestorePoint() /// /// Initializes a new instance of the RestorePoint class. /// - /// Resource Id - /// Resource name - /// Resource type - /// List of disk resource ids that the - /// customer wishes to exclude from the restore point. If no disks are - /// specified, all disks will be included. - /// Gets the details of the VM captured at - /// the time of the restore point creation. - /// Gets the provisioning state of the - /// restore point. - /// ConsistencyMode of the RestorePoint. - /// Can be specified in the input while creating a restore point. For - /// now, only CrashConsistent is accepted as a valid input. Please - /// refer to https://aka.ms/RestorePoints for more details. Possible - /// values include: 'CrashConsistent', 'FileSystemConsistent', - /// 'ApplicationConsistent' - /// Gets the creation time of the restore - /// point. - /// Resource Id of the source restore - /// point from which a copy needs to be created. - /// The restore point instance view. - public RestorePoint(string id = default(string), string name = default(string), string type = default(string), IList excludeDisks = default(IList), RestorePointSourceMetadata sourceMetadata = default(RestorePointSourceMetadata), string provisioningState = default(string), string consistencyMode = default(string), System.DateTime? timeCreated = default(System.DateTime?), ApiEntityReference sourceRestorePoint = default(ApiEntityReference), RestorePointInstanceView instanceView = default(RestorePointInstanceView)) - : base(id, name, type) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// List of disk resource ids that the customer wishes to exclude from the + /// restore point. If no disks are specified, all disks will be included. + /// + + /// Gets the details of the VM captured at the time of the restore point + /// creation. + /// + + /// Gets the provisioning state of the restore point. + /// + + /// ConsistencyMode of the RestorePoint. Can be specified in the input while + /// creating a restore point. For now, only CrashConsistent is accepted as a + /// valid input. Please refer to https://aka.ms/RestorePoints for more details. + /// Possible values include: 'CrashConsistent', 'FileSystemConsistent', + /// 'ApplicationConsistent' + + /// Gets the creation time of the restore point. + /// + + /// Resource Id of the source restore point from which a copy needs to be + /// created. + /// + + /// The restore point instance view. + /// + public RestorePoint(string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IList excludeDisks = default(System.Collections.Generic.IList), RestorePointSourceMetadata sourceMetadata = default(RestorePointSourceMetadata), string provisioningState = default(string), string consistencyMode = default(string), System.DateTime? timeCreated = default(System.DateTime?), ApiEntityReference sourceRestorePoint = default(ApiEntityReference), RestorePointInstanceView instanceView = default(RestorePointInstanceView)) + + : base(id, name, type) { - ExcludeDisks = excludeDisks; - SourceMetadata = sourceMetadata; - ProvisioningState = provisioningState; - ConsistencyMode = consistencyMode; - TimeCreated = timeCreated; - SourceRestorePoint = sourceRestorePoint; - InstanceView = instanceView; + this.ExcludeDisks = excludeDisks; + this.SourceMetadata = sourceMetadata; + this.ProvisioningState = provisioningState; + this.ConsistencyMode = consistencyMode; + this.TimeCreated = timeCreated; + this.SourceRestorePoint = sourceRestorePoint; + this.InstanceView = instanceView; CustomInit(); } @@ -73,69 +79,72 @@ public RestorePoint() /// partial void CustomInit(); + /// - /// Gets or sets list of disk resource ids that the customer wishes to - /// exclude from the restore point. If no disks are specified, all - /// disks will be included. + /// Gets or sets list of disk resource ids that the customer wishes to exclude + /// from the restore point. If no disks are specified, all disks will be + /// included. /// - [JsonProperty(PropertyName = "properties.excludeDisks")] - public IList ExcludeDisks { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.excludeDisks")] + public System.Collections.Generic.IList ExcludeDisks {get; set; } /// - /// Gets the details of the VM captured at the time of the restore + /// Gets or sets gets the details of the VM captured at the time of the restore /// point creation. /// - [JsonProperty(PropertyName = "properties.sourceMetadata")] - public RestorePointSourceMetadata SourceMetadata { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourceMetadata")] + public RestorePointSourceMetadata SourceMetadata {get; set; } /// - /// Gets the provisioning state of the restore point. + /// Gets gets the provisioning state of the restore point. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets consistencyMode of the RestorePoint. Can be specified - /// in the input while creating a restore point. For now, only - /// CrashConsistent is accepted as a valid input. Please refer to - /// https://aka.ms/RestorePoints for more details. Possible values - /// include: 'CrashConsistent', 'FileSystemConsistent', - /// 'ApplicationConsistent' + /// Gets or sets consistencyMode of the RestorePoint. Can be specified in the + /// input while creating a restore point. For now, only CrashConsistent is + /// accepted as a valid input. Please refer to https://aka.ms/RestorePoints for + /// more details. Possible values include: 'CrashConsistent', 'FileSystemConsistent', 'ApplicationConsistent' /// - [JsonProperty(PropertyName = "properties.consistencyMode")] - public string ConsistencyMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.consistencyMode")] + public string ConsistencyMode {get; set; } /// - /// Gets the creation time of the restore point. + /// Gets or sets gets the creation time of the restore point. /// - [JsonProperty(PropertyName = "properties.timeCreated")] - public System.DateTime? TimeCreated { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeCreated")] + public System.DateTime? TimeCreated {get; set; } /// - /// Gets or sets resource Id of the source restore point from which a - /// copy needs to be created. + /// Gets or sets resource Id of the source restore point from which a copy + /// needs to be created. /// - [JsonProperty(PropertyName = "properties.sourceRestorePoint")] - public ApiEntityReference SourceRestorePoint { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sourceRestorePoint")] + public ApiEntityReference SourceRestorePoint {get; set; } /// /// Gets the restore point instance view. /// - [JsonProperty(PropertyName = "properties.instanceView")] - public RestorePointInstanceView InstanceView { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.instanceView")] + public RestorePointInstanceView InstanceView {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (SourceMetadata != null) + + if (this.SourceMetadata != null) { - SourceMetadata.Validate(); + this.SourceMetadata.Validate(); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollection.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollection.cs index f3f068f27a68..d4b713173119 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollection.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollection.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Create or update Restore Point collection parameters. /// - [Rest.Serialization.JsonTransformation] - public partial class RestorePointCollection : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class RestorePointCollection : TrackedResource { /// /// Initializes a new instance of the RestorePointCollection class. @@ -34,26 +24,43 @@ public RestorePointCollection() /// /// Initializes a new instance of the RestorePointCollection class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The properties of the source resource that - /// this restore point collection is created from. - /// The provisioning state of the - /// restore point collection. - /// The unique id of the restore - /// point collection. - /// A list containing all restore points - /// created under this restore point collection. - public RestorePointCollection(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), RestorePointCollectionSourceProperties source = default(RestorePointCollectionSourceProperties), string provisioningState = default(string), string restorePointCollectionId = default(string), IList restorePoints = default(IList)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// The properties of the source resource that this restore point collection is + /// created from. + /// + + /// The provisioning state of the restore point collection. + /// + + /// The unique id of the restore point collection. + /// + + /// A list containing all restore points created under this restore point + /// collection. + /// + public RestorePointCollection(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), RestorePointCollectionSourceProperties source = default(RestorePointCollectionSourceProperties), string provisioningState = default(string), string restorePointCollectionId = default(string), System.Collections.Generic.IList restorePoints = default(System.Collections.Generic.IList)) + + : base(location, id, name, type, tags) { - Source = source; - ProvisioningState = provisioningState; - RestorePointCollectionId = restorePointCollectionId; - RestorePoints = restorePoints; + this.Source = source; + this.ProvisioningState = provisioningState; + this.RestorePointCollectionId = restorePointCollectionId; + this.RestorePoints = restorePoints; CustomInit(); } @@ -62,44 +69,47 @@ public RestorePointCollection() /// partial void CustomInit(); + /// - /// Gets or sets the properties of the source resource that this - /// restore point collection is created from. + /// Gets or sets the properties of the source resource that this restore point + /// collection is created from. /// - [JsonProperty(PropertyName = "properties.source")] - public RestorePointCollectionSourceProperties Source { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.source")] + public RestorePointCollectionSourceProperties Source {get; set; } /// /// Gets the provisioning state of the restore point collection. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Gets the unique id of the restore point collection. /// - [JsonProperty(PropertyName = "properties.restorePointCollectionId")] - public string RestorePointCollectionId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.restorePointCollectionId")] + public string RestorePointCollectionId {get; private set; } /// - /// Gets a list containing all restore points created under this - /// restore point collection. + /// Gets a list containing all restore points created under this restore point + /// collection. /// - [JsonProperty(PropertyName = "properties.restorePoints")] - public IList RestorePoints { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.restorePoints")] + public System.Collections.Generic.IList RestorePoints {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (RestorePoints != null) + + + + if (this.RestorePoints != null) { - foreach (var element in RestorePoints) + foreach (var element in this.RestorePoints) { if (element != null) { @@ -109,4 +119,4 @@ public override void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollectionExpandOptions.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollectionExpandOptions.cs index aa68d83154f1..49bf0390c836 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollectionExpandOptions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollectionExpandOptions.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for RestorePointCollectionExpandOptions. /// + + public static class RestorePointCollectionExpandOptions { public const string RestorePoints = "restorePoints"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollectionProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollectionProperties.cs new file mode 100644 index 000000000000..96722f7d79ee --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollectionProperties.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// The restore point collection properties. + /// + public partial class RestorePointCollectionProperties + { + /// + /// Initializes a new instance of the RestorePointCollectionProperties class. + /// + public RestorePointCollectionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RestorePointCollectionProperties class. + /// + + /// The properties of the source resource that this restore point collection is + /// created from. + /// + + /// The provisioning state of the restore point collection. + /// + + /// The unique id of the restore point collection. + /// + + /// A list containing all restore points created under this restore point + /// collection. + /// + public RestorePointCollectionProperties(RestorePointCollectionSourceProperties source = default(RestorePointCollectionSourceProperties), string provisioningState = default(string), string restorePointCollectionId = default(string), System.Collections.Generic.IList restorePoints = default(System.Collections.Generic.IList)) + + { + this.Source = source; + this.ProvisioningState = provisioningState; + this.RestorePointCollectionId = restorePointCollectionId; + this.RestorePoints = restorePoints; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the properties of the source resource that this restore point + /// collection is created from. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "source")] + public RestorePointCollectionSourceProperties Source {get; set; } + + /// + /// Gets the provisioning state of the restore point collection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the unique id of the restore point collection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "restorePointCollectionId")] + public string RestorePointCollectionId {get; private set; } + + /// + /// Gets a list containing all restore points created under this restore point + /// collection. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "restorePoints")] + public System.Collections.Generic.IList RestorePoints {get; private set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollectionSourceProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollectionSourceProperties.cs index 5d860ae3909e..6270aeeed8a5 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollectionSourceProperties.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollectionSourceProperties.cs @@ -1,27 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// The properties of the source resource that this restore point - /// collection is created from. + /// The properties of the source resource that this restore point collection is + /// created from. /// public partial class RestorePointCollectionSourceProperties { /// - /// Initializes a new instance of the - /// RestorePointCollectionSourceProperties class. + /// Initializes a new instance of the RestorePointCollectionSourceProperties class. /// public RestorePointCollectionSourceProperties() { @@ -29,17 +22,21 @@ public RestorePointCollectionSourceProperties() } /// - /// Initializes a new instance of the - /// RestorePointCollectionSourceProperties class. + /// Initializes a new instance of the RestorePointCollectionSourceProperties class. /// - /// Location of the source resource used to - /// create this restore point collection. - /// Resource Id of the source resource used to create - /// this restore point collection + + /// Location of the source resource used to create this restore point + /// collection. + /// + + /// Resource Id of the source resource used to create this restore point + /// collection + /// public RestorePointCollectionSourceProperties(string location = default(string), string id = default(string)) + { - Location = location; - Id = id; + this.Location = location; + this.Id = id; CustomInit(); } @@ -48,19 +45,19 @@ public RestorePointCollectionSourceProperties() /// partial void CustomInit(); + /// - /// Gets location of the source resource used to create this restore - /// point collection. + /// Gets location of the source resource used to create this restore point + /// collection. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; private set; } /// - /// Gets or sets resource Id of the source resource used to create this - /// restore point collection + /// Gets or sets resource Id of the source resource used to create this restore + /// point collection /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollectionUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollectionUpdate.cs index 127fac81e68c..29a4bb24092f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollectionUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointCollectionUpdate.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Update Restore Point collection parameters. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class RestorePointCollectionUpdate : UpdateResource { /// - /// Initializes a new instance of the RestorePointCollectionUpdate - /// class. + /// Initializes a new instance of the RestorePointCollectionUpdate class. /// public RestorePointCollectionUpdate() { @@ -33,25 +22,33 @@ public RestorePointCollectionUpdate() } /// - /// Initializes a new instance of the RestorePointCollectionUpdate - /// class. + /// Initializes a new instance of the RestorePointCollectionUpdate class. /// - /// Resource tags - /// The properties of the source resource that - /// this restore point collection is created from. - /// The provisioning state of the - /// restore point collection. - /// The unique id of the restore - /// point collection. - /// A list containing all restore points - /// created under this restore point collection. - public RestorePointCollectionUpdate(IDictionary tags = default(IDictionary), RestorePointCollectionSourceProperties source = default(RestorePointCollectionSourceProperties), string provisioningState = default(string), string restorePointCollectionId = default(string), IList restorePoints = default(IList)) - : base(tags) + + /// Resource tags + /// + + /// The properties of the source resource that this restore point collection is + /// created from. + /// + + /// The provisioning state of the restore point collection. + /// + + /// The unique id of the restore point collection. + /// + + /// A list containing all restore points created under this restore point + /// collection. + /// + public RestorePointCollectionUpdate(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), RestorePointCollectionSourceProperties source = default(RestorePointCollectionSourceProperties), string provisioningState = default(string), string restorePointCollectionId = default(string), System.Collections.Generic.IList restorePoints = default(System.Collections.Generic.IList)) + + : base(tags) { - Source = source; - ProvisioningState = provisioningState; - RestorePointCollectionId = restorePointCollectionId; - RestorePoints = restorePoints; + this.Source = source; + this.ProvisioningState = provisioningState; + this.RestorePointCollectionId = restorePointCollectionId; + this.RestorePoints = restorePoints; CustomInit(); } @@ -60,31 +57,31 @@ public RestorePointCollectionUpdate() /// partial void CustomInit(); + /// - /// Gets or sets the properties of the source resource that this - /// restore point collection is created from. + /// Gets or sets the properties of the source resource that this restore point + /// collection is created from. /// - [JsonProperty(PropertyName = "properties.source")] - public RestorePointCollectionSourceProperties Source { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.source")] + public RestorePointCollectionSourceProperties Source {get; set; } /// /// Gets the provisioning state of the restore point collection. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Gets the unique id of the restore point collection. /// - [JsonProperty(PropertyName = "properties.restorePointCollectionId")] - public string RestorePointCollectionId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.restorePointCollectionId")] + public string RestorePointCollectionId {get; private set; } /// - /// Gets a list containing all restore points created under this - /// restore point collection. + /// Gets a list containing all restore points created under this restore point + /// collection. /// - [JsonProperty(PropertyName = "properties.restorePoints")] - public IList RestorePoints { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.restorePoints")] + public System.Collections.Generic.IList RestorePoints {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointEncryption.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointEncryption.cs index 3ee46e1af262..e6b6fcf7968e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointEncryption.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointEncryption.cs @@ -1,22 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// /// Encryption at rest settings for disk restore point. It is an optional - /// property that can be specified in the input while creating a restore - /// point. + /// property that can be specified in the input while creating a restore point. /// public partial class RestorePointEncryption { @@ -31,20 +24,22 @@ public RestorePointEncryption() /// /// Initializes a new instance of the RestorePointEncryption class. /// - /// Describes the parameter of customer - /// managed disk encryption set resource id that can be specified for - /// disk. **Note:** The disk encryption set resource id can only be - /// specified for managed disk. Please refer - /// https://aka.ms/mdssewithcmkoverview for more details. - /// The type of key used to encrypt the data of the - /// disk restore point. Possible values include: - /// 'EncryptionAtRestWithPlatformKey', - /// 'EncryptionAtRestWithCustomerKey', - /// 'EncryptionAtRestWithPlatformAndCustomerKeys' + + /// Describes the parameter of customer managed disk encryption set resource id + /// that can be specified for disk. **Note:** The disk encryption set resource + /// id can only be specified for managed disk. Please refer + /// https://aka.ms/mdssewithcmkoverview for more details. + /// + + /// The type of key used to encrypt the data of the disk restore point. + /// Possible values include: 'EncryptionAtRestWithPlatformKey', + /// 'EncryptionAtRestWithCustomerKey', + /// 'EncryptionAtRestWithPlatformAndCustomerKeys' public RestorePointEncryption(DiskEncryptionSetParameters diskEncryptionSet = default(DiskEncryptionSetParameters), string type = default(string)) + { - DiskEncryptionSet = diskEncryptionSet; - Type = type; + this.DiskEncryptionSet = diskEncryptionSet; + this.Type = type; CustomInit(); } @@ -53,25 +48,21 @@ public RestorePointEncryption() /// partial void CustomInit(); + /// - /// Gets or sets describes the parameter of customer managed disk - /// encryption set resource id that can be specified for disk. - /// **Note:** The disk encryption set resource id can only be specified - /// for managed disk. Please refer https://aka.ms/mdssewithcmkoverview - /// for more details. + /// Gets or sets describes the parameter of customer managed disk encryption + /// set resource id that can be specified for disk. **Note:** The disk + /// encryption set resource id can only be specified for managed disk. Please + /// refer https://aka.ms/mdssewithcmkoverview for more details. /// - [JsonProperty(PropertyName = "diskEncryptionSet")] - public DiskEncryptionSetParameters DiskEncryptionSet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskEncryptionSet")] + public DiskEncryptionSetParameters DiskEncryptionSet {get; set; } /// - /// Gets or sets the type of key used to encrypt the data of the disk - /// restore point. Possible values include: - /// 'EncryptionAtRestWithPlatformKey', - /// 'EncryptionAtRestWithCustomerKey', - /// 'EncryptionAtRestWithPlatformAndCustomerKeys' + /// Gets or sets the type of key used to encrypt the data of the disk restore + /// point. Possible values include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey', 'EncryptionAtRestWithPlatformAndCustomerKeys' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointEncryptionType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointEncryptionType.cs index 13ed761303b9..5d8b84e9ce15 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointEncryptionType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointEncryptionType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for RestorePointEncryptionType. /// + + public static class RestorePointEncryptionType { /// @@ -21,15 +18,14 @@ public static class RestorePointEncryptionType /// public const string EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey"; /// - /// Disk Restore Point is encrypted at rest with Customer managed key - /// that can be changed and revoked by a customer. + /// Disk Restore Point is encrypted at rest with Customer managed key that can + /// be changed and revoked by a customer. /// public const string EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey"; /// - /// Disk Restore Point is encrypted at rest with 2 layers of - /// encryption. One of the keys is Customer managed and the other key - /// is Platform managed. + /// Disk Restore Point is encrypted at rest with 2 layers of encryption. One of + /// the keys is Customer managed and the other key is Platform managed. /// public const string EncryptionAtRestWithPlatformAndCustomerKeys = "EncryptionAtRestWithPlatformAndCustomerKeys"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointExpandOptions.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointExpandOptions.cs index 8c9c16f10b61..4d0ab402caac 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointExpandOptions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointExpandOptions.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for RestorePointExpandOptions. /// + + public static class RestorePointExpandOptions { public const string InstanceView = "instanceView"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointInstanceView.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointInstanceView.cs index 9e1bfde85d71..61ff83fe620a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointInstanceView.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointInstanceView.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,13 +23,17 @@ public RestorePointInstanceView() /// /// Initializes a new instance of the RestorePointInstanceView class. /// - /// The disk restore points - /// information. - /// The resource status information. - public RestorePointInstanceView(IList diskRestorePoints = default(IList), IList statuses = default(IList)) + + /// The disk restore points information. + /// + + /// The resource status information. + /// + public RestorePointInstanceView(System.Collections.Generic.IList diskRestorePoints = default(System.Collections.Generic.IList), System.Collections.Generic.IList statuses = default(System.Collections.Generic.IList)) + { - DiskRestorePoints = diskRestorePoints; - Statuses = statuses; + this.DiskRestorePoints = diskRestorePoints; + this.Statuses = statuses; CustomInit(); } @@ -46,17 +42,17 @@ public RestorePointInstanceView() /// partial void CustomInit(); + /// /// Gets or sets the disk restore points information. /// - [JsonProperty(PropertyName = "diskRestorePoints")] - public IList DiskRestorePoints { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskRestorePoints")] + public System.Collections.Generic.IList DiskRestorePoints {get; set; } /// /// Gets or sets the resource status information. /// - [JsonProperty(PropertyName = "statuses")] - public IList Statuses { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "statuses")] + public System.Collections.Generic.IList Statuses {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointProperties.cs new file mode 100644 index 000000000000..c1ac66d7a882 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointProperties.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// The restore point properties. + /// + public partial class RestorePointProperties + { + /// + /// Initializes a new instance of the RestorePointProperties class. + /// + public RestorePointProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RestorePointProperties class. + /// + + /// List of disk resource ids that the customer wishes to exclude from the + /// restore point. If no disks are specified, all disks will be included. + /// + + /// Gets the details of the VM captured at the time of the restore point + /// creation. + /// + + /// Gets the provisioning state of the restore point. + /// + + /// ConsistencyMode of the RestorePoint. Can be specified in the input while + /// creating a restore point. For now, only CrashConsistent is accepted as a + /// valid input. Please refer to https://aka.ms/RestorePoints for more details. + /// Possible values include: 'CrashConsistent', 'FileSystemConsistent', + /// 'ApplicationConsistent' + + /// Gets the creation time of the restore point. + /// + + /// Resource Id of the source restore point from which a copy needs to be + /// created. + /// + + /// The restore point instance view. + /// + public RestorePointProperties(System.Collections.Generic.IList excludeDisks = default(System.Collections.Generic.IList), RestorePointSourceMetadata sourceMetadata = default(RestorePointSourceMetadata), string provisioningState = default(string), string consistencyMode = default(string), System.DateTime? timeCreated = default(System.DateTime?), ApiEntityReference sourceRestorePoint = default(ApiEntityReference), RestorePointInstanceView instanceView = default(RestorePointInstanceView)) + + { + this.ExcludeDisks = excludeDisks; + this.SourceMetadata = sourceMetadata; + this.ProvisioningState = provisioningState; + this.ConsistencyMode = consistencyMode; + this.TimeCreated = timeCreated; + this.SourceRestorePoint = sourceRestorePoint; + this.InstanceView = instanceView; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets list of disk resource ids that the customer wishes to exclude + /// from the restore point. If no disks are specified, all disks will be + /// included. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "excludeDisks")] + public System.Collections.Generic.IList ExcludeDisks {get; set; } + + /// + /// Gets or sets gets the details of the VM captured at the time of the restore + /// point creation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceMetadata")] + public RestorePointSourceMetadata SourceMetadata {get; set; } + + /// + /// Gets gets the provisioning state of the restore point. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets consistencyMode of the RestorePoint. Can be specified in the + /// input while creating a restore point. For now, only CrashConsistent is + /// accepted as a valid input. Please refer to https://aka.ms/RestorePoints for + /// more details. Possible values include: 'CrashConsistent', 'FileSystemConsistent', 'ApplicationConsistent' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "consistencyMode")] + public string ConsistencyMode {get; set; } + + /// + /// Gets or sets gets the creation time of the restore point. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeCreated")] + public System.DateTime? TimeCreated {get; set; } + + /// + /// Gets or sets resource Id of the source restore point from which a copy + /// needs to be created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceRestorePoint")] + public ApiEntityReference SourceRestorePoint {get; set; } + + /// + /// Gets the restore point instance view. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "instanceView")] + public RestorePointInstanceView InstanceView {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + if (this.SourceMetadata != null) + { + this.SourceMetadata.Validate(); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointSourceMetadata.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointSourceMetadata.cs index 66ed71d72f80..3028d8081830 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointSourceMetadata.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointSourceMetadata.cs @@ -1,23 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Describes the properties of the Virtual Machine for which the restore - /// point was created. The properties provided are a subset and the - /// snapshot of the overall Virtual Machine properties captured at the time - /// of the restore point creation. + /// Describes the properties of the Virtual Machine for which the restore point + /// was created. The properties provided are a subset and the snapshot of the + /// overall Virtual Machine properties captured at the time of the restore + /// point creation. /// public partial class RestorePointSourceMetadata { @@ -32,35 +26,50 @@ public RestorePointSourceMetadata() /// /// Initializes a new instance of the RestorePointSourceMetadata class. /// - /// Gets the hardware profile. - /// Gets the storage profile. - /// Gets the OS profile. - /// Gets the diagnostics - /// profile. - /// Gets the license type, which is for bring - /// your own license scenario. - /// Gets the virtual machine unique id. - /// Gets the security profile. - /// Location of the VM from which the restore - /// point was created. - /// UserData associated with the source VM for - /// which restore point is captured, which is a base-64 encoded - /// value. - /// HyperVGeneration of the source VM - /// for which restore point is captured. Possible values include: 'V1', - /// 'V2' + + /// Gets the hardware profile. + /// + + /// Gets the storage profile. + /// + + /// Gets the OS profile. + /// + + /// Gets the diagnostics profile. + /// + + /// Gets the license type, which is for bring your own license scenario. + /// + + /// Gets the virtual machine unique id. + /// + + /// Gets the security profile. + /// + + /// Location of the VM from which the restore point was created. + /// + + /// UserData associated with the source VM for which restore point is captured, + /// which is a base-64 encoded value. + /// + + /// HyperVGeneration of the source VM for which restore point is captured. + /// Possible values include: 'V1', 'V2' public RestorePointSourceMetadata(HardwareProfile hardwareProfile = default(HardwareProfile), RestorePointSourceVMStorageProfile storageProfile = default(RestorePointSourceVMStorageProfile), OSProfile osProfile = default(OSProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), string licenseType = default(string), string vmId = default(string), SecurityProfile securityProfile = default(SecurityProfile), string location = default(string), string userData = default(string), string hyperVGeneration = default(string)) + { - HardwareProfile = hardwareProfile; - StorageProfile = storageProfile; - OsProfile = osProfile; - DiagnosticsProfile = diagnosticsProfile; - LicenseType = licenseType; - VmId = vmId; - SecurityProfile = securityProfile; - Location = location; - UserData = userData; - HyperVGeneration = hyperVGeneration; + this.HardwareProfile = hardwareProfile; + this.StorageProfile = storageProfile; + this.OsProfile = osProfile; + this.DiagnosticsProfile = diagnosticsProfile; + this.LicenseType = licenseType; + this.VmId = vmId; + this.SecurityProfile = securityProfile; + this.Location = location; + this.UserData = userData; + this.HyperVGeneration = hyperVGeneration; CustomInit(); } @@ -69,81 +78,88 @@ public RestorePointSourceMetadata() /// partial void CustomInit(); + /// - /// Gets the hardware profile. + /// Gets gets the hardware profile. /// - [JsonProperty(PropertyName = "hardwareProfile")] - public HardwareProfile HardwareProfile { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "hardwareProfile")] + public HardwareProfile HardwareProfile {get; private set; } /// - /// Gets the storage profile. + /// Gets or sets gets the storage profile. /// - [JsonProperty(PropertyName = "storageProfile")] - public RestorePointSourceVMStorageProfile StorageProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "storageProfile")] + public RestorePointSourceVMStorageProfile StorageProfile {get; set; } /// - /// Gets the OS profile. + /// Gets gets the OS profile. /// - [JsonProperty(PropertyName = "osProfile")] - public OSProfile OsProfile { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osProfile")] + public OSProfile OsProfile {get; private set; } /// - /// Gets the diagnostics profile. + /// Gets gets the diagnostics profile. /// - [JsonProperty(PropertyName = "diagnosticsProfile")] - public DiagnosticsProfile DiagnosticsProfile { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diagnosticsProfile")] + public DiagnosticsProfile DiagnosticsProfile {get; private set; } /// - /// Gets the license type, which is for bring your own license - /// scenario. + /// Gets gets the license type, which is for bring your own license scenario. /// - [JsonProperty(PropertyName = "licenseType")] - public string LicenseType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "licenseType")] + public string LicenseType {get; private set; } /// - /// Gets the virtual machine unique id. + /// Gets gets the virtual machine unique id. /// - [JsonProperty(PropertyName = "vmId")] - public string VmId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vmId")] + public string VmId {get; private set; } /// - /// Gets the security profile. + /// Gets gets the security profile. /// - [JsonProperty(PropertyName = "securityProfile")] - public SecurityProfile SecurityProfile { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "securityProfile")] + public SecurityProfile SecurityProfile {get; private set; } /// /// Gets location of the VM from which the restore point was created. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; private set; } /// - /// Gets userData associated with the source VM for which restore point - /// is captured, which is a base-64 encoded value. + /// Gets userData associated with the source VM for which restore point is + /// captured, which is a base-64 encoded value. /// - [JsonProperty(PropertyName = "userData")] - public string UserData { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "userData")] + public string UserData {get; private set; } /// - /// Gets hyperVGeneration of the source VM for which restore point is - /// captured. Possible values include: 'V1', 'V2' + /// Gets hyperVGeneration of the source VM for which restore point is captured. Possible values include: 'V1', 'V2' /// - [JsonProperty(PropertyName = "hyperVGeneration")] - public string HyperVGeneration { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "hyperVGeneration")] + public string HyperVGeneration {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (StorageProfile != null) + + if (this.StorageProfile != null) { - StorageProfile.Validate(); + this.StorageProfile.Validate(); } + + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointSourceVMDataDisk.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointSourceVMDataDisk.cs index b2f21608e2bc..066ae66ef040 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointSourceVMDataDisk.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointSourceVMDataDisk.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class RestorePointSourceVMDataDisk { /// - /// Initializes a new instance of the RestorePointSourceVMDataDisk - /// class. + /// Initializes a new instance of the RestorePointSourceVMDataDisk class. /// public RestorePointSourceVMDataDisk() { @@ -28,31 +21,40 @@ public RestorePointSourceVMDataDisk() } /// - /// Initializes a new instance of the RestorePointSourceVMDataDisk - /// class. + /// Initializes a new instance of the RestorePointSourceVMDataDisk class. /// - /// Gets the logical unit number. - /// Gets the disk name. - /// Gets the caching type. Possible values - /// include: 'None', 'ReadOnly', 'ReadWrite' - /// Gets the initial disk size in GB for blank - /// data disks, and the new desired size for existing OS and Data - /// disks. - /// Contains the managed disk - /// details. - /// Contains Disk Restore Point - /// properties. - /// Shows true if the disk is - /// write-accelerator enabled. - public RestorePointSourceVMDataDisk(int? lun = default(int?), string name = default(string), CachingTypes? caching = default(CachingTypes?), int? diskSizeGB = default(int?), ManagedDiskParameters managedDisk = default(ManagedDiskParameters), DiskRestorePointAttributes diskRestorePoint = default(DiskRestorePointAttributes), bool? writeAcceleratorEnabled = default(bool?)) + + /// Gets the logical unit number. + /// + + /// Gets the disk name. + /// + + /// Gets the caching type. + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + + /// Gets the initial disk size in GB for blank data disks, and the new desired + /// size for existing OS and Data disks. + /// + + /// Contains the managed disk details. + /// + + /// Contains Disk Restore Point properties. + /// + + /// Shows true if the disk is write-accelerator enabled. + /// + public RestorePointSourceVMDataDisk(int? lun = default(int?), string name = default(string), CachingTypes? caching = default(CachingTypes?), int? diskSizeGb = default(int?), ManagedDiskParameters managedDisk = default(ManagedDiskParameters), DiskRestorePointAttributes diskRestorePoint = default(DiskRestorePointAttributes), bool? writeAcceleratorEnabled = default(bool?)) + { - Lun = lun; - Name = name; - Caching = caching; - DiskSizeGB = diskSizeGB; - ManagedDisk = managedDisk; - DiskRestorePoint = diskRestorePoint; - WriteAcceleratorEnabled = writeAcceleratorEnabled; + this.Lun = lun; + this.Name = name; + this.Caching = caching; + this.DiskSizeGB = diskSizeGb; + this.ManagedDisk = managedDisk; + this.DiskRestorePoint = diskRestorePoint; + this.WriteAcceleratorEnabled = writeAcceleratorEnabled; CustomInit(); } @@ -61,49 +63,48 @@ public RestorePointSourceVMDataDisk() /// partial void CustomInit(); + /// - /// Gets the logical unit number. + /// Gets gets the logical unit number. /// - [JsonProperty(PropertyName = "lun")] - public int? Lun { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lun")] + public int? Lun {get; private set; } /// - /// Gets the disk name. + /// Gets gets the disk name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// - /// Gets the caching type. Possible values include: 'None', 'ReadOnly', - /// 'ReadWrite' + /// Gets gets the caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' /// - [JsonProperty(PropertyName = "caching")] - public CachingTypes? Caching { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "caching")] + public CachingTypes? Caching {get; private set; } /// - /// Gets the initial disk size in GB for blank data disks, and the new + /// Gets gets the initial disk size in GB for blank data disks, and the new /// desired size for existing OS and Data disks. /// - [JsonProperty(PropertyName = "diskSizeGB")] - public int? DiskSizeGB { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeGB")] + public int? DiskSizeGB {get; private set; } /// /// Gets or sets contains the managed disk details. /// - [JsonProperty(PropertyName = "managedDisk")] - public ManagedDiskParameters ManagedDisk { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managedDisk")] + public ManagedDiskParameters ManagedDisk {get; set; } /// /// Gets or sets contains Disk Restore Point properties. /// - [JsonProperty(PropertyName = "diskRestorePoint")] - public DiskRestorePointAttributes DiskRestorePoint { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskRestorePoint")] + public DiskRestorePointAttributes DiskRestorePoint {get; set; } /// /// Gets shows true if the disk is write-accelerator enabled. /// - [JsonProperty(PropertyName = "writeAcceleratorEnabled")] - public bool? WriteAcceleratorEnabled { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "writeAcceleratorEnabled")] + public bool? WriteAcceleratorEnabled {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointSourceVMOSDisk.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointSourceVMOSDisk.cs index b14482fec10f..c842524c9a40 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointSourceVMOSDisk.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointSourceVMOSDisk.cs @@ -1,57 +1,63 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// /// Describes an Operating System disk. /// - public partial class RestorePointSourceVMOSDisk + public partial class RestorePointSourceVmosDisk { /// - /// Initializes a new instance of the RestorePointSourceVMOSDisk class. + /// Initializes a new instance of the RestorePointSourceVmosDisk class. /// - public RestorePointSourceVMOSDisk() + public RestorePointSourceVmosDisk() { CustomInit(); } /// - /// Initializes a new instance of the RestorePointSourceVMOSDisk class. + /// Initializes a new instance of the RestorePointSourceVmosDisk class. /// - /// Gets the Operating System type. Possible - /// values include: 'Windows', 'Linux' - /// Gets the disk encryption - /// settings. - /// Gets the disk name. - /// Gets the caching type. Possible values - /// include: 'None', 'ReadOnly', 'ReadWrite' - /// Gets the disk size in GB. - /// Gets the managed disk details - /// Contains Disk Restore Point - /// properties. - /// Shows true if the disk is - /// write-accelerator enabled. - public RestorePointSourceVMOSDisk(string osType = default(string), DiskEncryptionSettings encryptionSettings = default(DiskEncryptionSettings), string name = default(string), CachingTypes? caching = default(CachingTypes?), int? diskSizeGB = default(int?), ManagedDiskParameters managedDisk = default(ManagedDiskParameters), DiskRestorePointAttributes diskRestorePoint = default(DiskRestorePointAttributes), bool? writeAcceleratorEnabled = default(bool?)) + + /// Gets the Operating System type. + /// Possible values include: 'Windows', 'Linux' + + /// Gets the disk encryption settings. + /// + + /// Gets the disk name. + /// + + /// Gets the caching type. + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + + /// Gets the disk size in GB. + /// + + /// Gets the managed disk details + /// + + /// Contains Disk Restore Point properties. + /// + + /// Shows true if the disk is write-accelerator enabled. + /// + public RestorePointSourceVmosDisk(string osType = default(string), DiskEncryptionSettings encryptionSettings = default(DiskEncryptionSettings), string name = default(string), CachingTypes? caching = default(CachingTypes?), int? diskSizeGb = default(int?), ManagedDiskParameters managedDisk = default(ManagedDiskParameters), DiskRestorePointAttributes diskRestorePoint = default(DiskRestorePointAttributes), bool? writeAcceleratorEnabled = default(bool?)) + { - OsType = osType; - EncryptionSettings = encryptionSettings; - Name = name; - Caching = caching; - DiskSizeGB = diskSizeGB; - ManagedDisk = managedDisk; - DiskRestorePoint = diskRestorePoint; - WriteAcceleratorEnabled = writeAcceleratorEnabled; + this.OsType = osType; + this.EncryptionSettings = encryptionSettings; + this.Name = name; + this.Caching = caching; + this.DiskSizeGB = diskSizeGb; + this.ManagedDisk = managedDisk; + this.DiskRestorePoint = diskRestorePoint; + this.WriteAcceleratorEnabled = writeAcceleratorEnabled; CustomInit(); } @@ -60,68 +66,71 @@ public RestorePointSourceVMOSDisk() /// partial void CustomInit(); + /// - /// Gets the Operating System type. Possible values include: 'Windows', - /// 'Linux' + /// Gets gets the Operating System type. Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "osType")] - public string OsType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public string OsType {get; private set; } /// - /// Gets the disk encryption settings. + /// Gets gets the disk encryption settings. /// - [JsonProperty(PropertyName = "encryptionSettings")] - public DiskEncryptionSettings EncryptionSettings { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptionSettings")] + public DiskEncryptionSettings EncryptionSettings {get; private set; } /// - /// Gets the disk name. + /// Gets gets the disk name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// - /// Gets the caching type. Possible values include: 'None', 'ReadOnly', - /// 'ReadWrite' + /// Gets gets the caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' /// - [JsonProperty(PropertyName = "caching")] - public CachingTypes? Caching { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "caching")] + public CachingTypes? Caching {get; private set; } /// - /// Gets the disk size in GB. + /// Gets gets the disk size in GB. /// - [JsonProperty(PropertyName = "diskSizeGB")] - public int? DiskSizeGB { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeGB")] + public int? DiskSizeGB {get; private set; } /// - /// Gets the managed disk details + /// Gets or sets gets the managed disk details /// - [JsonProperty(PropertyName = "managedDisk")] - public ManagedDiskParameters ManagedDisk { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managedDisk")] + public ManagedDiskParameters ManagedDisk {get; set; } /// /// Gets or sets contains Disk Restore Point properties. /// - [JsonProperty(PropertyName = "diskRestorePoint")] - public DiskRestorePointAttributes DiskRestorePoint { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskRestorePoint")] + public DiskRestorePointAttributes DiskRestorePoint {get; set; } /// /// Gets shows true if the disk is write-accelerator enabled. /// - [JsonProperty(PropertyName = "writeAcceleratorEnabled")] - public bool? WriteAcceleratorEnabled { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "writeAcceleratorEnabled")] + public bool? WriteAcceleratorEnabled {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (EncryptionSettings != null) + + if (this.EncryptionSettings != null) { - EncryptionSettings.Validate(); + this.EncryptionSettings.Validate(); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointSourceVMStorageProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointSourceVMStorageProfile.cs index 2bdb4abfd685..d84eb0008484 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointSourceVMStorageProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointSourceVMStorageProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class RestorePointSourceVMStorageProfile { /// - /// Initializes a new instance of the - /// RestorePointSourceVMStorageProfile class. + /// Initializes a new instance of the RestorePointSourceVMStorageProfile class. /// public RestorePointSourceVMStorageProfile() { @@ -30,21 +21,26 @@ public RestorePointSourceVMStorageProfile() } /// - /// Initializes a new instance of the - /// RestorePointSourceVMStorageProfile class. + /// Initializes a new instance of the RestorePointSourceVMStorageProfile class. /// - /// Gets the OS disk of the VM captured at the - /// time of the restore point creation. - /// Gets the data disks of the VM captured at - /// the time of the restore point creation. - /// Gets the disk controller type of - /// the VM captured at the time of the restore point creation. Possible - /// values include: 'SCSI', 'NVMe' - public RestorePointSourceVMStorageProfile(RestorePointSourceVMOSDisk osDisk = default(RestorePointSourceVMOSDisk), IList dataDisks = default(IList), string diskControllerType = default(string)) + + /// Gets the OS disk of the VM captured at the time of the restore point + /// creation. + /// + + /// Gets the data disks of the VM captured at the time of the restore point + /// creation. + /// + + /// Gets the disk controller type of the VM captured at the time of the restore + /// point creation. + /// Possible values include: 'SCSI', 'NVMe' + public RestorePointSourceVMStorageProfile(RestorePointSourceVmosDisk osDisk = default(RestorePointSourceVmosDisk), System.Collections.Generic.IList dataDisks = default(System.Collections.Generic.IList), string diskControllerType = default(string)) + { - OsDisk = osDisk; - DataDisks = dataDisks; - DiskControllerType = diskControllerType; + this.OsDisk = osDisk; + this.DataDisks = dataDisks; + this.DiskControllerType = diskControllerType; CustomInit(); } @@ -53,39 +49,41 @@ public RestorePointSourceVMStorageProfile() /// partial void CustomInit(); + /// - /// Gets the OS disk of the VM captured at the time of the restore + /// Gets or sets gets the OS disk of the VM captured at the time of the restore /// point creation. /// - [JsonProperty(PropertyName = "osDisk")] - public RestorePointSourceVMOSDisk OsDisk { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osDisk")] + public RestorePointSourceVmosDisk OsDisk {get; set; } /// - /// Gets the data disks of the VM captured at the time of the restore - /// point creation. + /// Gets or sets gets the data disks of the VM captured at the time of the + /// restore point creation. /// - [JsonProperty(PropertyName = "dataDisks")] - public IList DataDisks { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDisks")] + public System.Collections.Generic.IList DataDisks {get; set; } /// - /// Gets the disk controller type of the VM captured at the time of the - /// restore point creation. Possible values include: 'SCSI', 'NVMe' + /// Gets gets the disk controller type of the VM captured at the time of the + /// restore point creation. Possible values include: 'SCSI', 'NVMe' /// - [JsonProperty(PropertyName = "diskControllerType")] - public string DiskControllerType { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "diskControllerType")] + public string DiskControllerType {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (OsDisk != null) + if (this.OsDisk != null) { - OsDisk.Validate(); + this.OsDisk.Validate(); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointsCreateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointsCreateHeaders.cs index 447e9bc768a4..73a17c8bf16f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointsCreateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RestorePointsCreateHeaders.cs @@ -1,21 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Create operation. - /// public partial class RestorePointsCreateHeaders { /// @@ -29,15 +20,17 @@ public RestorePointsCreateHeaders() /// /// Initializes a new instance of the RestorePointsCreateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public RestorePointsCreateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -46,19 +39,17 @@ public RestorePointsCreateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RetrieveBootDiagnosticsDataResult.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RetrieveBootDiagnosticsDataResult.cs index 2aa19f2cb654..4b01b1369edc 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RetrieveBootDiagnosticsDataResult.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RetrieveBootDiagnosticsDataResult.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class RetrieveBootDiagnosticsDataResult { /// - /// Initializes a new instance of the RetrieveBootDiagnosticsDataResult - /// class. + /// Initializes a new instance of the RetrieveBootDiagnosticsDataResult class. /// public RetrieveBootDiagnosticsDataResult() { @@ -28,17 +21,19 @@ public RetrieveBootDiagnosticsDataResult() } /// - /// Initializes a new instance of the RetrieveBootDiagnosticsDataResult - /// class. + /// Initializes a new instance of the RetrieveBootDiagnosticsDataResult class. /// - /// The console screenshot blob - /// URI - /// The serial console log blob - /// URI. + + /// The console screenshot blob URI + /// + + /// The serial console log blob URI. + /// public RetrieveBootDiagnosticsDataResult(string consoleScreenshotBlobUri = default(string), string serialConsoleLogBlobUri = default(string)) + { - ConsoleScreenshotBlobUri = consoleScreenshotBlobUri; - SerialConsoleLogBlobUri = serialConsoleLogBlobUri; + this.ConsoleScreenshotBlobUri = consoleScreenshotBlobUri; + this.SerialConsoleLogBlobUri = serialConsoleLogBlobUri; CustomInit(); } @@ -47,17 +42,17 @@ public RetrieveBootDiagnosticsDataResult() /// partial void CustomInit(); + /// /// Gets the console screenshot blob URI /// - [JsonProperty(PropertyName = "consoleScreenshotBlobUri")] - public string ConsoleScreenshotBlobUri { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "consoleScreenshotBlobUri")] + public string ConsoleScreenshotBlobUri {get; private set; } /// /// Gets the serial console log blob URI. /// - [JsonProperty(PropertyName = "serialConsoleLogBlobUri")] - public string SerialConsoleLogBlobUri { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "serialConsoleLogBlobUri")] + public string SerialConsoleLogBlobUri {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RollbackStatusInfo.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RollbackStatusInfo.cs index e68e9792dc38..65b433c6459b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RollbackStatusInfo.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RollbackStatusInfo.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -30,17 +24,21 @@ public RollbackStatusInfo() /// /// Initializes a new instance of the RollbackStatusInfo class. /// - /// The number of - /// instances which have been successfully rolled back. - /// The number of instances - /// which failed to rollback. - /// Error details if OS rollback - /// failed. + + /// The number of instances which have been successfully rolled back. + /// + + /// The number of instances which failed to rollback. + /// + + /// Error details if OS rollback failed. + /// public RollbackStatusInfo(int? successfullyRolledbackInstanceCount = default(int?), int? failedRolledbackInstanceCount = default(int?), ApiError rollbackError = default(ApiError)) + { - SuccessfullyRolledbackInstanceCount = successfullyRolledbackInstanceCount; - FailedRolledbackInstanceCount = failedRolledbackInstanceCount; - RollbackError = rollbackError; + this.SuccessfullyRolledbackInstanceCount = successfullyRolledbackInstanceCount; + this.FailedRolledbackInstanceCount = failedRolledbackInstanceCount; + this.RollbackError = rollbackError; CustomInit(); } @@ -49,24 +47,23 @@ public RollbackStatusInfo() /// partial void CustomInit(); + /// - /// Gets the number of instances which have been successfully rolled - /// back. + /// Gets the number of instances which have been successfully rolled back. /// - [JsonProperty(PropertyName = "successfullyRolledbackInstanceCount")] - public int? SuccessfullyRolledbackInstanceCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "successfullyRolledbackInstanceCount")] + public int? SuccessfullyRolledbackInstanceCount {get; private set; } /// /// Gets the number of instances which failed to rollback. /// - [JsonProperty(PropertyName = "failedRolledbackInstanceCount")] - public int? FailedRolledbackInstanceCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "failedRolledbackInstanceCount")] + public int? FailedRolledbackInstanceCount {get; private set; } /// /// Gets error details if OS rollback failed. /// - [JsonProperty(PropertyName = "rollbackError")] - public ApiError RollbackError { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "rollbackError")] + public ApiError RollbackError {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeActionType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeActionType.cs index 7e3c4f93c1c1..64db9c1383e5 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeActionType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeActionType.cs @@ -1,29 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for RollingUpgradeActionType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum RollingUpgradeActionType { - [EnumMember(Value = "Start")] + [System.Runtime.Serialization.EnumMember(Value = "Start")] Start, - [EnumMember(Value = "Cancel")] + [System.Runtime.Serialization.EnumMember(Value = "Cancel")] Cancel } internal static class RollingUpgradeActionTypeEnumExtension @@ -32,7 +25,6 @@ internal static string ToSerializedValue(this RollingUpgradeActionType? value) { return value == null ? null : ((RollingUpgradeActionType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this RollingUpgradeActionType value) { switch( value ) @@ -44,7 +36,6 @@ internal static string ToSerializedValue(this RollingUpgradeActionType value) } return null; } - internal static RollingUpgradeActionType? ParseRollingUpgradeActionType(this string value) { switch( value ) @@ -57,4 +48,4 @@ internal static string ToSerializedValue(this RollingUpgradeActionType value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradePolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradePolicy.cs index 4dd6a435990b..a703bfde82ba 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradePolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradePolicy.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,51 +23,61 @@ public RollingUpgradePolicy() /// /// Initializes a new instance of the RollingUpgradePolicy class. /// - /// The maximum percent of total - /// virtual machine instances that will be upgraded simultaneously by - /// the rolling upgrade in one batch. As this is a maximum, unhealthy - /// instances in previous or future batches can cause the percentage of - /// instances in a batch to decrease to ensure higher reliability. The - /// default value for this parameter is 20%. - /// The maximum percentage of - /// the total virtual machine instances in the scale set that can be - /// simultaneously unhealthy, either as a result of being upgraded, or - /// by being found in an unhealthy state by the virtual machine health - /// checks before the rolling upgrade aborts. This constraint will be - /// checked prior to starting any batch. The default value for this - /// parameter is 20%. - /// The maximum - /// percentage of upgraded virtual machine instances that can be found - /// to be in an unhealthy state. This check will happen after each - /// batch is upgraded. If this percentage is ever exceeded, the rolling - /// update aborts. The default value for this parameter is 20%. - /// The wait time between - /// completing the update for all virtual machines in one batch and - /// starting the next batch. The time duration should be specified in - /// ISO 8601 format. The default value is 0 seconds (PT0S). - /// Allow VMSS to ignore AZ - /// boundaries when constructing upgrade batches. Take into - /// consideration the Update Domain and maxBatchInstancePercent to - /// determine the batch size. - /// Upgrade all unhealthy - /// instances in a scale set before any healthy instances. - /// Rollback failed - /// instances to previous model if the Rolling Upgrade policy is - /// violated. - /// Create new virtual machines to upgrade the - /// scale set, rather than updating the existing virtual machines. - /// Existing virtual machines will be deleted once the new virtual - /// machines are created for each batch. + + /// The maximum percent of total virtual machine instances that will be + /// upgraded simultaneously by the rolling upgrade in one batch. As this is a + /// maximum, unhealthy instances in previous or future batches can cause the + /// percentage of instances in a batch to decrease to ensure higher + /// reliability. The default value for this parameter is 20%. + /// + + /// The maximum percentage of the total virtual machine instances in the scale + /// set that can be simultaneously unhealthy, either as a result of being + /// upgraded, or by being found in an unhealthy state by the virtual machine + /// health checks before the rolling upgrade aborts. This constraint will be + /// checked prior to starting any batch. The default value for this parameter + /// is 20%. + /// + + /// The maximum percentage of upgraded virtual machine instances that can be + /// found to be in an unhealthy state. This check will happen after each batch + /// is upgraded. If this percentage is ever exceeded, the rolling update + /// aborts. The default value for this parameter is 20%. + /// + + /// The wait time between completing the update for all virtual machines in one + /// batch and starting the next batch. The time duration should be specified in + /// ISO 8601 format. The default value is 0 seconds (PT0S). + /// + + /// Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take + /// into consideration the Update Domain and maxBatchInstancePercent to + /// determine the batch size. + /// + + /// Upgrade all unhealthy instances in a scale set before any healthy + /// instances. + /// + + /// Rollback failed instances to previous model if the Rolling Upgrade policy + /// is violated. + /// + + /// Create new virtual machines to upgrade the scale set, rather than updating + /// the existing virtual machines. Existing virtual machines will be deleted + /// once the new virtual machines are created for each batch. + /// public RollingUpgradePolicy(int? maxBatchInstancePercent = default(int?), int? maxUnhealthyInstancePercent = default(int?), int? maxUnhealthyUpgradedInstancePercent = default(int?), string pauseTimeBetweenBatches = default(string), bool? enableCrossZoneUpgrade = default(bool?), bool? prioritizeUnhealthyInstances = default(bool?), bool? rollbackFailedInstancesOnPolicyBreach = default(bool?), bool? maxSurge = default(bool?)) + { - MaxBatchInstancePercent = maxBatchInstancePercent; - MaxUnhealthyInstancePercent = maxUnhealthyInstancePercent; - MaxUnhealthyUpgradedInstancePercent = maxUnhealthyUpgradedInstancePercent; - PauseTimeBetweenBatches = pauseTimeBetweenBatches; - EnableCrossZoneUpgrade = enableCrossZoneUpgrade; - PrioritizeUnhealthyInstances = prioritizeUnhealthyInstances; - RollbackFailedInstancesOnPolicyBreach = rollbackFailedInstancesOnPolicyBreach; - MaxSurge = maxSurge; + this.MaxBatchInstancePercent = maxBatchInstancePercent; + this.MaxUnhealthyInstancePercent = maxUnhealthyInstancePercent; + this.MaxUnhealthyUpgradedInstancePercent = maxUnhealthyUpgradedInstancePercent; + this.PauseTimeBetweenBatches = pauseTimeBetweenBatches; + this.EnableCrossZoneUpgrade = enableCrossZoneUpgrade; + this.PrioritizeUnhealthyInstances = prioritizeUnhealthyInstances; + this.RollbackFailedInstancesOnPolicyBreach = rollbackFailedInstancesOnPolicyBreach; + this.MaxSurge = maxSurge; CustomInit(); } @@ -83,115 +86,112 @@ public RollingUpgradePolicy() /// partial void CustomInit(); + /// - /// Gets or sets the maximum percent of total virtual machine instances - /// that will be upgraded simultaneously by the rolling upgrade in one - /// batch. As this is a maximum, unhealthy instances in previous or - /// future batches can cause the percentage of instances in a batch to - /// decrease to ensure higher reliability. The default value for this - /// parameter is 20%. + /// Gets or sets the maximum percent of total virtual machine instances that + /// will be upgraded simultaneously by the rolling upgrade in one batch. As + /// this is a maximum, unhealthy instances in previous or future batches can + /// cause the percentage of instances in a batch to decrease to ensure higher + /// reliability. The default value for this parameter is 20%. /// - [JsonProperty(PropertyName = "maxBatchInstancePercent")] - public int? MaxBatchInstancePercent { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maxBatchInstancePercent")] + public int? MaxBatchInstancePercent {get; set; } /// - /// Gets or sets the maximum percentage of the total virtual machine - /// instances in the scale set that can be simultaneously unhealthy, - /// either as a result of being upgraded, or by being found in an - /// unhealthy state by the virtual machine health checks before the - /// rolling upgrade aborts. This constraint will be checked prior to - /// starting any batch. The default value for this parameter is 20%. + /// Gets or sets the maximum percentage of the total virtual machine instances + /// in the scale set that can be simultaneously unhealthy, either as a result + /// of being upgraded, or by being found in an unhealthy state by the virtual + /// machine health checks before the rolling upgrade aborts. This constraint + /// will be checked prior to starting any batch. The default value for this + /// parameter is 20%. /// - [JsonProperty(PropertyName = "maxUnhealthyInstancePercent")] - public int? MaxUnhealthyInstancePercent { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maxUnhealthyInstancePercent")] + public int? MaxUnhealthyInstancePercent {get; set; } /// - /// Gets or sets the maximum percentage of upgraded virtual machine - /// instances that can be found to be in an unhealthy state. This check - /// will happen after each batch is upgraded. If this percentage is - /// ever exceeded, the rolling update aborts. The default value for - /// this parameter is 20%. + /// Gets or sets the maximum percentage of upgraded virtual machine instances + /// that can be found to be in an unhealthy state. This check will happen after + /// each batch is upgraded. If this percentage is ever exceeded, the rolling + /// update aborts. The default value for this parameter is 20%. /// - [JsonProperty(PropertyName = "maxUnhealthyUpgradedInstancePercent")] - public int? MaxUnhealthyUpgradedInstancePercent { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maxUnhealthyUpgradedInstancePercent")] + public int? MaxUnhealthyUpgradedInstancePercent {get; set; } /// - /// Gets or sets the wait time between completing the update for all - /// virtual machines in one batch and starting the next batch. The time - /// duration should be specified in ISO 8601 format. The default value - /// is 0 seconds (PT0S). + /// Gets or sets the wait time between completing the update for all virtual + /// machines in one batch and starting the next batch. The time duration should + /// be specified in ISO 8601 format. The default value is 0 seconds (PT0S). /// - [JsonProperty(PropertyName = "pauseTimeBetweenBatches")] - public string PauseTimeBetweenBatches { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "pauseTimeBetweenBatches")] + public string PauseTimeBetweenBatches {get; set; } /// - /// Gets or sets allow VMSS to ignore AZ boundaries when constructing - /// upgrade batches. Take into consideration the Update Domain and + /// Gets or sets allow VMSS to ignore AZ boundaries when constructing upgrade + /// batches. Take into consideration the Update Domain and /// maxBatchInstancePercent to determine the batch size. /// - [JsonProperty(PropertyName = "enableCrossZoneUpgrade")] - public bool? EnableCrossZoneUpgrade { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enableCrossZoneUpgrade")] + public bool? EnableCrossZoneUpgrade {get; set; } /// - /// Gets or sets upgrade all unhealthy instances in a scale set before - /// any healthy instances. + /// Gets or sets upgrade all unhealthy instances in a scale set before any + /// healthy instances. /// - [JsonProperty(PropertyName = "prioritizeUnhealthyInstances")] - public bool? PrioritizeUnhealthyInstances { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "prioritizeUnhealthyInstances")] + public bool? PrioritizeUnhealthyInstances {get; set; } /// - /// Gets or sets rollback failed instances to previous model if the - /// Rolling Upgrade policy is violated. + /// Gets or sets rollback failed instances to previous model if the Rolling + /// Upgrade policy is violated. /// - [JsonProperty(PropertyName = "rollbackFailedInstancesOnPolicyBreach")] - public bool? RollbackFailedInstancesOnPolicyBreach { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "rollbackFailedInstancesOnPolicyBreach")] + public bool? RollbackFailedInstancesOnPolicyBreach {get; set; } /// - /// Gets or sets create new virtual machines to upgrade the scale set, - /// rather than updating the existing virtual machines. Existing - /// virtual machines will be deleted once the new virtual machines are - /// created for each batch. + /// Gets or sets create new virtual machines to upgrade the scale set, rather + /// than updating the existing virtual machines. Existing virtual machines will + /// be deleted once the new virtual machines are created for each batch. /// - [JsonProperty(PropertyName = "maxSurge")] - public bool? MaxSurge { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "maxSurge")] + public bool? MaxSurge {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (MaxBatchInstancePercent != null) + if (this.MaxBatchInstancePercent != null) { - if (MaxBatchInstancePercent > 100) + if (this.MaxBatchInstancePercent > 100) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxBatchInstancePercent", 100); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "MaxBatchInstancePercent", 100); } - if (MaxBatchInstancePercent < 5) + if (this.MaxBatchInstancePercent < 5) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxBatchInstancePercent", 5); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "MaxBatchInstancePercent", 5); } } - if (MaxUnhealthyInstancePercent != null) + if (this.MaxUnhealthyInstancePercent != null) { - if (MaxUnhealthyInstancePercent > 100) + if (this.MaxUnhealthyInstancePercent > 100) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxUnhealthyInstancePercent", 100); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "MaxUnhealthyInstancePercent", 100); } - if (MaxUnhealthyInstancePercent < 5) + if (this.MaxUnhealthyInstancePercent < 5) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxUnhealthyInstancePercent", 5); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "MaxUnhealthyInstancePercent", 5); } } - if (MaxUnhealthyUpgradedInstancePercent != null) + if (this.MaxUnhealthyUpgradedInstancePercent != null) { - if (MaxUnhealthyUpgradedInstancePercent > 100) + if (this.MaxUnhealthyUpgradedInstancePercent > 100) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxUnhealthyUpgradedInstancePercent", 100); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "MaxUnhealthyUpgradedInstancePercent", 100); } } + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeProgressInfo.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeProgressInfo.cs index ba26df8d454d..f0003cdb5e76 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeProgressInfo.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeProgressInfo.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Information about the number of virtual machine instances in each - /// upgrade state. + /// Information about the number of virtual machine instances in each upgrade + /// state. /// public partial class RollingUpgradeProgressInfo { @@ -30,20 +24,25 @@ public RollingUpgradeProgressInfo() /// /// Initializes a new instance of the RollingUpgradeProgressInfo class. /// - /// The number of instances that - /// have been successfully upgraded. - /// The number of instances that have - /// failed to be upgraded successfully. - /// The number of instances that - /// are currently being upgraded. - /// The number of instances that - /// have not yet begun to be upgraded. + + /// The number of instances that have been successfully upgraded. + /// + + /// The number of instances that have failed to be upgraded successfully. + /// + + /// The number of instances that are currently being upgraded. + /// + + /// The number of instances that have not yet begun to be upgraded. + /// public RollingUpgradeProgressInfo(int? successfulInstanceCount = default(int?), int? failedInstanceCount = default(int?), int? inProgressInstanceCount = default(int?), int? pendingInstanceCount = default(int?)) + { - SuccessfulInstanceCount = successfulInstanceCount; - FailedInstanceCount = failedInstanceCount; - InProgressInstanceCount = inProgressInstanceCount; - PendingInstanceCount = pendingInstanceCount; + this.SuccessfulInstanceCount = successfulInstanceCount; + this.FailedInstanceCount = failedInstanceCount; + this.InProgressInstanceCount = inProgressInstanceCount; + this.PendingInstanceCount = pendingInstanceCount; CustomInit(); } @@ -52,31 +51,29 @@ public RollingUpgradeProgressInfo() /// partial void CustomInit(); + /// /// Gets the number of instances that have been successfully upgraded. /// - [JsonProperty(PropertyName = "successfulInstanceCount")] - public int? SuccessfulInstanceCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "successfulInstanceCount")] + public int? SuccessfulInstanceCount {get; private set; } /// - /// Gets the number of instances that have failed to be upgraded - /// successfully. + /// Gets the number of instances that have failed to be upgraded successfully. /// - [JsonProperty(PropertyName = "failedInstanceCount")] - public int? FailedInstanceCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "failedInstanceCount")] + public int? FailedInstanceCount {get; private set; } /// /// Gets the number of instances that are currently being upgraded. /// - [JsonProperty(PropertyName = "inProgressInstanceCount")] - public int? InProgressInstanceCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "inProgressInstanceCount")] + public int? InProgressInstanceCount {get; private set; } /// - /// Gets the number of instances that have not yet begun to be - /// upgraded. + /// Gets the number of instances that have not yet begun to be upgraded. /// - [JsonProperty(PropertyName = "pendingInstanceCount")] - public int? PendingInstanceCount { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "pendingInstanceCount")] + public int? PendingInstanceCount {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeRunningStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeRunningStatus.cs index 86014bd5619a..2038f73da4aa 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeRunningStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeRunningStatus.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class RollingUpgradeRunningStatus { /// - /// Initializes a new instance of the RollingUpgradeRunningStatus - /// class. + /// Initializes a new instance of the RollingUpgradeRunningStatus class. /// public RollingUpgradeRunningStatus() { @@ -28,23 +21,28 @@ public RollingUpgradeRunningStatus() } /// - /// Initializes a new instance of the RollingUpgradeRunningStatus - /// class. + /// Initializes a new instance of the RollingUpgradeRunningStatus class. /// - /// Code indicating the current status of the - /// upgrade. Possible values include: 'RollingForward', 'Cancelled', - /// 'Completed', 'Faulted' - /// Start time of the upgrade. - /// The last action performed on the rolling - /// upgrade. Possible values include: 'Start', 'Cancel' - /// Last action time of the - /// upgrade. + + /// Code indicating the current status of the upgrade. + /// Possible values include: 'RollingForward', 'Cancelled', 'Completed', + /// 'Faulted' + + /// Start time of the upgrade. + /// + + /// The last action performed on the rolling upgrade. + /// Possible values include: 'Start', 'Cancel' + + /// Last action time of the upgrade. + /// public RollingUpgradeRunningStatus(RollingUpgradeStatusCode? code = default(RollingUpgradeStatusCode?), System.DateTime? startTime = default(System.DateTime?), RollingUpgradeActionType? lastAction = default(RollingUpgradeActionType?), System.DateTime? lastActionTime = default(System.DateTime?)) + { - Code = code; - StartTime = startTime; - LastAction = lastAction; - LastActionTime = lastActionTime; + this.Code = code; + this.StartTime = startTime; + this.LastAction = lastAction; + this.LastActionTime = lastActionTime; CustomInit(); } @@ -53,32 +51,29 @@ public RollingUpgradeRunningStatus() /// partial void CustomInit(); + /// - /// Gets code indicating the current status of the upgrade. Possible - /// values include: 'RollingForward', 'Cancelled', 'Completed', - /// 'Faulted' + /// Gets code indicating the current status of the upgrade. Possible values include: 'RollingForward', 'Cancelled', 'Completed', 'Faulted' /// - [JsonProperty(PropertyName = "code")] - public RollingUpgradeStatusCode? Code { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public RollingUpgradeStatusCode? Code {get; private set; } /// /// Gets start time of the upgrade. /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime {get; private set; } /// - /// Gets the last action performed on the rolling upgrade. Possible - /// values include: 'Start', 'Cancel' + /// Gets the last action performed on the rolling upgrade. Possible values include: 'Start', 'Cancel' /// - [JsonProperty(PropertyName = "lastAction")] - public RollingUpgradeActionType? LastAction { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastAction")] + public RollingUpgradeActionType? LastAction {get; private set; } /// /// Gets last action time of the upgrade. /// - [JsonProperty(PropertyName = "lastActionTime")] - public System.DateTime? LastActionTime { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "lastActionTime")] + public System.DateTime? LastActionTime {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeStatusCode.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeStatusCode.cs index 9e108e8c1d93..6707a88dc56a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeStatusCode.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeStatusCode.cs @@ -1,33 +1,26 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for RollingUpgradeStatusCode. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum RollingUpgradeStatusCode { - [EnumMember(Value = "RollingForward")] + [System.Runtime.Serialization.EnumMember(Value = "RollingForward")] RollingForward, - [EnumMember(Value = "Cancelled")] + [System.Runtime.Serialization.EnumMember(Value = "Cancelled")] Cancelled, - [EnumMember(Value = "Completed")] + [System.Runtime.Serialization.EnumMember(Value = "Completed")] Completed, - [EnumMember(Value = "Faulted")] + [System.Runtime.Serialization.EnumMember(Value = "Faulted")] Faulted } internal static class RollingUpgradeStatusCodeEnumExtension @@ -36,7 +29,6 @@ internal static string ToSerializedValue(this RollingUpgradeStatusCode? value) { return value == null ? null : ((RollingUpgradeStatusCode)value).ToSerializedValue(); } - internal static string ToSerializedValue(this RollingUpgradeStatusCode value) { switch( value ) @@ -52,7 +44,6 @@ internal static string ToSerializedValue(this RollingUpgradeStatusCode value) } return null; } - internal static RollingUpgradeStatusCode? ParseRollingUpgradeStatusCode(this string value) { switch( value ) @@ -69,4 +60,4 @@ internal static string ToSerializedValue(this RollingUpgradeStatusCode value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeStatusInfo.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeStatusInfo.cs index 7c9078046b69..3a4870221459 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeStatusInfo.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeStatusInfo.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The status of the latest virtual machine scale set rolling upgrade. /// - [Rest.Serialization.JsonTransformation] - public partial class RollingUpgradeStatusInfo : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class RollingUpgradeStatusInfo : TrackedResource { /// /// Initializes a new instance of the RollingUpgradeStatusInfo class. @@ -34,26 +24,42 @@ public RollingUpgradeStatusInfo() /// /// Initializes a new instance of the RollingUpgradeStatusInfo class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The rolling upgrade policies applied for this - /// upgrade. - /// Information about the current running - /// state of the overall upgrade. - /// Information about the number of virtual - /// machine instances in each upgrade state. - /// Error details for this upgrade, if there are - /// any. - public RollingUpgradeStatusInfo(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), RollingUpgradePolicy policy = default(RollingUpgradePolicy), RollingUpgradeRunningStatus runningStatus = default(RollingUpgradeRunningStatus), RollingUpgradeProgressInfo progress = default(RollingUpgradeProgressInfo), ApiError error = default(ApiError)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// The rolling upgrade policies applied for this upgrade. + /// + + /// Information about the current running state of the overall upgrade. + /// + + /// Information about the number of virtual machine instances in each upgrade + /// state. + /// + + /// Error details for this upgrade, if there are any. + /// + public RollingUpgradeStatusInfo(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), RollingUpgradePolicy policy = default(RollingUpgradePolicy), RollingUpgradeRunningStatus runningStatus = default(RollingUpgradeRunningStatus), RollingUpgradeProgressInfo progress = default(RollingUpgradeProgressInfo), ApiError error = default(ApiError)) + + : base(location, id, name, type, tags) { - Policy = policy; - RunningStatus = runningStatus; - Progress = progress; - Error = error; + this.Policy = policy; + this.RunningStatus = runningStatus; + this.Progress = progress; + this.Error = error; CustomInit(); } @@ -62,45 +68,47 @@ public RollingUpgradeStatusInfo() /// partial void CustomInit(); + /// /// Gets the rolling upgrade policies applied for this upgrade. /// - [JsonProperty(PropertyName = "properties.policy")] - public RollingUpgradePolicy Policy { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.policy")] + public RollingUpgradePolicy Policy {get; private set; } /// - /// Gets information about the current running state of the overall - /// upgrade. + /// Gets information about the current running state of the overall upgrade. /// - [JsonProperty(PropertyName = "properties.runningStatus")] - public RollingUpgradeRunningStatus RunningStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.runningStatus")] + public RollingUpgradeRunningStatus RunningStatus {get; private set; } /// - /// Gets information about the number of virtual machine instances in - /// each upgrade state. + /// Gets information about the number of virtual machine instances in each + /// upgrade state. /// - [JsonProperty(PropertyName = "properties.progress")] - public RollingUpgradeProgressInfo Progress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.progress")] + public RollingUpgradeProgressInfo Progress {get; private set; } /// /// Gets error details for this upgrade, if there are any. /// - [JsonProperty(PropertyName = "properties.error")] - public ApiError Error { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.error")] + public ApiError Error {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (Policy != null) + if (this.Policy != null) { - Policy.Validate(); + this.Policy.Validate(); } + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeStatusInfoProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeStatusInfoProperties.cs new file mode 100644 index 000000000000..d8ec065d0351 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RollingUpgradeStatusInfoProperties.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// The status of the latest virtual machine scale set rolling upgrade. + /// + public partial class RollingUpgradeStatusInfoProperties + { + /// + /// Initializes a new instance of the RollingUpgradeStatusInfoProperties class. + /// + public RollingUpgradeStatusInfoProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RollingUpgradeStatusInfoProperties class. + /// + + /// The rolling upgrade policies applied for this upgrade. + /// + + /// Information about the current running state of the overall upgrade. + /// + + /// Information about the number of virtual machine instances in each upgrade + /// state. + /// + + /// Error details for this upgrade, if there are any. + /// + public RollingUpgradeStatusInfoProperties(RollingUpgradePolicy policy = default(RollingUpgradePolicy), RollingUpgradeRunningStatus runningStatus = default(RollingUpgradeRunningStatus), RollingUpgradeProgressInfo progress = default(RollingUpgradeProgressInfo), ApiError error = default(ApiError)) + + { + this.Policy = policy; + this.RunningStatus = runningStatus; + this.Progress = progress; + this.Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the rolling upgrade policies applied for this upgrade. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "policy")] + public RollingUpgradePolicy Policy {get; private set; } + + /// + /// Gets information about the current running state of the overall upgrade. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "runningStatus")] + public RollingUpgradeRunningStatus RunningStatus {get; private set; } + + /// + /// Gets information about the number of virtual machine instances in each + /// upgrade state. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "progress")] + public RollingUpgradeProgressInfo Progress {get; private set; } + + /// + /// Gets error details for this upgrade, if there are any. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ApiError Error {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Policy != null) + { + this.Policy.Validate(); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandDocument.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandDocument.cs index d882f8dce44d..4018e17b573d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandDocument.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandDocument.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,19 +23,33 @@ public RunCommandDocument() /// /// Initializes a new instance of the RunCommandDocument class. /// - /// The VM run command schema. - /// The VM run command id. - /// The Operating System type. Possible values - /// include: 'Windows', 'Linux' - /// The VM run command label. - /// The VM run command description. - /// The script to be executed. - /// The parameters used by the script. - public RunCommandDocument(string schema, string id, OperatingSystemTypes osType, string label, string description, IList script, IList parameters = default(IList)) - : base(schema, id, osType, label, description) + + /// The VM run command schema. + /// + + /// The VM run command id. + /// + + /// The Operating System type. + /// Possible values include: 'Windows', 'Linux' + + /// The VM run command label. + /// + + /// The VM run command description. + /// + + /// The script to be executed. + /// + + /// The parameters used by the script. + /// + public RunCommandDocument(string schema, string id, OperatingSystemTypes osType, string label, string description, System.Collections.Generic.IList script, System.Collections.Generic.IList parameters = default(System.Collections.Generic.IList)) + + : base(schema, id, osType, label, description) { - Script = script; - Parameters = parameters; + this.Script = script; + this.Parameters = parameters; CustomInit(); } @@ -53,34 +58,35 @@ public RunCommandDocument() /// partial void CustomInit(); + /// /// Gets or sets the script to be executed. /// - [JsonProperty(PropertyName = "script")] - public IList Script { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "script")] + public System.Collections.Generic.IList Script {get; set; } /// /// Gets or sets the parameters used by the script. /// - [JsonProperty(PropertyName = "parameters")] - public IList Parameters { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "parameters")] + public System.Collections.Generic.IList Parameters {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (Script == null) + if (this.Script == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Script"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Script"); } - if (Parameters != null) + + if (this.Parameters != null) { - foreach (var element in Parameters) + foreach (var element in this.Parameters) { if (element != null) { @@ -90,4 +96,4 @@ public override void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandDocumentBase.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandDocumentBase.cs index b80e0ea65ef4..d5b87e7c904f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandDocumentBase.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandDocumentBase.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,19 +23,29 @@ public RunCommandDocumentBase() /// /// Initializes a new instance of the RunCommandDocumentBase class. /// - /// The VM run command schema. - /// The VM run command id. - /// The Operating System type. Possible values - /// include: 'Windows', 'Linux' - /// The VM run command label. - /// The VM run command description. + + /// The VM run command schema. + /// + + /// The VM run command id. + /// + + /// The Operating System type. + /// Possible values include: 'Windows', 'Linux' + + /// The VM run command label. + /// + + /// The VM run command description. + /// public RunCommandDocumentBase(string schema, string id, OperatingSystemTypes osType, string label, string description) + { - Schema = schema; - Id = id; - OsType = osType; - Label = label; - Description = description; + this.Schema = schema; + this.Id = id; + this.OsType = osType; + this.Label = label; + this.Description = description; CustomInit(); } @@ -51,61 +54,65 @@ public RunCommandDocumentBase(string schema, string id, OperatingSystemTypes osT /// partial void CustomInit(); + /// /// Gets or sets the VM run command schema. /// - [JsonProperty(PropertyName = "$schema")] - public string Schema { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "$schema")] + public string Schema {get; set; } /// /// Gets or sets the VM run command id. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// - /// Gets or sets the Operating System type. Possible values include: - /// 'Windows', 'Linux' + /// Gets or sets the Operating System type. Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "osType")] - public OperatingSystemTypes OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public OperatingSystemTypes OsType {get; set; } /// /// Gets or sets the VM run command label. /// - [JsonProperty(PropertyName = "label")] - public string Label { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "label")] + public string Label {get; set; } /// /// Gets or sets the VM run command description. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Schema == null) + if (this.Schema == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Schema"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Schema"); } - if (Id == null) + if (this.Id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); } - if (Label == null) + if (this.Label == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Label"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Label"); } - if (Description == null) + if (this.Description == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Description"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Description"); } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandInput.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandInput.cs index 82aa4d3d4dc1..27fbfd9426a8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandInput.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandInput.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,20 +23,25 @@ public RunCommandInput() /// /// Initializes a new instance of the RunCommandInput class. /// - /// Specifies a commandId of predefined - /// built-in script. Command IDs available for Linux are listed at - /// https://aka.ms/RunCommandManagedLinux#available-commands, Windows - /// at - /// https://aka.ms/RunCommandManagedWindows#available-commands. - /// Optional. The script to be executed. When - /// this value is given, the given script will override the default - /// script of the command. - /// The run command parameters. - public RunCommandInput(string commandId, IList script = default(IList), IList parameters = default(IList)) + + /// Specifies a commandId of predefined built-in script. Command IDs available + /// for Linux are listed at + /// https://aka.ms/RunCommandManagedLinux#available-commands, Windows at + /// https://aka.ms/RunCommandManagedWindows#available-commands. + /// + + /// Optional. The script to be executed. When this value is given, the given + /// script will override the default script of the command. + /// + + /// The run command parameters. + /// + public RunCommandInput(string commandId, System.Collections.Generic.IList script = default(System.Collections.Generic.IList), System.Collections.Generic.IList parameters = default(System.Collections.Generic.IList)) + { - CommandId = commandId; - Script = script; - Parameters = parameters; + this.CommandId = commandId; + this.Script = script; + this.Parameters = parameters; CustomInit(); } @@ -54,44 +50,45 @@ public RunCommandInput() /// partial void CustomInit(); + /// - /// Gets or sets specifies a commandId of predefined built-in script. - /// Command IDs available for Linux are listed at - /// https://aka.ms/RunCommandManagedLinux#available-commands, Windows - /// at https://aka.ms/RunCommandManagedWindows#available-commands. + /// Gets or sets specifies a commandId of predefined built-in script. Command + /// IDs available for Linux are listed at + /// https://aka.ms/RunCommandManagedLinux#available-commands, Windows at + /// https://aka.ms/RunCommandManagedWindows#available-commands. /// - [JsonProperty(PropertyName = "commandId")] - public string CommandId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "commandId")] + public string CommandId {get; set; } /// - /// Gets or sets optional. The script to be executed. When this value - /// is given, the given script will override the default script of the - /// command. + /// Gets or sets optional. The script to be executed. When this value is + /// given, the given script will override the default script of the command. /// - [JsonProperty(PropertyName = "script")] - public IList Script { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "script")] + public System.Collections.Generic.IList Script {get; set; } /// /// Gets or sets the run command parameters. /// - [JsonProperty(PropertyName = "parameters")] - public IList Parameters { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "parameters")] + public System.Collections.Generic.IList Parameters {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (CommandId == null) + if (this.CommandId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "CommandId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CommandId"); } - if (Parameters != null) + + + if (this.Parameters != null) { - foreach (var element in Parameters) + foreach (var element in this.Parameters) { if (element != null) { @@ -101,4 +98,4 @@ public virtual void Validate() } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandInputParameter.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandInputParameter.cs index 0b652e908575..1fdc76283ff6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandInputParameter.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandInputParameter.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,12 +23,17 @@ public RunCommandInputParameter() /// /// Initializes a new instance of the RunCommandInputParameter class. /// - /// The run command parameter name. - /// The run command parameter value. + + /// The run command parameter name. + /// + + /// The run command parameter value. + /// public RunCommandInputParameter(string name, string value) + { - Name = name; - Value = value; + this.Name = name; + this.Value = value; CustomInit(); } @@ -44,34 +42,36 @@ public RunCommandInputParameter(string name, string value) /// partial void CustomInit(); + /// /// Gets or sets the run command parameter name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the run command parameter value. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (Value == null) + if (this.Value == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Value"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandManagedIdentity.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandManagedIdentity.cs index 81433cf86400..9697ef97b0da 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandManagedIdentity.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandManagedIdentity.cs @@ -1,30 +1,23 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Contains clientId or objectId (use only one, not both) of a - /// user-assigned managed identity that has access to storage blob used in - /// Run Command. Use an empty RunCommandManagedIdentity object in case of - /// system-assigned identity. Make sure the Azure storage blob exists in - /// case of scriptUri, and managed identity has been given access to blob's - /// container with 'Storage Blob Data Reader' role assignment with - /// scriptUri blob and 'Storage Blob Data Contributor' for Append - /// blobs(outputBlobUri, errorBlobUri). In case of user assigned identity, - /// make sure you add it under VM's identity. For more info on managed - /// identity and Run Command, refer https://aka.ms/ManagedIdentity and - /// https://aka.ms/RunCommandManaged. + /// Contains clientId or objectId (use only one, not both) of a user-assigned + /// managed identity that has access to storage blob used in Run Command. Use + /// an empty RunCommandManagedIdentity object in case of system-assigned + /// identity. Make sure the Azure storage blob exists in case of scriptUri, and + /// managed identity has been given access to blob's container with 'Storage + /// Blob Data Reader' role assignment with scriptUri blob and 'Storage Blob + /// Data Contributor' for Append blobs(outputBlobUri, errorBlobUri). In case of + /// user assigned identity, make sure you add it under VM's identity. For more + /// info on managed identity and Run Command, refer + /// https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. /// public partial class RunCommandManagedIdentity { @@ -39,16 +32,19 @@ public RunCommandManagedIdentity() /// /// Initializes a new instance of the RunCommandManagedIdentity class. /// - /// Client Id (GUID value) of the user-assigned - /// managed identity. ObjectId should not be used if this is - /// provided. - /// Object Id (GUID value) of the user-assigned - /// managed identity. ClientId should not be used if this is - /// provided. + + /// Client Id (GUID value) of the user-assigned managed identity. ObjectId + /// should not be used if this is provided. + /// + + /// Object Id (GUID value) of the user-assigned managed identity. ClientId + /// should not be used if this is provided. + /// public RunCommandManagedIdentity(string clientId = default(string), string objectId = default(string)) + { - ClientId = clientId; - ObjectId = objectId; + this.ClientId = clientId; + this.ObjectId = objectId; CustomInit(); } @@ -57,19 +53,19 @@ public RunCommandManagedIdentity() /// partial void CustomInit(); + /// - /// Gets or sets client Id (GUID value) of the user-assigned managed - /// identity. ObjectId should not be used if this is provided. + /// Gets or sets client Id (GUID value) of the user-assigned managed identity. + /// ObjectId should not be used if this is provided. /// - [JsonProperty(PropertyName = "clientId")] - public string ClientId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "clientId")] + public string ClientId {get; set; } /// - /// Gets or sets object Id (GUID value) of the user-assigned managed - /// identity. ClientId should not be used if this is provided. + /// Gets or sets object Id (GUID value) of the user-assigned managed identity. + /// ClientId should not be used if this is provided. /// - [JsonProperty(PropertyName = "objectId")] - public string ObjectId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "objectId")] + public string ObjectId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandParameterDefinition.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandParameterDefinition.cs index b8acb1f1288a..2267e730e828 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandParameterDefinition.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandParameterDefinition.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class RunCommandParameterDefinition { /// - /// Initializes a new instance of the RunCommandParameterDefinition - /// class. + /// Initializes a new instance of the RunCommandParameterDefinition class. /// public RunCommandParameterDefinition() { @@ -29,20 +21,27 @@ public RunCommandParameterDefinition() } /// - /// Initializes a new instance of the RunCommandParameterDefinition - /// class. + /// Initializes a new instance of the RunCommandParameterDefinition class. /// - /// The run command parameter name. - /// The run command parameter type. - /// The run command parameter default - /// value. - /// The run command parameter required. + + /// The run command parameter name. + /// + + /// The run command parameter type. + /// + + /// The run command parameter default value. + /// + + /// The run command parameter required. + /// public RunCommandParameterDefinition(string name, string type, string defaultValue = default(string), bool? required = default(bool?)) + { - Name = name; - Type = type; - DefaultValue = defaultValue; - Required = required; + this.Name = name; + this.Type = type; + this.DefaultValue = defaultValue; + this.Required = required; CustomInit(); } @@ -51,46 +50,49 @@ public RunCommandParameterDefinition() /// partial void CustomInit(); + /// /// Gets or sets the run command parameter name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the run command parameter type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets the run command parameter default value. /// - [JsonProperty(PropertyName = "defaultValue")] - public string DefaultValue { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultValue")] + public string DefaultValue {get; set; } /// /// Gets or sets the run command parameter required. /// - [JsonProperty(PropertyName = "required")] - public bool? Required { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "required")] + public bool? Required {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (Type == null) + if (this.Type == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Type"); } + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandResult.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandResult.cs index 0bbd028fe22d..c2f454254fb4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandResult.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/RunCommandResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; public partial class RunCommandResult @@ -28,10 +20,13 @@ public RunCommandResult() /// /// Initializes a new instance of the RunCommandResult class. /// - /// Run command operation response. - public RunCommandResult(IList value = default(IList)) + + /// Run command operation response. + /// + public RunCommandResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -40,11 +35,11 @@ public RunCommandResult() /// partial void CustomInit(); + /// /// Gets or sets run command operation response. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ScaleInPolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ScaleInPolicy.cs index 05fcb921fc13..ea50cf572876 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ScaleInPolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ScaleInPolicy.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,39 +23,40 @@ public ScaleInPolicy() /// /// Initializes a new instance of the ScaleInPolicy class. /// - /// The rules to be followed when scaling-in a - /// virtual machine scale set. <br><br> Possible values - /// are: <br><br> **Default** When a virtual machine scale - /// set is scaled in, the scale set will first be balanced across zones - /// if it is a zonal scale set. Then, it will be balanced across Fault - /// Domains as far as possible. Within each Fault Domain, the virtual - /// machines chosen for removal will be the newest ones that are not - /// protected from scale-in. <br><br> **OldestVM** When a - /// virtual machine scale set is being scaled-in, the oldest virtual - /// machines that are not protected from scale-in will be chosen for - /// removal. For zonal virtual machine scale sets, the scale set will - /// first be balanced across zones. Within each zone, the oldest - /// virtual machines that are not protected will be chosen for removal. - /// <br><br> **NewestVM** When a virtual machine scale set - /// is being scaled-in, the newest virtual machines that are not - /// protected from scale-in will be chosen for removal. For zonal - /// virtual machine scale sets, the scale set will first be balanced - /// across zones. Within each zone, the newest virtual machines that - /// are not protected will be chosen for removal. - /// <br><br> - /// This property allows you to specify if - /// virtual machines chosen for removal have to be force deleted when a - /// virtual machine scale set is being scaled-in.(Feature in - /// Preview) - /// This property allows you to - /// prioritize the deletion of unhealthy and inactive VMs when a - /// virtual machine scale set is being scaled-in.(Feature in - /// Preview) - public ScaleInPolicy(IList rules = default(IList), bool? forceDeletion = default(bool?), bool? prioritizeUnhealthyVMs = default(bool?)) + + /// The rules to be followed when scaling-in a virtual machine scale set. + /// <br><br> Possible values are: <br><br> **Default** When a virtual machine + /// scale set is scaled in, the scale set will first be balanced across zones + /// if it is a zonal scale set. Then, it will be balanced across Fault Domains + /// as far as possible. Within each Fault Domain, the virtual machines chosen + /// for removal will be the newest ones that are not protected from scale-in. + /// <br><br> **OldestVM** When a virtual machine scale set is being scaled-in, + /// the oldest virtual machines that are not protected from scale-in will be + /// chosen for removal. For zonal virtual machine scale sets, the scale set + /// will first be balanced across zones. Within each zone, the oldest virtual + /// machines that are not protected will be chosen for removal. <br><br> + /// **NewestVM** When a virtual machine scale set is being scaled-in, the + /// newest virtual machines that are not protected from scale-in will be chosen + /// for removal. For zonal virtual machine scale sets, the scale set will first + /// be balanced across zones. Within each zone, the newest virtual machines + /// that are not protected will be chosen for removal. <br><br> + /// + + /// This property allows you to specify if virtual machines chosen for removal + /// have to be force deleted when a virtual machine scale set is being + /// scaled-in.(Feature in Preview) + /// + + /// This property allows you to prioritize the deletion of unhealthy and + /// inactive VMs when a virtual machine scale set is being scaled-in.(Feature + /// in Preview) + /// + public ScaleInPolicy(System.Collections.Generic.IList rules = default(System.Collections.Generic.IList), bool? forceDeletion = default(bool?), bool? prioritizeUnhealthyVMS = default(bool?)) + { - Rules = rules; - ForceDeletion = forceDeletion; - PrioritizeUnhealthyVMs = prioritizeUnhealthyVMs; + this.Rules = rules; + this.ForceDeletion = forceDeletion; + this.PrioritizeUnhealthyVMs = prioritizeUnhealthyVMS; CustomInit(); } @@ -72,47 +65,43 @@ public ScaleInPolicy() /// partial void CustomInit(); + /// - /// Gets or sets the rules to be followed when scaling-in a virtual - /// machine scale set. &lt;br&gt;&lt;br&gt; Possible - /// values are: &lt;br&gt;&lt;br&gt; **Default** When a + /// Gets or sets the rules to be followed when scaling-in a virtual machine + /// scale set. <br><br> Possible values are: <br><br> **Default** When a /// virtual machine scale set is scaled in, the scale set will first be - /// balanced across zones if it is a zonal scale set. Then, it will be - /// balanced across Fault Domains as far as possible. Within each Fault - /// Domain, the virtual machines chosen for removal will be the newest - /// ones that are not protected from scale-in. - /// &lt;br&gt;&lt;br&gt; **OldestVM** When a virtual - /// machine scale set is being scaled-in, the oldest virtual machines - /// that are not protected from scale-in will be chosen for removal. - /// For zonal virtual machine scale sets, the scale set will first be - /// balanced across zones. Within each zone, the oldest virtual - /// machines that are not protected will be chosen for removal. - /// &lt;br&gt;&lt;br&gt; **NewestVM** When a virtual - /// machine scale set is being scaled-in, the newest virtual machines - /// that are not protected from scale-in will be chosen for removal. - /// For zonal virtual machine scale sets, the scale set will first be - /// balanced across zones. Within each zone, the newest virtual - /// machines that are not protected will be chosen for removal. - /// &lt;br&gt;&lt;br&gt; + /// balanced across zones if it is a zonal scale set. Then, it will be balanced + /// across Fault Domains as far as possible. Within each Fault Domain, the + /// virtual machines chosen for removal will be the newest ones that are not + /// protected from scale-in. <br><br> **OldestVM** When a virtual machine scale + /// set is being scaled-in, the oldest virtual machines that are not protected + /// from scale-in will be chosen for removal. For zonal virtual machine scale + /// sets, the scale set will first be balanced across zones. Within each zone, + /// the oldest virtual machines that are not protected will be chosen for + /// removal. <br><br> **NewestVM** When a virtual machine scale set is being + /// scaled-in, the newest virtual machines that are not protected from scale-in + /// will be chosen for removal. For zonal virtual machine scale sets, the scale + /// set will first be balanced across zones. Within each zone, the newest + /// virtual machines that are not protected will be chosen for removal. + /// <br><br> /// - [JsonProperty(PropertyName = "rules")] - public IList Rules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] + public System.Collections.Generic.IList Rules {get; set; } /// - /// Gets or sets this property allows you to specify if virtual - /// machines chosen for removal have to be force deleted when a virtual - /// machine scale set is being scaled-in.(Feature in Preview) + /// Gets or sets this property allows you to specify if virtual machines chosen + /// for removal have to be force deleted when a virtual machine scale set is + /// being scaled-in.(Feature in Preview) /// - [JsonProperty(PropertyName = "forceDeletion")] - public bool? ForceDeletion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "forceDeletion")] + public bool? ForceDeletion {get; set; } /// /// Gets or sets this property allows you to prioritize the deletion of - /// unhealthy and inactive VMs when a virtual machine scale set is - /// being scaled-in.(Feature in Preview) + /// unhealthy and inactive VMs when a virtual machine scale set is being + /// scaled-in.(Feature in Preview) /// - [JsonProperty(PropertyName = "prioritizeUnhealthyVMs")] - public bool? PrioritizeUnhealthyVMs { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "prioritizeUnhealthyVMs")] + public bool? PrioritizeUnhealthyVMs {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ScheduleProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ScheduleProfile.cs index aae932ff1115..f0c2bd6da89d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ScheduleProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ScheduleProfile.cs @@ -1,25 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Defines the schedule for Block-type capacity reservations. Specifies - /// the schedule during which capacity reservation is active and VM or VMSS - /// resource can be allocated using reservation. This property is required - /// and only supported when the capacity reservation group type is 'Block'. - /// The scheduleProfile, start, and end fields are immutable after - /// creation. Minimum API version: 2025-04-01. Please refer to + /// Defines the schedule for Block-type capacity reservations. Specifies the + /// schedule during which capacity reservation is active and VM or VMSS + /// resource can be allocated using reservation. This property is required and + /// only supported when the capacity reservation group type is 'Block'. The + /// scheduleProfile, start, and end fields are immutable after creation. + /// Minimum API version: 2025-04-01. Please refer to /// https://aka.ms/blockcapacityreservation for more details. /// public partial class ScheduleProfile @@ -35,18 +29,21 @@ public ScheduleProfile() /// /// Initializes a new instance of the ScheduleProfile class. /// - /// The required start date for block capacity - /// reservations. Must be today or within 56 days in the future. For - /// same-day scheduling, requests must be submitted before 11:30 AM - /// UTC. Example: 2025-06-27. - /// The required end date for block capacity - /// reservations. Must be after the start date, with a duration of - /// either 1–14 whole days or 3–26 whole weeks. Example: - /// 2025-06-28. + + /// The required start date for block capacity reservations. Must be today or + /// within 56 days in the future. For same-day scheduling, requests must be + /// submitted before 11:30 AM UTC. Example: 2025-06-27. + /// + + /// The required end date for block capacity reservations. Must be after the + /// start date, with a duration of either 1–14 whole days or 3–26 whole weeks. + /// Example: 2025-06-28. + /// public ScheduleProfile(string start = default(string), string end = default(string)) + { - Start = start; - End = end; + this.Start = start; + this.End = end; CustomInit(); } @@ -55,22 +52,21 @@ public ScheduleProfile() /// partial void CustomInit(); + /// - /// Gets or sets the required start date for block capacity - /// reservations. Must be today or within 56 days in the future. For - /// same-day scheduling, requests must be submitted before 11:30 AM - /// UTC. Example: 2025-06-27. + /// Gets or sets the required start date for block capacity reservations. Must + /// be today or within 56 days in the future. For same-day scheduling, requests + /// must be submitted before 11:30 AM UTC. Example: 2025-06-27. /// - [JsonProperty(PropertyName = "start")] - public string Start { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "start")] + public string Start {get; set; } /// - /// Gets or sets the required end date for block capacity reservations. - /// Must be after the start date, with a duration of either 1–14 whole - /// days or 3–26 whole weeks. Example: 2025-06-28. + /// Gets or sets the required end date for block capacity reservations. Must be + /// after the start date, with a duration of either 1–14 whole days or 3–26 + /// whole weeks. Example: 2025-06-28. /// - [JsonProperty(PropertyName = "end")] - public string End { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "end")] + public string End {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ScheduledEventsAdditionalPublishingTargets.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ScheduledEventsAdditionalPublishingTargets.cs index 076aaf123802..e2a53c6a8ea7 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ScheduledEventsAdditionalPublishingTargets.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ScheduledEventsAdditionalPublishingTargets.cs @@ -1,23 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; public partial class ScheduledEventsAdditionalPublishingTargets { /// - /// Initializes a new instance of the - /// ScheduledEventsAdditionalPublishingTargets class. + /// Initializes a new instance of the ScheduledEventsAdditionalPublishingTargets class. /// public ScheduledEventsAdditionalPublishingTargets() { @@ -25,15 +18,16 @@ public ScheduledEventsAdditionalPublishingTargets() } /// - /// Initializes a new instance of the - /// ScheduledEventsAdditionalPublishingTargets class. + /// Initializes a new instance of the ScheduledEventsAdditionalPublishingTargets class. /// - /// The configuration - /// parameters used while creating eventGridAndResourceGraph Scheduled - /// Event setting. + + /// The configuration parameters used while creating eventGridAndResourceGraph + /// Scheduled Event setting. + /// public ScheduledEventsAdditionalPublishingTargets(EventGridAndResourceGraph eventGridAndResourceGraph = default(EventGridAndResourceGraph)) + { - EventGridAndResourceGraph = eventGridAndResourceGraph; + this.EventGridAndResourceGraph = eventGridAndResourceGraph; CustomInit(); } @@ -42,12 +36,12 @@ public ScheduledEventsAdditionalPublishingTargets() /// partial void CustomInit(); + /// /// Gets or sets the configuration parameters used while creating /// eventGridAndResourceGraph Scheduled Event setting. /// - [JsonProperty(PropertyName = "eventGridAndResourceGraph")] - public EventGridAndResourceGraph EventGridAndResourceGraph { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "eventGridAndResourceGraph")] + public EventGridAndResourceGraph EventGridAndResourceGraph {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ScheduledEventsPolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ScheduledEventsPolicy.cs index 357b2c6b2af7..f6d4ea624310 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ScheduledEventsPolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ScheduledEventsPolicy.cs @@ -1,22 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Specifies Redeploy, Reboot and - /// ScheduledEventsAdditionalPublishingTargets Scheduled Event related - /// configurations. + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets + /// Scheduled Event related configurations. /// public partial class ScheduledEventsPolicy { @@ -31,24 +24,29 @@ public ScheduledEventsPolicy() /// /// Initializes a new instance of the ScheduledEventsPolicy class. /// - /// The configuration parameters - /// used while creating userInitiatedRedeploy scheduled event setting - /// creation. - /// The configuration parameters used - /// while creating userInitiatedReboot scheduled event setting - /// creation. - /// The - /// configuration parameters used while publishing - /// scheduledEventsAdditionalPublishingTargets. - /// The configuration parameters used - /// while creating AllInstancesDown scheduled event setting - /// creation. + + /// The configuration parameters used while creating userInitiatedRedeploy + /// scheduled event setting creation. + /// + + /// The configuration parameters used while creating userInitiatedReboot + /// scheduled event setting creation. + /// + + /// The configuration parameters used while publishing + /// scheduledEventsAdditionalPublishingTargets. + /// + + /// The configuration parameters used while creating AllInstancesDown scheduled + /// event setting creation. + /// public ScheduledEventsPolicy(UserInitiatedRedeploy userInitiatedRedeploy = default(UserInitiatedRedeploy), UserInitiatedReboot userInitiatedReboot = default(UserInitiatedReboot), ScheduledEventsAdditionalPublishingTargets scheduledEventsAdditionalPublishingTargets = default(ScheduledEventsAdditionalPublishingTargets), AllInstancesDown allInstancesDown = default(AllInstancesDown)) + { - UserInitiatedRedeploy = userInitiatedRedeploy; - UserInitiatedReboot = userInitiatedReboot; - ScheduledEventsAdditionalPublishingTargets = scheduledEventsAdditionalPublishingTargets; - AllInstancesDown = allInstancesDown; + this.UserInitiatedRedeploy = userInitiatedRedeploy; + this.UserInitiatedReboot = userInitiatedReboot; + this.ScheduledEventsAdditionalPublishingTargets = scheduledEventsAdditionalPublishingTargets; + this.AllInstancesDown = allInstancesDown; CustomInit(); } @@ -57,33 +55,33 @@ public ScheduledEventsPolicy() /// partial void CustomInit(); + /// /// Gets or sets the configuration parameters used while creating /// userInitiatedRedeploy scheduled event setting creation. /// - [JsonProperty(PropertyName = "userInitiatedRedeploy")] - public UserInitiatedRedeploy UserInitiatedRedeploy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "userInitiatedRedeploy")] + public UserInitiatedRedeploy UserInitiatedRedeploy {get; set; } /// /// Gets or sets the configuration parameters used while creating /// userInitiatedReboot scheduled event setting creation. /// - [JsonProperty(PropertyName = "userInitiatedReboot")] - public UserInitiatedReboot UserInitiatedReboot { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "userInitiatedReboot")] + public UserInitiatedReboot UserInitiatedReboot {get; set; } /// /// Gets or sets the configuration parameters used while publishing /// scheduledEventsAdditionalPublishingTargets. /// - [JsonProperty(PropertyName = "scheduledEventsAdditionalPublishingTargets")] - public ScheduledEventsAdditionalPublishingTargets ScheduledEventsAdditionalPublishingTargets { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "scheduledEventsAdditionalPublishingTargets")] + public ScheduledEventsAdditionalPublishingTargets ScheduledEventsAdditionalPublishingTargets {get; set; } /// /// Gets or sets the configuration parameters used while creating /// AllInstancesDown scheduled event setting creation. /// - [JsonProperty(PropertyName = "allInstancesDown")] - public AllInstancesDown AllInstancesDown { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "allInstancesDown")] + public AllInstancesDown AllInstancesDown {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ScheduledEventsProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ScheduledEventsProfile.cs index 6db4280f07c6..164240a2425b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ScheduledEventsProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ScheduledEventsProfile.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; public partial class ScheduledEventsProfile @@ -26,14 +20,17 @@ public ScheduledEventsProfile() /// /// Initializes a new instance of the ScheduledEventsProfile class. /// - /// Specifies Terminate - /// Scheduled Event related configurations. - /// Specifies OS Image - /// Scheduled Event related configurations. + + /// Specifies Terminate Scheduled Event related configurations. + /// + + /// Specifies OS Image Scheduled Event related configurations. + /// public ScheduledEventsProfile(TerminateNotificationProfile terminateNotificationProfile = default(TerminateNotificationProfile), OSImageNotificationProfile osImageNotificationProfile = default(OSImageNotificationProfile)) + { - TerminateNotificationProfile = terminateNotificationProfile; - OsImageNotificationProfile = osImageNotificationProfile; + this.TerminateNotificationProfile = terminateNotificationProfile; + this.OsImageNotificationProfile = osImageNotificationProfile; CustomInit(); } @@ -42,19 +39,17 @@ public ScheduledEventsProfile() /// partial void CustomInit(); + /// - /// Gets or sets specifies Terminate Scheduled Event related - /// configurations. + /// Gets or sets specifies Terminate Scheduled Event related configurations. /// - [JsonProperty(PropertyName = "terminateNotificationProfile")] - public TerminateNotificationProfile TerminateNotificationProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "terminateNotificationProfile")] + public TerminateNotificationProfile TerminateNotificationProfile {get; set; } /// - /// Gets or sets specifies OS Image Scheduled Event related - /// configurations. + /// Gets or sets specifies OS Image Scheduled Event related configurations. /// - [JsonProperty(PropertyName = "osImageNotificationProfile")] - public OSImageNotificationProfile OsImageNotificationProfile { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "osImageNotificationProfile")] + public OSImageNotificationProfile OsImageNotificationProfile {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ScriptShellTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ScriptShellTypes.cs index 8bc2e7de8ebb..c967c10d3bd5 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ScriptShellTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ScriptShellTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ScriptShellTypes. /// + + public static class ScriptShellTypes { /// @@ -25,4 +22,4 @@ public static class ScriptShellTypes /// public const string Powershell7 = "Powershell7"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityEncryptionTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityEncryptionTypes.cs index 9a0ed21ec7c7..27a46a4277cb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityEncryptionTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityEncryptionTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for SecurityEncryptionTypes. /// + + public static class SecurityEncryptionTypes { public const string VMGuestStateOnly = "VMGuestStateOnly"; public const string DiskWithVMGuestState = "DiskWithVMGuestState"; public const string NonPersistedTPM = "NonPersistedTPM"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityPostureReference.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityPostureReference.cs index fd2a93573d74..9369fe8040cd 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityPostureReference.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityPostureReference.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -33,18 +24,23 @@ public SecurityPostureReference() /// /// Initializes a new instance of the SecurityPostureReference class. /// + /// The security posture reference id in the form of - /// /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest - /// The list of virtual machine - /// extension names to exclude when applying the security - /// posture. - /// Whether the security posture can be - /// overridden by the user. - public SecurityPostureReference(string id, IList excludeExtensions = default(IList), bool? isOverridable = default(bool?)) + /// /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest + /// + + /// The list of virtual machine extension names to exclude when applying the + /// security posture. + /// + + /// Whether the security posture can be overridden by the user. + /// + public SecurityPostureReference(string id, System.Collections.Generic.IList excludeExtensions = default(System.Collections.Generic.IList), bool? isOverridable = default(bool?)) + { - Id = id; - ExcludeExtensions = excludeExtensions; - IsOverridable = isOverridable; + this.Id = id; + this.ExcludeExtensions = excludeExtensions; + this.IsOverridable = isOverridable; CustomInit(); } @@ -53,39 +49,40 @@ public SecurityPostureReference() /// partial void CustomInit(); + /// /// Gets or sets the security posture reference id in the form of /// /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// - /// Gets or sets the list of virtual machine extension names to exclude - /// when applying the security posture. + /// Gets or sets the list of virtual machine extension names to exclude when + /// applying the security posture. /// - [JsonProperty(PropertyName = "excludeExtensions")] - public IList ExcludeExtensions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "excludeExtensions")] + public System.Collections.Generic.IList ExcludeExtensions {get; set; } /// - /// Gets or sets whether the security posture can be overridden by the - /// user. + /// Gets or sets whether the security posture can be overridden by the user. /// - [JsonProperty(PropertyName = "isOverridable")] - public bool? IsOverridable { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "isOverridable")] + public bool? IsOverridable {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Id == null) + if (this.Id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityPostureReferenceUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityPostureReferenceUpdate.cs index b4ae91d66abd..3749d1d49709 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityPostureReferenceUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityPostureReferenceUpdate.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +14,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class SecurityPostureReferenceUpdate { /// - /// Initializes a new instance of the SecurityPostureReferenceUpdate - /// class. + /// Initializes a new instance of the SecurityPostureReferenceUpdate class. /// public SecurityPostureReferenceUpdate() { @@ -31,21 +22,25 @@ public SecurityPostureReferenceUpdate() } /// - /// Initializes a new instance of the SecurityPostureReferenceUpdate - /// class. + /// Initializes a new instance of the SecurityPostureReferenceUpdate class. /// + /// The security posture reference id in the form of - /// /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest - /// The list of virtual machine - /// extension names to exclude when applying the security - /// posture. - /// Whether the security posture can be - /// overridden by the user. - public SecurityPostureReferenceUpdate(string id = default(string), IList excludeExtensions = default(IList), bool? isOverridable = default(bool?)) + /// /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest + /// + + /// The list of virtual machine extension names to exclude when applying the + /// security posture. + /// + + /// Whether the security posture can be overridden by the user. + /// + public SecurityPostureReferenceUpdate(string id = default(string), System.Collections.Generic.IList excludeExtensions = default(System.Collections.Generic.IList), bool? isOverridable = default(bool?)) + { - Id = id; - ExcludeExtensions = excludeExtensions; - IsOverridable = isOverridable; + this.Id = id; + this.ExcludeExtensions = excludeExtensions; + this.IsOverridable = isOverridable; CustomInit(); } @@ -54,26 +49,25 @@ public SecurityPostureReferenceUpdate() /// partial void CustomInit(); + /// /// Gets or sets the security posture reference id in the form of /// /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// - /// Gets or sets the list of virtual machine extension names to exclude - /// when applying the security posture. + /// Gets or sets the list of virtual machine extension names to exclude when + /// applying the security posture. /// - [JsonProperty(PropertyName = "excludeExtensions")] - public IList ExcludeExtensions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "excludeExtensions")] + public System.Collections.Generic.IList ExcludeExtensions {get; set; } /// - /// Gets or sets whether the security posture can be overridden by the - /// user. + /// Gets or sets whether the security posture can be overridden by the user. /// - [JsonProperty(PropertyName = "isOverridable")] - public bool? IsOverridable { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "isOverridable")] + public bool? IsOverridable {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityProfile.cs index e1b1f4c40393..4d998e440800 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityProfile.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Specifies the Security profile settings for the virtual machine or - /// virtual machine scale set. + /// Specifies the Security profile settings for the virtual machine or virtual + /// machine scale set. /// public partial class SecurityProfile { @@ -30,33 +24,38 @@ public SecurityProfile() /// /// Initializes a new instance of the SecurityProfile class. /// - /// Specifies the security settings like - /// secure boot and vTPM used while creating the virtual machine. - /// Minimum api-version: 2020-12-01. - /// This property can be used by user in - /// the request to enable or disable the Host Encryption for the - /// virtual machine or virtual machine scale set. This will enable the - /// encryption for all the disks including Resource/Temp disk at host - /// itself. The default behavior is: The Encryption at host will be - /// disabled unless this property is set to true for the - /// resource. - /// Specifies the SecurityType of the - /// virtual machine. It has to be set to any specified value to enable - /// UefiSettings. The default behavior is: UefiSettings will not be - /// enabled unless this property is set. Possible values include: - /// 'TrustedLaunch', 'ConfidentialVM' - /// Specifies the Managed Identity - /// used by ADE to get access token for keyvault operations. - /// Specifies ProxyAgent settings - /// while creating the virtual machine. Minimum api-version: - /// 2023-09-01. + + /// Specifies the security settings like secure boot and vTPM used while + /// creating the virtual machine. Minimum api-version: 2020-12-01. + /// + + /// This property can be used by user in the request to enable or disable the + /// Host Encryption for the virtual machine or virtual machine scale set. This + /// will enable the encryption for all the disks including Resource/Temp disk + /// at host itself. The default behavior is: The Encryption at host will be + /// disabled unless this property is set to true for the resource. + /// + + /// Specifies the SecurityType of the virtual machine. It has to be set to any + /// specified value to enable UefiSettings. The default behavior is: + /// UefiSettings will not be enabled unless this property is set. + /// Possible values include: 'TrustedLaunch', 'ConfidentialVM' + + /// Specifies the Managed Identity used by ADE to get access token for keyvault + /// operations. + /// + + /// Specifies ProxyAgent settings while creating the virtual machine. Minimum + /// api-version: 2023-09-01. + /// public SecurityProfile(UefiSettings uefiSettings = default(UefiSettings), bool? encryptionAtHost = default(bool?), string securityType = default(string), EncryptionIdentity encryptionIdentity = default(EncryptionIdentity), ProxyAgentSettings proxyAgentSettings = default(ProxyAgentSettings)) + { - UefiSettings = uefiSettings; - EncryptionAtHost = encryptionAtHost; - SecurityType = securityType; - EncryptionIdentity = encryptionIdentity; - ProxyAgentSettings = proxyAgentSettings; + this.UefiSettings = uefiSettings; + this.EncryptionAtHost = encryptionAtHost; + this.SecurityType = securityType; + this.EncryptionIdentity = encryptionIdentity; + this.ProxyAgentSettings = proxyAgentSettings; CustomInit(); } @@ -65,48 +64,45 @@ public SecurityProfile() /// partial void CustomInit(); + /// - /// Gets or sets specifies the security settings like secure boot and - /// vTPM used while creating the virtual machine. Minimum api-version: - /// 2020-12-01. + /// Gets or sets specifies the security settings like secure boot and vTPM used + /// while creating the virtual machine. Minimum api-version: 2020-12-01. /// - [JsonProperty(PropertyName = "uefiSettings")] - public UefiSettings UefiSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "uefiSettings")] + public UefiSettings UefiSettings {get; set; } /// - /// Gets or sets this property can be used by user in the request to - /// enable or disable the Host Encryption for the virtual machine or - /// virtual machine scale set. This will enable the encryption for all - /// the disks including Resource/Temp disk at host itself. The default - /// behavior is: The Encryption at host will be disabled unless this - /// property is set to true for the resource. + /// Gets or sets this property can be used by user in the request to enable or + /// disable the Host Encryption for the virtual machine or virtual machine + /// scale set. This will enable the encryption for all the disks including + /// Resource/Temp disk at host itself. The default behavior is: The Encryption + /// at host will be disabled unless this property is set to true for the + /// resource. /// - [JsonProperty(PropertyName = "encryptionAtHost")] - public bool? EncryptionAtHost { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptionAtHost")] + public bool? EncryptionAtHost {get; set; } /// - /// Gets or sets specifies the SecurityType of the virtual machine. It - /// has to be set to any specified value to enable UefiSettings. The - /// default behavior is: UefiSettings will not be enabled unless this - /// property is set. Possible values include: 'TrustedLaunch', - /// 'ConfidentialVM' + /// Gets or sets specifies the SecurityType of the virtual machine. It has to + /// be set to any specified value to enable UefiSettings. The default behavior + /// is: UefiSettings will not be enabled unless this property is set. Possible values include: 'TrustedLaunch', 'ConfidentialVM' /// - [JsonProperty(PropertyName = "securityType")] - public string SecurityType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "securityType")] + public string SecurityType {get; set; } /// - /// Gets or sets specifies the Managed Identity used by ADE to get - /// access token for keyvault operations. + /// Gets or sets specifies the Managed Identity used by ADE to get access token + /// for keyvault operations. /// - [JsonProperty(PropertyName = "encryptionIdentity")] - public EncryptionIdentity EncryptionIdentity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptionIdentity")] + public EncryptionIdentity EncryptionIdentity {get; set; } /// - /// Gets or sets specifies ProxyAgent settings while creating the - /// virtual machine. Minimum api-version: 2023-09-01. + /// Gets or sets specifies ProxyAgent settings while creating the virtual + /// machine. Minimum api-version: 2023-09-01. /// - [JsonProperty(PropertyName = "proxyAgentSettings")] - public ProxyAgentSettings ProxyAgentSettings { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "proxyAgentSettings")] + public ProxyAgentSettings ProxyAgentSettings {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityTypes.cs index 4c887f9ed9f1..858e82c27cef 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SecurityTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for SecurityTypes. /// + + public static class SecurityTypes { public const string TrustedLaunch = "TrustedLaunch"; public const string ConfidentialVM = "ConfidentialVM"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SelectPermissions.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SelectPermissions.cs index dcd358cd68e3..a8685ae9bd1c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SelectPermissions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SelectPermissions.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for SelectPermissions. /// + + public static class SelectPermissions { public const string Permissions = "Permissions"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ServiceArtifactReference.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ServiceArtifactReference.cs index 4a669fe704c4..a353dce89d72 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ServiceArtifactReference.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ServiceArtifactReference.cs @@ -1,22 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Specifies the service artifact reference id used to set same image - /// version for all virtual machines in the scale set when using 'latest' - /// image version. Minimum api-version: 2022-11-01 + /// Specifies the service artifact reference id used to set same image version + /// for all virtual machines in the scale set when using 'latest' image + /// version. Minimum api-version: 2022-11-01 /// public partial class ServiceArtifactReference { @@ -31,11 +25,14 @@ public ServiceArtifactReference() /// /// Initializes a new instance of the ServiceArtifactReference class. /// + /// The service artifact reference id in the form of - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName} + /// public ServiceArtifactReference(string id = default(string)) + { - Id = id; + this.Id = id; CustomInit(); } @@ -44,12 +41,12 @@ public ServiceArtifactReference() /// partial void CustomInit(); + /// /// Gets or sets the service artifact reference id in the form of /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName} /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SettingNames.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SettingNames.cs index 85f6a7b9dd6c..f04cd8ffc3d7 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SettingNames.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SettingNames.cs @@ -1,29 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for SettingNames. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum SettingNames { - [EnumMember(Value = "AutoLogon")] + [System.Runtime.Serialization.EnumMember(Value = "AutoLogon")] AutoLogon, - [EnumMember(Value = "FirstLogonCommands")] + [System.Runtime.Serialization.EnumMember(Value = "FirstLogonCommands")] FirstLogonCommands } internal static class SettingNamesEnumExtension @@ -32,7 +25,6 @@ internal static string ToSerializedValue(this SettingNames? value) { return value == null ? null : ((SettingNames)value).ToSerializedValue(); } - internal static string ToSerializedValue(this SettingNames value) { switch( value ) @@ -44,7 +36,6 @@ internal static string ToSerializedValue(this SettingNames value) } return null; } - internal static SettingNames? ParseSettingNames(this string value) { switch( value ) @@ -57,4 +48,4 @@ internal static string ToSerializedValue(this SettingNames value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ShareInfoElement.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ShareInfoElement.cs index 95303e80160e..2e7d70a9fb72 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ShareInfoElement.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ShareInfoElement.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; public partial class ShareInfoElement @@ -26,11 +20,13 @@ public ShareInfoElement() /// /// Initializes a new instance of the ShareInfoElement class. /// - /// A relative URI containing the ID of the VM that - /// has the disk attached. + + /// A relative URI containing the ID of the VM that has the disk attached. + /// public ShareInfoElement(string vmUri = default(string)) + { - VmUri = vmUri; + this.VmUri = vmUri; CustomInit(); } @@ -39,12 +35,11 @@ public ShareInfoElement() /// partial void CustomInit(); + /// - /// Gets a relative URI containing the ID of the VM that has the disk - /// attached. + /// Gets a relative URI containing the ID of the VM that has the disk attached. /// - [JsonProperty(PropertyName = "vmUri")] - public string VmUri { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "vmUri")] + public string VmUri {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGallery.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGallery.cs index 62180369298e..a228404531e9 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGallery.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGallery.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Specifies information about the Shared Gallery that you want to create - /// or update. + /// Specifies information about the Shared Gallery that you want to create or + /// update. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class SharedGallery : PirSharedGalleryResource { /// @@ -35,16 +25,23 @@ public SharedGallery() /// /// Initializes a new instance of the SharedGallery class. /// - /// Resource name - /// Resource location - /// The unique id of this shared - /// gallery. - /// The artifact tags of a shared gallery - /// resource. - public SharedGallery(string name = default(string), string location = default(string), string uniqueId = default(string), IDictionary artifactTags = default(IDictionary)) - : base(name, location, uniqueId) + + /// Resource name + /// + + /// Resource location + /// + + /// The unique id of this shared gallery. + /// + + /// The artifact tags of a shared gallery resource. + /// + public SharedGallery(string name = default(string), string location = default(string), string uniqueId = default(string), System.Collections.Generic.IDictionary artifactTags = default(System.Collections.Generic.IDictionary)) + + : base(name, location, uniqueId) { - ArtifactTags = artifactTags; + this.ArtifactTags = artifactTags; CustomInit(); } @@ -53,11 +50,11 @@ public SharedGallery() /// partial void CustomInit(); + /// /// Gets the artifact tags of a shared gallery resource. /// - [JsonProperty(PropertyName = "properties.artifactTags")] - public IDictionary ArtifactTags { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.artifactTags")] + public System.Collections.Generic.IDictionary ArtifactTags {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryDataDiskImage.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryDataDiskImage.cs index 62c2d060be59..47107a50b794 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryDataDiskImage.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryDataDiskImage.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,19 +23,24 @@ public SharedGalleryDataDiskImage() /// /// Initializes a new instance of the SharedGalleryDataDiskImage class. /// - /// This property specifies the logical unit number - /// of the data disk. This value is used to identify data disks within - /// the Virtual Machine and therefore must be unique for each data disk - /// attached to the Virtual Machine. - /// This property indicates the size of the - /// VHD to be created. - /// The host caching of the disk. Valid - /// values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values - /// include: 'None', 'ReadOnly', 'ReadWrite' - public SharedGalleryDataDiskImage(int lun, int? diskSizeGB = default(int?), string hostCaching = default(string)) - : base(diskSizeGB, hostCaching) + + /// This property indicates the size of the VHD to be created. + /// + + /// The host caching of the disk. Valid values are 'None', 'ReadOnly', and + /// 'ReadWrite' + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + + /// This property specifies the logical unit number of the data disk. This + /// value is used to identify data disks within the Virtual Machine and + /// therefore must be unique for each data disk attached to the Virtual + /// Machine. + /// + public SharedGalleryDataDiskImage(int lun, int? diskSizeGb = default(int?), string hostCaching = default(string)) + + : base(diskSizeGb, hostCaching) { - Lun = lun; + this.Lun = lun; CustomInit(); } @@ -50,19 +49,19 @@ public SharedGalleryDataDiskImage() /// partial void CustomInit(); + /// - /// Gets or sets this property specifies the logical unit number of the - /// data disk. This value is used to identify data disks within the - /// Virtual Machine and therefore must be unique for each data disk - /// attached to the Virtual Machine. + /// Gets or sets this property specifies the logical unit number of the data + /// disk. This value is used to identify data disks within the Virtual Machine + /// and therefore must be unique for each data disk attached to the Virtual + /// Machine. /// - [JsonProperty(PropertyName = "lun")] - public int Lun { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "lun")] + public int Lun {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() @@ -70,4 +69,4 @@ public virtual void Validate() //Nothing to validate } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryDiskImage.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryDiskImage.cs index 590ac0462327..82fdde5e60d6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryDiskImage.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryDiskImage.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,15 +23,18 @@ public SharedGalleryDiskImage() /// /// Initializes a new instance of the SharedGalleryDiskImage class. /// - /// This property indicates the size of the - /// VHD to be created. - /// The host caching of the disk. Valid - /// values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values - /// include: 'None', 'ReadOnly', 'ReadWrite' - public SharedGalleryDiskImage(int? diskSizeGB = default(int?), string hostCaching = default(string)) + + /// This property indicates the size of the VHD to be created. + /// + + /// The host caching of the disk. Valid values are 'None', 'ReadOnly', and + /// 'ReadWrite' + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + public SharedGalleryDiskImage(int? diskSizeGb = default(int?), string hostCaching = default(string)) + { - DiskSizeGB = diskSizeGB; - HostCaching = hostCaching; + this.DiskSizeGB = diskSizeGb; + this.HostCaching = hostCaching; CustomInit(); } @@ -46,19 +43,18 @@ public SharedGalleryDiskImage() /// partial void CustomInit(); + /// /// Gets this property indicates the size of the VHD to be created. /// - [JsonProperty(PropertyName = "diskSizeGB")] - public int? DiskSizeGB { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeGB")] + public int? DiskSizeGB {get; private set; } /// - /// Gets or sets the host caching of the disk. Valid values are 'None', - /// 'ReadOnly', and 'ReadWrite'. Possible values include: 'None', - /// 'ReadOnly', 'ReadWrite' + /// Gets or sets the host caching of the disk. Valid values are 'None', + /// 'ReadOnly', and 'ReadWrite' Possible values include: 'None', 'ReadOnly', 'ReadWrite' /// - [JsonProperty(PropertyName = "hostCaching")] - public string HostCaching { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "hostCaching")] + public string HostCaching {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryHostCaching.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryHostCaching.cs index 84edad26f060..1b3607caced3 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryHostCaching.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryHostCaching.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for SharedGalleryHostCaching. /// + + public static class SharedGalleryHostCaching { public const string None = "None"; public const string ReadOnly = "ReadOnly"; public const string ReadWrite = "ReadWrite"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryIdentifier.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryIdentifier.cs new file mode 100644 index 000000000000..1891a7dc39aa --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryIdentifier.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// The identifier information of shared gallery. + /// + public partial class SharedGalleryIdentifier + { + /// + /// Initializes a new instance of the SharedGalleryIdentifier class. + /// + public SharedGalleryIdentifier() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SharedGalleryIdentifier class. + /// + + /// The unique id of this shared gallery. + /// + public SharedGalleryIdentifier(string uniqueId = default(string)) + + { + this.UniqueId = uniqueId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the unique id of this shared gallery. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueId")] + public string UniqueId {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImage.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImage.cs index 96755f918db3..6b6f96f761f0 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImage.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImage.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Specifies information about the gallery image definition that you want - /// to create or update. + /// Specifies information about the gallery image definition that you want to + /// create or update. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class SharedGalleryImage : PirSharedGalleryResource { /// @@ -35,59 +25,78 @@ public SharedGalleryImage() /// /// Initializes a new instance of the SharedGalleryImage class. /// - /// This property allows you to specify the type - /// of the OS that is included in the disk when creating a VM from a - /// managed image. Possible values are: **Windows,** **Linux.**. - /// Possible values include: 'Windows', 'Linux' - /// This property allows the user to specify - /// whether the virtual machines created under this image are - /// 'Generalized' or 'Specialized'. Possible values include: - /// 'Generalized', 'Specialized' - /// This is the gallery image definition - /// identifier. - /// Resource name - /// Resource location - /// The unique id of this shared - /// gallery. - /// The end of life date of the gallery - /// image definition. This property can be used for decommissioning - /// purposes. This property is updatable. - /// The properties describe the recommended - /// machine configuration for this Image Definition. These properties - /// are updatable. - /// Describes the disallowed disk - /// types. - /// The hypervisor generation of the - /// Virtual Machine. Applicable to OS disks only. Possible values - /// include: 'V1', 'V2' - /// A list of gallery image features. - /// Describes the gallery image definition - /// purchase plan. This is used by marketplace images. - /// The architecture of the image. - /// Applicable to OS disks only. Possible values include: 'x64', - /// 'Arm64' - /// Privacy statement uri for the - /// current community gallery image. - /// End-user license agreement for the current - /// community gallery image. - /// The artifact tags of a shared gallery - /// resource. - public SharedGalleryImage(OperatingSystemTypes osType, OperatingSystemStateTypes osState, GalleryImageIdentifier identifier, string name = default(string), string location = default(string), string uniqueId = default(string), System.DateTime? endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), string hyperVGeneration = default(string), IList features = default(IList), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string architecture = default(string), string privacyStatementUri = default(string), string eula = default(string), IDictionary artifactTags = default(IDictionary)) - : base(name, location, uniqueId) + + /// Resource name + /// + + /// Resource location + /// + + /// The unique id of this shared gallery. + /// + + /// Describes the disallowed disk types. + /// + + /// The architecture of the image. Applicable to OS disks only. + /// Possible values include: 'x64', 'Arm64' + + /// This property allows you to specify the type of the OS that is included in + /// the disk when creating a VM from a managed image. Possible values are: + /// **Windows,** **Linux.** + /// Possible values include: 'Windows', 'Linux' + + /// This property allows the user to specify whether the virtual machines + /// created under this image are 'Generalized' or 'Specialized'. + /// Possible values include: 'Generalized', 'Specialized' + + /// The end of life date of the gallery image definition. This property can be + /// used for decommissioning purposes. This property is updatable. + /// + + /// This is the gallery image definition identifier. + /// + + /// The properties describe the recommended machine configuration for this + /// Image Definition. These properties are updatable. + /// + + /// The hypervisor generation of the Virtual Machine. Applicable to OS disks + /// only. + /// Possible values include: 'V1', 'V2' + + /// A list of gallery image features. + /// + + /// Describes the gallery image definition purchase plan. This is used by + /// marketplace images. + /// + + /// Privacy statement uri for the current community gallery image. + /// + + /// End-user license agreement for the current community gallery image. + /// + + /// The artifact tags of a shared gallery resource. + /// + public SharedGalleryImage(string name = default(string), string location = default(string), string uniqueId = default(string), Disallowed disallowed = default(Disallowed), string architecture = default(string), OperatingSystemTypes? osType = default(OperatingSystemTypes?), OperatingSystemStateTypes? osState = default(OperatingSystemStateTypes?), System.DateTime? endOfLifeDate = default(System.DateTime?), GalleryImageIdentifier propertiesIdentifier = default(GalleryImageIdentifier), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), string hyperVGeneration = default(string), System.Collections.Generic.IList features = default(System.Collections.Generic.IList), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string privacyStatementUri = default(string), string eula = default(string), System.Collections.Generic.IDictionary artifactTags = default(System.Collections.Generic.IDictionary)) + + : base(name, location, uniqueId) { - OsType = osType; - OsState = osState; - EndOfLifeDate = endOfLifeDate; - Identifier = identifier; - Recommended = recommended; - Disallowed = disallowed; - HyperVGeneration = hyperVGeneration; - Features = features; - PurchasePlan = purchasePlan; - Architecture = architecture; - PrivacyStatementUri = privacyStatementUri; - Eula = eula; - ArtifactTags = artifactTags; + this.Disallowed = disallowed; + this.Architecture = architecture; + this.OsType = osType; + this.OsState = osState; + this.EndOfLifeDate = endOfLifeDate; + this.PropertiesIdentifier = propertiesIdentifier; + this.Recommended = recommended; + this.HyperVGeneration = hyperVGeneration; + this.Features = features; + this.PurchasePlan = purchasePlan; + this.PrivacyStatementUri = privacyStatementUri; + this.Eula = eula; + this.ArtifactTags = artifactTags; CustomInit(); } @@ -96,115 +105,116 @@ public SharedGalleryImage() /// partial void CustomInit(); + /// - /// Gets or sets this property allows you to specify the type of the OS - /// that is included in the disk when creating a VM from a managed - /// image. Possible values are: **Windows,** **Linux.**. Possible - /// values include: 'Windows', 'Linux' + /// Gets or sets describes the disallowed disk types. /// - [JsonProperty(PropertyName = "properties.osType")] - public OperatingSystemTypes OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disallowed")] + public Disallowed Disallowed {get; set; } /// - /// Gets or sets this property allows the user to specify whether the - /// virtual machines created under this image are 'Generalized' or - /// 'Specialized'. Possible values include: 'Generalized', - /// 'Specialized' + /// Gets or sets the architecture of the image. Applicable to OS disks only. Possible values include: 'x64', 'Arm64' /// - [JsonProperty(PropertyName = "properties.osState")] - public OperatingSystemStateTypes OsState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.architecture")] + public string Architecture {get; set; } /// - /// Gets or sets the end of life date of the gallery image definition. - /// This property can be used for decommissioning purposes. This - /// property is updatable. + /// Gets or sets this property allows you to specify the type of the OS that is + /// included in the disk when creating a VM from a managed image. Possible + /// values are: **Windows,** **Linux.** Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "properties.endOfLifeDate")] - public System.DateTime? EndOfLifeDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osType")] + public OperatingSystemTypes? OsType {get; set; } /// - /// Gets or sets this is the gallery image definition identifier. + /// Gets or sets this property allows the user to specify whether the virtual + /// machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'Generalized', 'Specialized' /// - [JsonProperty(PropertyName = "properties.identifier")] - public GalleryImageIdentifier Identifier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osState")] + public OperatingSystemStateTypes? OsState {get; set; } /// - /// Gets or sets the properties describe the recommended machine - /// configuration for this Image Definition. These properties are + /// Gets or sets the end of life date of the gallery image definition. This + /// property can be used for decommissioning purposes. This property is /// updatable. /// - [JsonProperty(PropertyName = "properties.recommended")] - public RecommendedMachineConfiguration Recommended { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.endOfLifeDate")] + public System.DateTime? EndOfLifeDate {get; set; } /// - /// Gets or sets describes the disallowed disk types. + /// Gets or sets this is the gallery image definition identifier. /// - [JsonProperty(PropertyName = "properties.disallowed")] - public Disallowed Disallowed { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.identifier")] + public GalleryImageIdentifier PropertiesIdentifier {get; set; } /// - /// Gets or sets the hypervisor generation of the Virtual Machine. - /// Applicable to OS disks only. Possible values include: 'V1', 'V2' + /// Gets or sets the properties describe the recommended machine configuration + /// for this Image Definition. These properties are updatable. /// - [JsonProperty(PropertyName = "properties.hyperVGeneration")] - public string HyperVGeneration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.recommended")] + public RecommendedMachineConfiguration Recommended {get; set; } /// - /// Gets or sets a list of gallery image features. + /// Gets or sets the hypervisor generation of the Virtual Machine. Applicable + /// to OS disks only. Possible values include: 'V1', 'V2' /// - [JsonProperty(PropertyName = "properties.features")] - public IList Features { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hyperVGeneration")] + public string HyperVGeneration {get; set; } /// - /// Gets or sets describes the gallery image definition purchase plan. - /// This is used by marketplace images. + /// Gets or sets a list of gallery image features. /// - [JsonProperty(PropertyName = "properties.purchasePlan")] - public ImagePurchasePlan PurchasePlan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.features")] + public System.Collections.Generic.IList Features {get; set; } /// - /// Gets or sets the architecture of the image. Applicable to OS disks - /// only. Possible values include: 'x64', 'Arm64' + /// Gets or sets describes the gallery image definition purchase plan. This is + /// used by marketplace images. /// - [JsonProperty(PropertyName = "properties.architecture")] - public string Architecture { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.purchasePlan")] + public ImagePurchasePlan PurchasePlan {get; set; } /// - /// Gets or sets privacy statement uri for the current community - /// gallery image. + /// Gets or sets privacy statement uri for the current community gallery image. /// - [JsonProperty(PropertyName = "properties.privacyStatementUri")] - public string PrivacyStatementUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privacyStatementUri")] + public string PrivacyStatementUri {get; set; } /// - /// Gets or sets end-user license agreement for the current community - /// gallery image. + /// Gets or sets end-user license agreement for the current community gallery + /// image. /// - [JsonProperty(PropertyName = "properties.eula")] - public string Eula { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.eula")] + public string Eula {get; set; } /// /// Gets or sets the artifact tags of a shared gallery resource. /// - [JsonProperty(PropertyName = "properties.artifactTags")] - public IDictionary ArtifactTags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.artifactTags")] + public System.Collections.Generic.IDictionary ArtifactTags {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Identifier == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Identifier"); - } - if (Identifier != null) + + + + + if (this.PropertiesIdentifier != null) { - Identifier.Validate(); + this.PropertiesIdentifier.Validate(); } + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImageProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImageProperties.cs new file mode 100644 index 000000000000..fedceff3ba33 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImageProperties.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a gallery image definition. + /// + public partial class SharedGalleryImageProperties + { + /// + /// Initializes a new instance of the SharedGalleryImageProperties class. + /// + public SharedGalleryImageProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SharedGalleryImageProperties class. + /// + + /// This property allows you to specify the type of the OS that is included in + /// the disk when creating a VM from a managed image. Possible values are: + /// **Windows,** **Linux.** + /// Possible values include: 'Windows', 'Linux' + + /// This property allows the user to specify whether the virtual machines + /// created under this image are 'Generalized' or 'Specialized'. + /// Possible values include: 'Generalized', 'Specialized' + + /// The end of life date of the gallery image definition. This property can be + /// used for decommissioning purposes. This property is updatable. + /// + + /// This is the gallery image definition identifier. + /// + + /// The properties describe the recommended machine configuration for this + /// Image Definition. These properties are updatable. + /// + + /// Describes the disallowed disk types. + /// + + /// The hypervisor generation of the Virtual Machine. Applicable to OS disks + /// only. + /// Possible values include: 'V1', 'V2' + + /// A list of gallery image features. + /// + + /// Describes the gallery image definition purchase plan. This is used by + /// marketplace images. + /// + + /// The architecture of the image. Applicable to OS disks only. + /// Possible values include: 'x64', 'Arm64' + + /// Privacy statement uri for the current community gallery image. + /// + + /// End-user license agreement for the current community gallery image. + /// + + /// The artifact tags of a shared gallery resource. + /// + public SharedGalleryImageProperties(OperatingSystemTypes osType, OperatingSystemStateTypes osState, GalleryImageIdentifier identifier, System.DateTime? endOfLifeDate = default(System.DateTime?), RecommendedMachineConfiguration recommended = default(RecommendedMachineConfiguration), Disallowed disallowed = default(Disallowed), string hyperVGeneration = default(string), System.Collections.Generic.IList features = default(System.Collections.Generic.IList), ImagePurchasePlan purchasePlan = default(ImagePurchasePlan), string architecture = default(string), string privacyStatementUri = default(string), string eula = default(string), System.Collections.Generic.IDictionary artifactTags = default(System.Collections.Generic.IDictionary)) + + { + this.OsType = osType; + this.OsState = osState; + this.EndOfLifeDate = endOfLifeDate; + this.Identifier = identifier; + this.Recommended = recommended; + this.Disallowed = disallowed; + this.HyperVGeneration = hyperVGeneration; + this.Features = features; + this.PurchasePlan = purchasePlan; + this.Architecture = architecture; + this.PrivacyStatementUri = privacyStatementUri; + this.Eula = eula; + this.ArtifactTags = artifactTags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets this property allows you to specify the type of the OS that is + /// included in the disk when creating a VM from a managed image. Possible + /// values are: **Windows,** **Linux.** Possible values include: 'Windows', 'Linux' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public OperatingSystemTypes OsType {get; set; } + + /// + /// Gets or sets this property allows the user to specify whether the virtual + /// machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'Generalized', 'Specialized' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osState")] + public OperatingSystemStateTypes OsState {get; set; } + + /// + /// Gets or sets the end of life date of the gallery image definition. This + /// property can be used for decommissioning purposes. This property is + /// updatable. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "endOfLifeDate")] + public System.DateTime? EndOfLifeDate {get; set; } + + /// + /// Gets or sets this is the gallery image definition identifier. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identifier")] + public GalleryImageIdentifier Identifier {get; set; } + + /// + /// Gets or sets the properties describe the recommended machine configuration + /// for this Image Definition. These properties are updatable. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "recommended")] + public RecommendedMachineConfiguration Recommended {get; set; } + + /// + /// Gets or sets describes the disallowed disk types. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disallowed")] + public Disallowed Disallowed {get; set; } + + /// + /// Gets or sets the hypervisor generation of the Virtual Machine. Applicable + /// to OS disks only. Possible values include: 'V1', 'V2' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hyperVGeneration")] + public string HyperVGeneration {get; set; } + + /// + /// Gets or sets a list of gallery image features. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "features")] + public System.Collections.Generic.IList Features {get; set; } + + /// + /// Gets or sets describes the gallery image definition purchase plan. This is + /// used by marketplace images. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "purchasePlan")] + public ImagePurchasePlan PurchasePlan {get; set; } + + /// + /// Gets or sets the architecture of the image. Applicable to OS disks only. Possible values include: 'x64', 'Arm64' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "architecture")] + public string Architecture {get; set; } + + /// + /// Gets or sets privacy statement uri for the current community gallery image. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privacyStatementUri")] + public string PrivacyStatementUri {get; set; } + + /// + /// Gets or sets end-user license agreement for the current community gallery + /// image. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eula")] + public string Eula {get; set; } + + /// + /// Gets or sets the artifact tags of a shared gallery resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "artifactTags")] + public System.Collections.Generic.IDictionary ArtifactTags {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Identifier == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Identifier"); + } + + + if (this.Identifier != null) + { + this.Identifier.Validate(); + } + + + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImageVersion.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImageVersion.cs index a16cfdb0b1eb..448d5f6666cb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImageVersion.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImageVersion.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specifies information about the gallery image version that you want to /// create or update. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class SharedGalleryImageVersion : PirSharedGalleryResource { /// @@ -35,31 +25,42 @@ public SharedGalleryImageVersion() /// /// Initializes a new instance of the SharedGalleryImageVersion class. /// - /// Resource name - /// Resource location - /// The unique id of this shared - /// gallery. - /// The published date of the gallery image - /// version Definition. This property can be used for decommissioning - /// purposes. This property is updatable. - /// The end of life date of the gallery - /// image version Definition. This property can be used for - /// decommissioning purposes. This property is updatable. - /// If set to true, Virtual Machines - /// deployed from the latest version of the Image Definition won't use - /// this Image Version. - /// Describes the storage profile of the - /// image version. - /// The artifact tags of a shared gallery - /// resource. - public SharedGalleryImageVersion(string name = default(string), string location = default(string), string uniqueId = default(string), System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? excludeFromLatest = default(bool?), SharedGalleryImageVersionStorageProfile storageProfile = default(SharedGalleryImageVersionStorageProfile), IDictionary artifactTags = default(IDictionary)) - : base(name, location, uniqueId) + + /// Resource name + /// + + /// Resource location + /// + + /// The unique id of this shared gallery. + /// + + /// The published date of the gallery image version Definition. This property + /// can be used for decommissioning purposes. This property is updatable. + /// + + /// The end of life date of the gallery image version Definition. This property + /// can be used for decommissioning purposes. This property is updatable. + /// + + /// If set to true, Virtual Machines deployed from the latest version of the + /// Image Definition won't use this Image Version. + /// + + /// Describes the storage profile of the image version. + /// + + /// The artifact tags of a shared gallery resource. + /// + public SharedGalleryImageVersion(string name = default(string), string location = default(string), string uniqueId = default(string), System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? excludeFromLatest = default(bool?), SharedGalleryImageVersionStorageProfile storageProfile = default(SharedGalleryImageVersionStorageProfile), System.Collections.Generic.IDictionary artifactTags = default(System.Collections.Generic.IDictionary)) + + : base(name, location, uniqueId) { - PublishedDate = publishedDate; - EndOfLifeDate = endOfLifeDate; - ExcludeFromLatest = excludeFromLatest; - StorageProfile = storageProfile; - ArtifactTags = artifactTags; + this.PublishedDate = publishedDate; + this.EndOfLifeDate = endOfLifeDate; + this.ExcludeFromLatest = excludeFromLatest; + this.StorageProfile = storageProfile; + this.ArtifactTags = artifactTags; CustomInit(); } @@ -68,41 +69,40 @@ public SharedGalleryImageVersion() /// partial void CustomInit(); + /// - /// Gets or sets the published date of the gallery image version - /// Definition. This property can be used for decommissioning purposes. - /// This property is updatable. + /// Gets or sets the published date of the gallery image version Definition. + /// This property can be used for decommissioning purposes. This property is + /// updatable. /// - [JsonProperty(PropertyName = "properties.publishedDate")] - public System.DateTime? PublishedDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publishedDate")] + public System.DateTime? PublishedDate {get; set; } /// - /// Gets or sets the end of life date of the gallery image version - /// Definition. This property can be used for decommissioning purposes. - /// This property is updatable. + /// Gets or sets the end of life date of the gallery image version Definition. + /// This property can be used for decommissioning purposes. This property is + /// updatable. /// - [JsonProperty(PropertyName = "properties.endOfLifeDate")] - public System.DateTime? EndOfLifeDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.endOfLifeDate")] + public System.DateTime? EndOfLifeDate {get; set; } /// - /// Gets or sets if set to true, Virtual Machines deployed from the - /// latest version of the Image Definition won't use this Image - /// Version. + /// Gets or sets if set to true, Virtual Machines deployed from the latest + /// version of the Image Definition won't use this Image Version. /// - [JsonProperty(PropertyName = "properties.excludeFromLatest")] - public bool? ExcludeFromLatest { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.excludeFromLatest")] + public bool? ExcludeFromLatest {get; set; } /// /// Gets or sets describes the storage profile of the image version. /// - [JsonProperty(PropertyName = "properties.storageProfile")] - public SharedGalleryImageVersionStorageProfile StorageProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageProfile")] + public SharedGalleryImageVersionStorageProfile StorageProfile {get; set; } /// /// Gets or sets the artifact tags of a shared gallery resource. /// - [JsonProperty(PropertyName = "properties.artifactTags")] - public IDictionary ArtifactTags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.artifactTags")] + public System.Collections.Generic.IDictionary ArtifactTags {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImageVersionProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImageVersionProperties.cs new file mode 100644 index 000000000000..65fcfdf8d5f7 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImageVersionProperties.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a gallery image version. + /// + public partial class SharedGalleryImageVersionProperties + { + /// + /// Initializes a new instance of the SharedGalleryImageVersionProperties class. + /// + public SharedGalleryImageVersionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SharedGalleryImageVersionProperties class. + /// + + /// The published date of the gallery image version Definition. This property + /// can be used for decommissioning purposes. This property is updatable. + /// + + /// The end of life date of the gallery image version Definition. This property + /// can be used for decommissioning purposes. This property is updatable. + /// + + /// If set to true, Virtual Machines deployed from the latest version of the + /// Image Definition won't use this Image Version. + /// + + /// Describes the storage profile of the image version. + /// + + /// The artifact tags of a shared gallery resource. + /// + public SharedGalleryImageVersionProperties(System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? excludeFromLatest = default(bool?), SharedGalleryImageVersionStorageProfile storageProfile = default(SharedGalleryImageVersionStorageProfile), System.Collections.Generic.IDictionary artifactTags = default(System.Collections.Generic.IDictionary)) + + { + this.PublishedDate = publishedDate; + this.EndOfLifeDate = endOfLifeDate; + this.ExcludeFromLatest = excludeFromLatest; + this.StorageProfile = storageProfile; + this.ArtifactTags = artifactTags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the published date of the gallery image version Definition. + /// This property can be used for decommissioning purposes. This property is + /// updatable. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publishedDate")] + public System.DateTime? PublishedDate {get; set; } + + /// + /// Gets or sets the end of life date of the gallery image version Definition. + /// This property can be used for decommissioning purposes. This property is + /// updatable. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "endOfLifeDate")] + public System.DateTime? EndOfLifeDate {get; set; } + + /// + /// Gets or sets if set to true, Virtual Machines deployed from the latest + /// version of the Image Definition won't use this Image Version. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "excludeFromLatest")] + public bool? ExcludeFromLatest {get; set; } + + /// + /// Gets or sets describes the storage profile of the image version. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageProfile")] + public SharedGalleryImageVersionStorageProfile StorageProfile {get; set; } + + /// + /// Gets or sets the artifact tags of a shared gallery resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "artifactTags")] + public System.Collections.Generic.IDictionary ArtifactTags {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImageVersionStorageProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImageVersionStorageProfile.cs index 1e1095a74523..2eeb2b80ccd4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImageVersionStorageProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryImageVersionStorageProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class SharedGalleryImageVersionStorageProfile { /// - /// Initializes a new instance of the - /// SharedGalleryImageVersionStorageProfile class. + /// Initializes a new instance of the SharedGalleryImageVersionStorageProfile class. /// public SharedGalleryImageVersionStorageProfile() { @@ -30,15 +21,19 @@ public SharedGalleryImageVersionStorageProfile() } /// - /// Initializes a new instance of the - /// SharedGalleryImageVersionStorageProfile class. + /// Initializes a new instance of the SharedGalleryImageVersionStorageProfile class. /// - /// This is the OS disk image. - /// A list of data disk images. - public SharedGalleryImageVersionStorageProfile(SharedGalleryOSDiskImage osDiskImage = default(SharedGalleryOSDiskImage), IList dataDiskImages = default(IList)) + + /// This is the OS disk image. + /// + + /// A list of data disk images. + /// + public SharedGalleryImageVersionStorageProfile(SharedGalleryOSDiskImage osDiskImage = default(SharedGalleryOSDiskImage), System.Collections.Generic.IList dataDiskImages = default(System.Collections.Generic.IList)) + { - OsDiskImage = osDiskImage; - DataDiskImages = dataDiskImages; + this.OsDiskImage = osDiskImage; + this.DataDiskImages = dataDiskImages; CustomInit(); } @@ -47,17 +42,17 @@ public SharedGalleryImageVersionStorageProfile() /// partial void CustomInit(); + /// /// Gets or sets this is the OS disk image. /// - [JsonProperty(PropertyName = "osDiskImage")] - public SharedGalleryOSDiskImage OsDiskImage { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osDiskImage")] + public SharedGalleryOSDiskImage OsDiskImage {get; set; } /// /// Gets or sets a list of data disk images. /// - [JsonProperty(PropertyName = "dataDiskImages")] - public IList DataDiskImages { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDiskImages")] + public System.Collections.Generic.IList DataDiskImages {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryOSDiskImage.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryOSDiskImage.cs index a89a7a8847da..8a7fea8444c8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryOSDiskImage.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryOSDiskImage.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -28,13 +23,16 @@ public SharedGalleryOSDiskImage() /// /// Initializes a new instance of the SharedGalleryOSDiskImage class. /// - /// This property indicates the size of the - /// VHD to be created. - /// The host caching of the disk. Valid - /// values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values - /// include: 'None', 'ReadOnly', 'ReadWrite' - public SharedGalleryOSDiskImage(int? diskSizeGB = default(int?), string hostCaching = default(string)) - : base(diskSizeGB, hostCaching) + + /// This property indicates the size of the VHD to be created. + /// + + /// The host caching of the disk. Valid values are 'None', 'ReadOnly', and + /// 'ReadWrite' + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + public SharedGalleryOSDiskImage(int? diskSizeGb = default(int?), string hostCaching = default(string)) + + : base(diskSizeGb, hostCaching) { CustomInit(); } @@ -45,4 +43,4 @@ public SharedGalleryOSDiskImage() partial void CustomInit(); } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryProperties.cs new file mode 100644 index 000000000000..e2b9bc308765 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedGalleryProperties.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Specifies the properties of a shared gallery + /// + public partial class SharedGalleryProperties + { + /// + /// Initializes a new instance of the SharedGalleryProperties class. + /// + public SharedGalleryProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SharedGalleryProperties class. + /// + + /// The artifact tags of a shared gallery resource. + /// + public SharedGalleryProperties(System.Collections.Generic.IDictionary artifactTags = default(System.Collections.Generic.IDictionary)) + + { + this.ArtifactTags = artifactTags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the artifact tags of a shared gallery resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "artifactTags")] + public System.Collections.Generic.IDictionary ArtifactTags {get; private set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedToValues.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedToValues.cs index 463c15183c04..be08d0ba135d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SharedToValues.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharedToValues.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for SharedToValues. /// + + public static class SharedToValues { public const string Tenant = "tenant"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharingProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharingProfile.cs index 5479e30ab4d5..45f39e414853 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SharingProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharingProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,18 +23,22 @@ public SharingProfile() /// /// Initializes a new instance of the SharingProfile class. /// - /// This property allows you to specify the - /// permission of sharing gallery. Possible values are: **Private,** - /// **Groups,** **Community.**. Possible values include: 'Private', - /// 'Groups', 'Community' - /// A list of sharing profile groups. - /// Information of community gallery - /// if current gallery is shared to community. - public SharingProfile(string permissions = default(string), IList groups = default(IList), CommunityGalleryInfo communityGalleryInfo = default(CommunityGalleryInfo)) + + /// This property allows you to specify the permission of sharing gallery. + /// Possible values are: **Private,** **Groups,** **Community.** + /// Possible values include: 'Private', 'Groups', 'Community' + + /// A list of sharing profile groups. + /// + + /// Information of community gallery if current gallery is shared to community. + /// + public SharingProfile(string permissions = default(string), System.Collections.Generic.IList groups = default(System.Collections.Generic.IList), CommunityGalleryInfo communityGalleryInfo = default(CommunityGalleryInfo)) + { - Permissions = permissions; - Groups = groups; - CommunityGalleryInfo = communityGalleryInfo; + this.Permissions = permissions; + this.Groups = groups; + this.CommunityGalleryInfo = communityGalleryInfo; CustomInit(); } @@ -51,27 +47,25 @@ public SharingProfile() /// partial void CustomInit(); + /// - /// Gets or sets this property allows you to specify the permission of - /// sharing gallery. Possible values are: **Private,** **Groups,** - /// **Community.**. Possible values include: 'Private', 'Groups', - /// 'Community' + /// Gets or sets this property allows you to specify the permission of sharing + /// gallery. Possible values are: **Private,** **Groups,** **Community.** Possible values include: 'Private', 'Groups', 'Community' /// - [JsonProperty(PropertyName = "permissions")] - public string Permissions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "permissions")] + public string Permissions {get; set; } /// /// Gets a list of sharing profile groups. /// - [JsonProperty(PropertyName = "groups")] - public IList Groups { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "groups")] + public System.Collections.Generic.IList Groups {get; private set; } /// - /// Gets or sets information of community gallery if current gallery is - /// shared to community. + /// Gets or sets information of community gallery if current gallery is shared + /// to community. /// - [JsonProperty(PropertyName = "communityGalleryInfo")] - public CommunityGalleryInfo CommunityGalleryInfo { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "communityGalleryInfo")] + public CommunityGalleryInfo CommunityGalleryInfo {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharingProfileGroup.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharingProfileGroup.cs index 2e31dcd32714..94010bf78dfa 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SharingProfileGroup.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharingProfileGroup.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,16 +23,18 @@ public SharingProfileGroup() /// /// Initializes a new instance of the SharingProfileGroup class. /// - /// This property allows you to specify the type of - /// sharing group. Possible values are: **Subscriptions,** - /// **AADTenants.**. Possible values include: 'Subscriptions', - /// 'AADTenants' - /// A list of subscription/tenant ids the gallery is - /// aimed to be shared to. - public SharingProfileGroup(string type = default(string), IList ids = default(IList)) + + /// This property allows you to specify the type of sharing group. Possible + /// values are: **Subscriptions,** **AADTenants.** + /// Possible values include: 'Subscriptions', 'AADTenants' + + /// A list of subscription/tenant ids the gallery is aimed to be shared to. + /// + public SharingProfileGroup(string type = default(string), System.Collections.Generic.IList ids = default(System.Collections.Generic.IList)) + { - Type = type; - Ids = ids; + this.Type = type; + this.Ids = ids; CustomInit(); } @@ -49,21 +43,19 @@ public SharingProfileGroup() /// partial void CustomInit(); + /// - /// Gets or sets this property allows you to specify the type of - /// sharing group. Possible values are: **Subscriptions,** - /// **AADTenants.**. Possible values include: 'Subscriptions', - /// 'AADTenants' + /// Gets or sets this property allows you to specify the type of sharing group. + /// Possible values are: **Subscriptions,** **AADTenants.** Possible values include: 'Subscriptions', 'AADTenants' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// - /// Gets or sets a list of subscription/tenant ids the gallery is aimed - /// to be shared to. + /// Gets or sets a list of subscription/tenant ids the gallery is aimed to be + /// shared to. /// - [JsonProperty(PropertyName = "ids")] - public IList Ids { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ids")] + public System.Collections.Generic.IList Ids {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharingProfileGroupTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharingProfileGroupTypes.cs index 1f1724bed836..b6a017b4ecc3 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SharingProfileGroupTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharingProfileGroupTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for SharingProfileGroupTypes. /// + + public static class SharingProfileGroupTypes { public const string Subscriptions = "Subscriptions"; public const string AADTenants = "AADTenants"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharingState.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharingState.cs index 0042d62cee82..6bf3fc834b3d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SharingState.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharingState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for SharingState. /// + + public static class SharingState { public const string Succeeded = "Succeeded"; @@ -21,4 +18,4 @@ public static class SharingState public const string Failed = "Failed"; public const string Unknown = "Unknown"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharingStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharingStatus.cs index 8d1ee83173f9..136ff4d53001 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SharingStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharingStatus.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,15 +23,17 @@ public SharingStatus() /// /// Initializes a new instance of the SharingStatus class. /// - /// Aggregated sharing state of current - /// gallery. Possible values include: 'Succeeded', 'InProgress', - /// 'Failed', 'Unknown' - /// Summary of all regional sharing - /// status. - public SharingStatus(string aggregatedState = default(string), IList summary = default(IList)) + + /// Aggregated sharing state of current gallery. + /// Possible values include: 'Succeeded', 'InProgress', 'Failed', 'Unknown' + + /// Summary of all regional sharing status. + /// + public SharingStatus(string aggregatedState = default(string), System.Collections.Generic.IList summary = default(System.Collections.Generic.IList)) + { - AggregatedState = aggregatedState; - Summary = summary; + this.AggregatedState = aggregatedState; + this.Summary = summary; CustomInit(); } @@ -48,18 +42,17 @@ public SharingStatus() /// partial void CustomInit(); + /// - /// Gets aggregated sharing state of current gallery. Possible values - /// include: 'Succeeded', 'InProgress', 'Failed', 'Unknown' + /// Gets aggregated sharing state of current gallery. Possible values include: 'Succeeded', 'InProgress', 'Failed', 'Unknown' /// - [JsonProperty(PropertyName = "aggregatedState")] - public string AggregatedState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "aggregatedState")] + public string AggregatedState {get; private set; } /// /// Gets or sets summary of all regional sharing status. /// - [JsonProperty(PropertyName = "summary")] - public IList Summary { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "summary")] + public System.Collections.Generic.IList Summary {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharingUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharingUpdate.cs index 4eae2913bc6a..0fefc3f712c1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SharingUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharingUpdate.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,15 +23,18 @@ public SharingUpdate() /// /// Initializes a new instance of the SharingUpdate class. /// - /// This property allows you to specify the - /// operation type of gallery sharing update. Possible values are: - /// **Add,** **Remove,** **Reset.**. Possible values include: 'Add', - /// 'Remove', 'Reset', 'EnableCommunity' - /// A list of sharing profile groups. - public SharingUpdate(string operationType, IList groups = default(IList)) + + /// This property allows you to specify the operation type of gallery sharing + /// update. Possible values are: **Add,** **Remove,** **Reset.** + /// Possible values include: 'Add', 'Remove', 'Reset', 'EnableCommunity' + + /// A list of sharing profile groups. + /// + public SharingUpdate(string operationType, System.Collections.Generic.IList groups = default(System.Collections.Generic.IList)) + { - OperationType = operationType; - Groups = groups; + this.OperationType = operationType; + this.Groups = groups; CustomInit(); } @@ -49,33 +43,34 @@ public SharingUpdate() /// partial void CustomInit(); + /// - /// Gets or sets this property allows you to specify the operation type - /// of gallery sharing update. Possible values are: **Add,** - /// **Remove,** **Reset.**. Possible values include: 'Add', 'Remove', - /// 'Reset', 'EnableCommunity' + /// Gets or sets this property allows you to specify the operation type of + /// gallery sharing update. Possible values are: **Add,** **Remove,** + /// **Reset.** Possible values include: 'Add', 'Remove', 'Reset', 'EnableCommunity' /// - [JsonProperty(PropertyName = "operationType")] - public string OperationType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "operationType")] + public string OperationType {get; set; } /// /// Gets or sets a list of sharing profile groups. /// - [JsonProperty(PropertyName = "groups")] - public IList Groups { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "groups")] + public System.Collections.Generic.IList Groups {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (OperationType == null) + if (this.OperationType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "OperationType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "OperationType"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SharingUpdateOperationTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SharingUpdateOperationTypes.cs index a778c2867b58..2478bf648376 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SharingUpdateOperationTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SharingUpdateOperationTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for SharingUpdateOperationTypes. /// + + public static class SharingUpdateOperationTypes { public const string Add = "Add"; @@ -21,4 +18,4 @@ public static class SharingUpdateOperationTypes public const string Reset = "Reset"; public const string EnableCommunity = "EnableCommunity"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Sku.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Sku.cs index 3a3bbc4c45bd..0fd3f732ba9a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Sku.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/Sku.cs @@ -1,22 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Describes a virtual machine scale set sku. NOTE: If the new VM SKU is - /// not supported on the hardware the scale set is currently on, you need - /// to deallocate the VMs in the scale set before you modify the SKU name. + /// Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not + /// supported on the hardware the scale set is currently on, you need to + /// deallocate the VMs in the scale set before you modify the SKU name. /// public partial class Sku { @@ -31,18 +25,22 @@ public Sku() /// /// Initializes a new instance of the Sku class. /// - /// The sku name. - /// Specifies the tier of virtual machines in a - /// scale set.<br /><br /> Possible Values:<br - /// /><br /> **Standard**<br /><br /> - /// **Basic** - /// Specifies the number of virtual machines in - /// the scale set. + + /// The sku name. + /// + + /// Specifies the tier of virtual machines in a scale set.<br /><br /> Possible + /// Values:<br /><br /> **Standard**<br /><br /> **Basic** + /// + + /// Specifies the number of virtual machines in the scale set. + /// public Sku(string name = default(string), string tier = default(string), long? capacity = default(long?)) + { - Name = name; - Tier = tier; - Capacity = capacity; + this.Name = name; + this.Tier = tier; + this.Capacity = capacity; CustomInit(); } @@ -51,27 +49,24 @@ public Sku() /// partial void CustomInit(); + /// /// Gets or sets the sku name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets specifies the tier of virtual machines in a scale - /// set.&lt;br /&gt;&lt;br /&gt; Possible - /// Values:&lt;br /&gt;&lt;br /&gt; - /// **Standard**&lt;br /&gt;&lt;br /&gt; **Basic** + /// Gets or sets specifies the tier of virtual machines in a scale set.<br + /// /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + public string Tier {get; set; } /// - /// Gets or sets specifies the number of virtual machines in the scale - /// set. + /// Gets or sets specifies the number of virtual machines in the scale set. /// - [JsonProperty(PropertyName = "capacity")] - public long? Capacity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "capacity")] + public long? Capacity {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SkuProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SkuProfile.cs index b2d4ffc51a42..61cc4dfa47f8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SkuProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SkuProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -33,16 +25,18 @@ public SkuProfile() /// /// Initializes a new instance of the SkuProfile class. /// - /// Specifies the VM sizes for the virtual - /// machine scale set. - /// Specifies the allocation strategy - /// for the virtual machine scale set based on which the VMs will be - /// allocated. Possible values include: 'LowestPrice', - /// 'CapacityOptimized', 'Prioritized' - public SkuProfile(IList vmSizes = default(IList), string allocationStrategy = default(string)) + + /// Specifies the VM sizes for the virtual machine scale set. + /// + + /// Specifies the allocation strategy for the virtual machine scale set based + /// on which the VMs will be allocated. + /// Possible values include: 'LowestPrice', 'CapacityOptimized', 'Prioritized' + public SkuProfile(System.Collections.Generic.IList vmSizes = default(System.Collections.Generic.IList), string allocationStrategy = default(string)) + { - VmSizes = vmSizes; - AllocationStrategy = allocationStrategy; + this.VmSizes = vmSizes; + this.AllocationStrategy = allocationStrategy; CustomInit(); } @@ -51,21 +45,18 @@ public SkuProfile() /// partial void CustomInit(); + /// - /// Gets or sets specifies the VM sizes for the virtual machine scale - /// set. + /// Gets or sets specifies the VM sizes for the virtual machine scale set. /// - [JsonProperty(PropertyName = "vmSizes")] - public IList VmSizes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vmSizes")] + public System.Collections.Generic.IList VmSizes {get; set; } /// - /// Gets or sets specifies the allocation strategy for the virtual - /// machine scale set based on which the VMs will be allocated. - /// Possible values include: 'LowestPrice', 'CapacityOptimized', - /// 'Prioritized' + /// Gets or sets specifies the allocation strategy for the virtual machine + /// scale set based on which the VMs will be allocated. Possible values include: 'LowestPrice', 'CapacityOptimized', 'Prioritized' /// - [JsonProperty(PropertyName = "allocationStrategy")] - public string AllocationStrategy { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "allocationStrategy")] + public string AllocationStrategy {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SkuProfileVMSize.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SkuProfileVMSize.cs index 339aaf4510d1..3eb8c4f3491c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SkuProfileVMSize.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SkuProfileVMSize.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public SkuProfileVMSize() /// /// Initializes a new instance of the SkuProfileVMSize class. /// - /// Specifies the name of the VM Size. - /// Specifies the rank (a.k.a priority) associated - /// with the VM Size. + + /// Specifies the name of the VM Size. + /// + + /// Specifies the rank (a.k.a priority) associated with the VM Size. + /// public SkuProfileVMSize(string name = default(string), int? rank = default(int?)) + { - Name = name; - Rank = rank; + this.Name = name; + this.Rank = rank; CustomInit(); } @@ -44,18 +42,18 @@ public SkuProfileVMSize() /// partial void CustomInit(); + /// /// Gets or sets specifies the name of the VM Size. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets specifies the rank (a.k.a priority) associated with - /// the VM Size. + /// Gets or sets specifies the rank (a.k.a priority) associated with the VM + /// Size. /// - [JsonProperty(PropertyName = "rank")] - public int? Rank { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "rank")] + public int? Rank {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SkuTier.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SkuTier.cs index 3f5b39d3880a..875cdf7fdae4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SkuTier.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SkuTier.cs @@ -1,33 +1,26 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for SkuTier. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum SkuTier { - [EnumMember(Value = "Free")] + [System.Runtime.Serialization.EnumMember(Value = "Free")] Free, - [EnumMember(Value = "Basic")] + [System.Runtime.Serialization.EnumMember(Value = "Basic")] Basic, - [EnumMember(Value = "Standard")] + [System.Runtime.Serialization.EnumMember(Value = "Standard")] Standard, - [EnumMember(Value = "Premium")] + [System.Runtime.Serialization.EnumMember(Value = "Premium")] Premium } internal static class SkuTierEnumExtension @@ -36,7 +29,6 @@ internal static string ToSerializedValue(this SkuTier? value) { return value == null ? null : ((SkuTier)value).ToSerializedValue(); } - internal static string ToSerializedValue(this SkuTier value) { switch( value ) @@ -52,7 +44,6 @@ internal static string ToSerializedValue(this SkuTier value) } return null; } - internal static SkuTier? ParseSkuTier(this string value) { switch( value ) @@ -69,4 +60,4 @@ internal static string ToSerializedValue(this SkuTier value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Snapshot.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Snapshot.cs index 8a354d5d56e2..ddc9c840acfc 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Snapshot.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/Snapshot.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Snapshot resource. /// - [Rest.Serialization.JsonTransformation] - public partial class Snapshot : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class Snapshot : TrackedResource { /// /// Initializes a new instance of the Snapshot class. @@ -34,118 +24,155 @@ public Snapshot() /// /// Initializes a new instance of the Snapshot class. /// - /// Resource location - /// Disk source information. CreationData - /// information cannot be changed after the disk has been - /// created. - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The time when the snapshot was - /// created. - /// The Operating System type. Possible values - /// include: 'Windows', 'Linux' - /// The hypervisor generation of the - /// Virtual Machine. Applicable to OS disks only. Possible values - /// include: 'V1', 'V2' - /// Purchase plan information for the image - /// from which the source disk for the snapshot was originally - /// created. - /// List of supported capabilities - /// for the image from which the source disk from the snapshot was - /// originally created. - /// If creationData.createOption is Empty, - /// this field is mandatory and it indicates the size of the disk to - /// create. If this field is present for updates or creation with other - /// options, it indicates a resize. Resizes are only allowed if the - /// disk is not attached to a running VM, and can only increase the - /// disk's size. - /// The size of the disk in bytes. This - /// field is read only. - /// The state of the snapshot. Possible values - /// include: 'Unattached', 'Attached', 'Reserved', 'Frozen', - /// 'ActiveSAS', 'ActiveSASFrozen', 'ReadyToUpload', - /// 'ActiveUpload' - /// Unique Guid identifying the - /// resource. - /// Encryption settings - /// collection used be Azure Disk Encryption, can contain multiple - /// encryption settings per disk or snapshot. - /// The disk provisioning - /// state. - /// Whether a snapshot is incremental. - /// Incremental snapshots on the same disk occupy less space than full - /// snapshots and can be diffed. - /// Incremental snapshots for - /// a disk share an incremental snapshot family id. The Get Page Range - /// Diff API can only be called on incremental snapshots with the same - /// family id. - /// Encryption property can be used to encrypt - /// data at rest with customer managed keys or platform managed - /// keys. - /// Policy for accessing the disk via - /// network. Possible values include: 'AllowAll', 'AllowPrivate', - /// 'DenyAll' - /// ARM id of the DiskAccess resource for - /// using private endpoints on disks. - /// Contains the security related - /// information for the resource. - /// Indicates the OS on a snapshot - /// supports hibernation. - /// Policy for controlling export on - /// the disk. Possible values include: 'Enabled', 'Disabled' - /// Percentage complete for the - /// background copy when a resource is created via the CopyStart - /// operation. - /// Indicates the error details if - /// the background copy of a resource created via the CopyStart - /// operation fails. - /// Additional authentication - /// requirements when exporting or uploading to a disk or snapshot. - /// Possible values include: 'AzureActiveDirectory', 'None' - /// The state of snapshot which - /// determines the access availability of the snapshot. Possible values - /// include: 'Unknown', 'Pending', 'Available', 'InstantAccess', - /// 'AvailableWithInstantAccess' - /// Unused. Always Null. - /// The snapshots sku name. Can be Standard_LRS, - /// Premium_LRS, or Standard_ZRS. This is an optional parameter for - /// incremental snapshot and the default behavior is the SKU will be - /// set to the same sku as the previous snapshot - /// The extended location where the - /// snapshot will be created. Extended location cannot be - /// changed. - public Snapshot(string location, CreationData creationData, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), System.DateTime? timeCreated = default(System.DateTime?), OperatingSystemTypes? osType = default(OperatingSystemTypes?), string hyperVGeneration = default(string), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), int? diskSizeGB = default(int?), long? diskSizeBytes = default(long?), string diskState = default(string), string uniqueId = default(string), EncryptionSettingsCollection encryptionSettingsCollection = default(EncryptionSettingsCollection), string provisioningState = default(string), bool? incremental = default(bool?), string incrementalSnapshotFamilyId = default(string), Encryption encryption = default(Encryption), string networkAccessPolicy = default(string), string diskAccessId = default(string), DiskSecurityProfile securityProfile = default(DiskSecurityProfile), bool? supportsHibernation = default(bool?), string publicNetworkAccess = default(string), double? completionPercent = default(double?), CopyCompletionError copyCompletionError = default(CopyCompletionError), string dataAccessAuthMode = default(string), string snapshotAccessState = default(string), string managedBy = default(string), SnapshotSku sku = default(SnapshotSku), ExtendedLocation extendedLocation = default(ExtendedLocation)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// Unused. Always Null. + /// + + /// The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. + /// This is an optional parameter for incremental snapshot and the default + /// behavior is the SKU will be set to the same sku as the previous snapshot + /// + + /// The extended location where the snapshot will be created. Extended location + /// cannot be changed. + /// + + /// Purchase plan information for the image from which the source disk for the + /// snapshot was originally created. + /// + + /// List of supported capabilities for the image from which the source disk + /// from the snapshot was originally created. + /// + + /// Disk source information. CreationData information cannot be changed after + /// the disk has been created. + /// + + /// The state of the snapshot. + /// Possible values include: 'Unattached', 'Attached', 'Reserved', 'Frozen', + /// 'ActiveSAS', 'ActiveSASFrozen', 'ReadyToUpload', 'ActiveUpload' + + /// Encryption property can be used to encrypt data at rest with customer + /// managed keys or platform managed keys. + /// + + /// The time when the snapshot was created. + /// + + /// The Operating System type. + /// Possible values include: 'Windows', 'Linux' + + /// The hypervisor generation of the Virtual Machine. Applicable to OS disks + /// only. + /// Possible values include: 'V1', 'V2' + + /// If creationData.createOption is Empty, this field is mandatory and it + /// indicates the size of the disk to create. If this field is present for + /// updates or creation with other options, it indicates a resize. Resizes are + /// only allowed if the disk is not attached to a running VM, and can only + /// increase the disk's size. + /// + + /// The size of the disk in bytes. This field is read only. + /// + + /// Unique Guid identifying the resource. + /// + + /// Encryption settings collection used be Azure Disk Encryption, can contain + /// multiple encryption settings per disk or snapshot. + /// + + /// The disk provisioning state. + /// + + /// Whether a snapshot is incremental. Incremental snapshots on the same disk + /// occupy less space than full snapshots and can be diffed. + /// + + /// Incremental snapshots for a disk share an incremental snapshot family id. + /// The Get Page Range Diff API can only be called on incremental snapshots + /// with the same family id. + /// + + /// Policy for accessing the disk via network. + /// Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + + /// ARM id of the DiskAccess resource for using private endpoints on disks. + /// + + /// Contains the security related information for the resource. + /// + + /// Indicates the OS on a snapshot supports hibernation. + /// + + /// Policy for controlling export on the disk. + /// Possible values include: 'Enabled', 'Disabled' + + /// Percentage complete for the background copy when a resource is created via + /// the CopyStart operation. + /// + + /// Indicates the error details if the background copy of a resource created + /// via the CopyStart operation fails. + /// + + /// Additional authentication requirements when exporting or uploading to a + /// disk or snapshot. + /// Possible values include: 'AzureActiveDirectory', 'None' + + /// The state of snapshot which determines the access availability of the + /// snapshot. + /// Possible values include: 'Unknown', 'Pending', 'Available', + /// 'InstantAccess', 'AvailableWithInstantAccess' + public Snapshot(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string managedBy = default(string), SnapshotSku sku = default(SnapshotSku), ExtendedLocation extendedLocation = default(ExtendedLocation), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), CreationData creationData = default(CreationData), string diskState = default(string), Encryption encryption = default(Encryption), System.DateTime? timeCreated = default(System.DateTime?), OperatingSystemTypes? osType = default(OperatingSystemTypes?), string hyperVGeneration = default(string), int? diskSizeGb = default(int?), long? diskSizeBytes = default(long?), string uniqueId = default(string), EncryptionSettingsCollection encryptionSettingsCollection = default(EncryptionSettingsCollection), string provisioningState = default(string), bool? incremental = default(bool?), string incrementalSnapshotFamilyId = default(string), string networkAccessPolicy = default(string), string diskAccessId = default(string), DiskSecurityProfile securityProfile = default(DiskSecurityProfile), bool? supportsHibernation = default(bool?), string publicNetworkAccess = default(string), double? completionPercent = default(double?), CopyCompletionError copyCompletionError = default(CopyCompletionError), string dataAccessAuthMode = default(string), string snapshotAccessState = default(string)) + + : base(location, id, name, type, tags) { - TimeCreated = timeCreated; - OsType = osType; - HyperVGeneration = hyperVGeneration; - PurchasePlan = purchasePlan; - SupportedCapabilities = supportedCapabilities; - CreationData = creationData; - DiskSizeGB = diskSizeGB; - DiskSizeBytes = diskSizeBytes; - DiskState = diskState; - UniqueId = uniqueId; - EncryptionSettingsCollection = encryptionSettingsCollection; - ProvisioningState = provisioningState; - Incremental = incremental; - IncrementalSnapshotFamilyId = incrementalSnapshotFamilyId; - Encryption = encryption; - NetworkAccessPolicy = networkAccessPolicy; - DiskAccessId = diskAccessId; - SecurityProfile = securityProfile; - SupportsHibernation = supportsHibernation; - PublicNetworkAccess = publicNetworkAccess; - CompletionPercent = completionPercent; - CopyCompletionError = copyCompletionError; - DataAccessAuthMode = dataAccessAuthMode; - SnapshotAccessState = snapshotAccessState; - ManagedBy = managedBy; - Sku = sku; - ExtendedLocation = extendedLocation; + this.ManagedBy = managedBy; + this.Sku = sku; + this.ExtendedLocation = extendedLocation; + this.PurchasePlan = purchasePlan; + this.SupportedCapabilities = supportedCapabilities; + this.CreationData = creationData; + this.DiskState = diskState; + this.Encryption = encryption; + this.TimeCreated = timeCreated; + this.OsType = osType; + this.HyperVGeneration = hyperVGeneration; + this.DiskSizeGB = diskSizeGb; + this.DiskSizeBytes = diskSizeBytes; + this.UniqueId = uniqueId; + this.EncryptionSettingsCollection = encryptionSettingsCollection; + this.ProvisioningState = provisioningState; + this.Incremental = incremental; + this.IncrementalSnapshotFamilyId = incrementalSnapshotFamilyId; + this.NetworkAccessPolicy = networkAccessPolicy; + this.DiskAccessId = diskAccessId; + this.SecurityProfile = securityProfile; + this.SupportsHibernation = supportsHibernation; + this.PublicNetworkAccess = publicNetworkAccess; + this.CompletionPercent = completionPercent; + this.CopyCompletionError = copyCompletionError; + this.DataAccessAuthMode = dataAccessAuthMode; + this.SnapshotAccessState = snapshotAccessState; CustomInit(); } @@ -154,229 +181,232 @@ public Snapshot() /// partial void CustomInit(); + /// - /// Gets the time when the snapshot was created. + /// Gets unused. Always Null. /// - [JsonProperty(PropertyName = "properties.timeCreated")] - public System.DateTime? TimeCreated { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managedBy")] + public string ManagedBy {get; private set; } /// - /// Gets or sets the Operating System type. Possible values include: - /// 'Windows', 'Linux' + /// Gets or sets the snapshots sku name. Can be Standard_LRS, Premium_LRS, or + /// Standard_ZRS. This is an optional parameter for incremental snapshot and + /// the default behavior is the SKU will be set to the same sku as the previous + /// snapshot /// - [JsonProperty(PropertyName = "properties.osType")] - public OperatingSystemTypes? OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public SnapshotSku Sku {get; set; } /// - /// Gets or sets the hypervisor generation of the Virtual Machine. - /// Applicable to OS disks only. Possible values include: 'V1', 'V2' + /// Gets or sets the extended location where the snapshot will be created. + /// Extended location cannot be changed. /// - [JsonProperty(PropertyName = "properties.hyperVGeneration")] - public string HyperVGeneration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation {get; set; } /// - /// Gets or sets purchase plan information for the image from which the - /// source disk for the snapshot was originally created. + /// Gets or sets purchase plan information for the image from which the source + /// disk for the snapshot was originally created. /// - [JsonProperty(PropertyName = "properties.purchasePlan")] - public PurchasePlan PurchasePlan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.purchasePlan")] + public PurchasePlan PurchasePlan {get; set; } /// - /// Gets or sets list of supported capabilities for the image from - /// which the source disk from the snapshot was originally created. + /// Gets or sets list of supported capabilities for the image from which the + /// source disk from the snapshot was originally created. /// - [JsonProperty(PropertyName = "properties.supportedCapabilities")] - public SupportedCapabilities SupportedCapabilities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.supportedCapabilities")] + public SupportedCapabilities SupportedCapabilities {get; set; } /// - /// Gets or sets disk source information. CreationData information - /// cannot be changed after the disk has been created. + /// Gets or sets disk source information. CreationData information cannot be + /// changed after the disk has been created. /// - [JsonProperty(PropertyName = "properties.creationData")] - public CreationData CreationData { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.creationData")] + public CreationData CreationData {get; set; } /// - /// Gets or sets if creationData.createOption is Empty, this field is - /// mandatory and it indicates the size of the disk to create. If this - /// field is present for updates or creation with other options, it - /// indicates a resize. Resizes are only allowed if the disk is not - /// attached to a running VM, and can only increase the disk's size. + /// Gets the state of the snapshot. Possible values include: 'Unattached', 'Attached', 'Reserved', 'Frozen', 'ActiveSAS', 'ActiveSASFrozen', 'ReadyToUpload', 'ActiveUpload' /// - [JsonProperty(PropertyName = "properties.diskSizeGB")] - public int? DiskSizeGB { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskState")] + public string DiskState {get; private set; } /// - /// Gets the size of the disk in bytes. This field is read only. + /// Gets or sets encryption property can be used to encrypt data at rest with + /// customer managed keys or platform managed keys. /// - [JsonProperty(PropertyName = "properties.diskSizeBytes")] - public long? DiskSizeBytes { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryption")] + public Encryption Encryption {get; set; } /// - /// Gets the state of the snapshot. Possible values include: - /// 'Unattached', 'Attached', 'Reserved', 'Frozen', 'ActiveSAS', - /// 'ActiveSASFrozen', 'ReadyToUpload', 'ActiveUpload' + /// Gets the time when the snapshot was created. /// - [JsonProperty(PropertyName = "properties.diskState")] - public string DiskState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeCreated")] + public System.DateTime? TimeCreated {get; private set; } /// - /// Gets unique Guid identifying the resource. + /// Gets or sets the Operating System type. Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "properties.uniqueId")] - public string UniqueId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osType")] + public OperatingSystemTypes? OsType {get; set; } /// - /// Gets or sets encryption settings collection used be Azure Disk - /// Encryption, can contain multiple encryption settings per disk or - /// snapshot. + /// Gets or sets the hypervisor generation of the Virtual Machine. Applicable + /// to OS disks only. Possible values include: 'V1', 'V2' /// - [JsonProperty(PropertyName = "properties.encryptionSettingsCollection")] - public EncryptionSettingsCollection EncryptionSettingsCollection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hyperVGeneration")] + public string HyperVGeneration {get; set; } /// - /// Gets the disk provisioning state. + /// Gets or sets if creationData.createOption is Empty, this field is mandatory + /// and it indicates the size of the disk to create. If this field is present + /// for updates or creation with other options, it indicates a resize. Resizes + /// are only allowed if the disk is not attached to a running VM, and can only + /// increase the disk's size. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskSizeGB")] + public int? DiskSizeGB {get; set; } /// - /// Gets or sets whether a snapshot is incremental. Incremental - /// snapshots on the same disk occupy less space than full snapshots - /// and can be diffed. + /// Gets the size of the disk in bytes. This field is read only. /// - [JsonProperty(PropertyName = "properties.incremental")] - public bool? Incremental { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskSizeBytes")] + public long? DiskSizeBytes {get; private set; } /// - /// Gets incremental snapshots for a disk share an incremental snapshot - /// family id. The Get Page Range Diff API can only be called on - /// incremental snapshots with the same family id. + /// Gets unique Guid identifying the resource. /// - [JsonProperty(PropertyName = "properties.incrementalSnapshotFamilyId")] - public string IncrementalSnapshotFamilyId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueId")] + public string UniqueId {get; private set; } /// - /// Gets or sets encryption property can be used to encrypt data at - /// rest with customer managed keys or platform managed keys. + /// Gets or sets encryption settings collection used be Azure Disk Encryption, + /// can contain multiple encryption settings per disk or snapshot. /// - [JsonProperty(PropertyName = "properties.encryption")] - public Encryption Encryption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryptionSettingsCollection")] + public EncryptionSettingsCollection EncryptionSettingsCollection {get; set; } /// - /// Gets or sets policy for accessing the disk via network. Possible - /// values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + /// Gets the disk provisioning state. /// - [JsonProperty(PropertyName = "properties.networkAccessPolicy")] - public string NetworkAccessPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets ARM id of the DiskAccess resource for using private - /// endpoints on disks. + /// Gets or sets whether a snapshot is incremental. Incremental snapshots on + /// the same disk occupy less space than full snapshots and can be diffed. /// - [JsonProperty(PropertyName = "properties.diskAccessId")] - public string DiskAccessId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.incremental")] + public bool? Incremental {get; set; } /// - /// Gets or sets contains the security related information for the - /// resource. + /// Gets incremental snapshots for a disk share an incremental snapshot family + /// id. The Get Page Range Diff API can only be called on incremental snapshots + /// with the same family id. /// - [JsonProperty(PropertyName = "properties.securityProfile")] - public DiskSecurityProfile SecurityProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.incrementalSnapshotFamilyId")] + public string IncrementalSnapshotFamilyId {get; private set; } /// - /// Gets or sets indicates the OS on a snapshot supports hibernation. + /// Gets or sets policy for accessing the disk via network. Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' /// - [JsonProperty(PropertyName = "properties.supportsHibernation")] - public bool? SupportsHibernation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkAccessPolicy")] + public string NetworkAccessPolicy {get; set; } /// - /// Gets or sets policy for controlling export on the disk. Possible - /// values include: 'Enabled', 'Disabled' + /// Gets or sets aRM id of the DiskAccess resource for using private endpoints + /// on disks. /// - [JsonProperty(PropertyName = "properties.publicNetworkAccess")] - public string PublicNetworkAccess { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskAccessId")] + public string DiskAccessId {get; set; } /// - /// Gets or sets percentage complete for the background copy when a - /// resource is created via the CopyStart operation. + /// Gets or sets contains the security related information for the resource. /// - [JsonProperty(PropertyName = "properties.completionPercent")] - public double? CompletionPercent { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityProfile")] + public DiskSecurityProfile SecurityProfile {get; set; } /// - /// Gets or sets indicates the error details if the background copy of - /// a resource created via the CopyStart operation fails. + /// Gets or sets indicates the OS on a snapshot supports hibernation. /// - [JsonProperty(PropertyName = "properties.copyCompletionError")] - public CopyCompletionError CopyCompletionError { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.supportsHibernation")] + public bool? SupportsHibernation {get; set; } /// - /// Gets or sets additional authentication requirements when exporting - /// or uploading to a disk or snapshot. Possible values include: - /// 'AzureActiveDirectory', 'None' + /// Gets or sets policy for controlling export on the disk. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.dataAccessAuthMode")] - public string DataAccessAuthMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicNetworkAccess")] + public string PublicNetworkAccess {get; set; } /// - /// Gets the state of snapshot which determines the access availability - /// of the snapshot. Possible values include: 'Unknown', 'Pending', - /// 'Available', 'InstantAccess', 'AvailableWithInstantAccess' + /// Gets or sets percentage complete for the background copy when a resource is + /// created via the CopyStart operation. /// - [JsonProperty(PropertyName = "properties.snapshotAccessState")] - public string SnapshotAccessState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.completionPercent")] + public double? CompletionPercent {get; set; } /// - /// Gets unused. Always Null. + /// Gets or sets indicates the error details if the background copy of a + /// resource created via the CopyStart operation fails. /// - [JsonProperty(PropertyName = "managedBy")] - public string ManagedBy { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.copyCompletionError")] + public CopyCompletionError CopyCompletionError {get; set; } /// - /// Gets or sets the snapshots sku name. Can be Standard_LRS, - /// Premium_LRS, or Standard_ZRS. This is an optional parameter for - /// incremental snapshot and the default behavior is the SKU will be - /// set to the same sku as the previous snapshot + /// Gets or sets additional authentication requirements when exporting or + /// uploading to a disk or snapshot. Possible values include: 'AzureActiveDirectory', 'None' /// - [JsonProperty(PropertyName = "sku")] - public SnapshotSku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dataAccessAuthMode")] + public string DataAccessAuthMode {get; set; } /// - /// Gets or sets the extended location where the snapshot will be - /// created. Extended location cannot be changed. + /// Gets the state of snapshot which determines the access availability of the + /// snapshot. Possible values include: 'Unknown', 'Pending', 'Available', 'InstantAccess', 'AvailableWithInstantAccess' /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.snapshotAccessState")] + public string SnapshotAccessState {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (CreationData == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "CreationData"); - } - if (PurchasePlan != null) + + + + if (this.PurchasePlan != null) { - PurchasePlan.Validate(); + this.PurchasePlan.Validate(); } - if (CreationData != null) + + if (this.CreationData != null) { - CreationData.Validate(); + this.CreationData.Validate(); } - if (EncryptionSettingsCollection != null) + + + + + + if (this.EncryptionSettingsCollection != null) { - EncryptionSettingsCollection.Validate(); + this.EncryptionSettingsCollection.Validate(); } - if (CopyCompletionError != null) + + + + + + + if (this.CopyCompletionError != null) { - CopyCompletionError.Validate(); + this.CopyCompletionError.Validate(); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotAccessState.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotAccessState.cs index 3819c257dc80..7236941dc60c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotAccessState.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotAccessState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for SnapshotAccessState. /// + + public static class SnapshotAccessState { /// @@ -21,8 +18,7 @@ public static class SnapshotAccessState /// public const string Unknown = "Unknown"; /// - /// The snapshot cannot be used for restore, copy or download to - /// offline. + /// The snapshot cannot be used for restore, copy or download to offline. /// public const string Pending = "Pending"; /// @@ -31,14 +27,14 @@ public static class SnapshotAccessState /// public const string Available = "Available"; /// - /// The snapshot can be used for restoring disks with fast performance - /// but cannot be copied or downloaded. + /// The snapshot can be used for restoring disks with fast performance but + /// cannot be copied or downloaded. /// public const string InstantAccess = "InstantAccess"; /// - /// The snapshot can be used for restoring disks with fast performance, - /// copied and downloaded. + /// The snapshot can be used for restoring disks with fast performance, copied + /// and downloaded. /// public const string AvailableWithInstantAccess = "AvailableWithInstantAccess"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotProperties.cs new file mode 100644 index 000000000000..99599cad7f0c --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotProperties.cs @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Snapshot resource properties. + /// + public partial class SnapshotProperties + { + /// + /// Initializes a new instance of the SnapshotProperties class. + /// + public SnapshotProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SnapshotProperties class. + /// + + /// The time when the snapshot was created. + /// + + /// The Operating System type. + /// Possible values include: 'Windows', 'Linux' + + /// The hypervisor generation of the Virtual Machine. Applicable to OS disks + /// only. + /// Possible values include: 'V1', 'V2' + + /// Purchase plan information for the image from which the source disk for the + /// snapshot was originally created. + /// + + /// List of supported capabilities for the image from which the source disk + /// from the snapshot was originally created. + /// + + /// Disk source information. CreationData information cannot be changed after + /// the disk has been created. + /// + + /// If creationData.createOption is Empty, this field is mandatory and it + /// indicates the size of the disk to create. If this field is present for + /// updates or creation with other options, it indicates a resize. Resizes are + /// only allowed if the disk is not attached to a running VM, and can only + /// increase the disk's size. + /// + + /// The size of the disk in bytes. This field is read only. + /// + + /// The state of the snapshot. + /// Possible values include: 'Unattached', 'Attached', 'Reserved', 'Frozen', + /// 'ActiveSAS', 'ActiveSASFrozen', 'ReadyToUpload', 'ActiveUpload' + + /// Unique Guid identifying the resource. + /// + + /// Encryption settings collection used be Azure Disk Encryption, can contain + /// multiple encryption settings per disk or snapshot. + /// + + /// The disk provisioning state. + /// + + /// Whether a snapshot is incremental. Incremental snapshots on the same disk + /// occupy less space than full snapshots and can be diffed. + /// + + /// Incremental snapshots for a disk share an incremental snapshot family id. + /// The Get Page Range Diff API can only be called on incremental snapshots + /// with the same family id. + /// + + /// Encryption property can be used to encrypt data at rest with customer + /// managed keys or platform managed keys. + /// + + /// Policy for accessing the disk via network. + /// Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + + /// ARM id of the DiskAccess resource for using private endpoints on disks. + /// + + /// Contains the security related information for the resource. + /// + + /// Indicates the OS on a snapshot supports hibernation. + /// + + /// Policy for controlling export on the disk. + /// Possible values include: 'Enabled', 'Disabled' + + /// Percentage complete for the background copy when a resource is created via + /// the CopyStart operation. + /// + + /// Indicates the error details if the background copy of a resource created + /// via the CopyStart operation fails. + /// + + /// Additional authentication requirements when exporting or uploading to a + /// disk or snapshot. + /// Possible values include: 'AzureActiveDirectory', 'None' + + /// The state of snapshot which determines the access availability of the + /// snapshot. + /// Possible values include: 'Unknown', 'Pending', 'Available', + /// 'InstantAccess', 'AvailableWithInstantAccess' + public SnapshotProperties(CreationData creationData, System.DateTime? timeCreated = default(System.DateTime?), OperatingSystemTypes? osType = default(OperatingSystemTypes?), string hyperVGeneration = default(string), PurchasePlan purchasePlan = default(PurchasePlan), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), int? diskSizeGb = default(int?), long? diskSizeBytes = default(long?), string diskState = default(string), string uniqueId = default(string), EncryptionSettingsCollection encryptionSettingsCollection = default(EncryptionSettingsCollection), string provisioningState = default(string), bool? incremental = default(bool?), string incrementalSnapshotFamilyId = default(string), Encryption encryption = default(Encryption), string networkAccessPolicy = default(string), string diskAccessId = default(string), DiskSecurityProfile securityProfile = default(DiskSecurityProfile), bool? supportsHibernation = default(bool?), string publicNetworkAccess = default(string), double? completionPercent = default(double?), CopyCompletionError copyCompletionError = default(CopyCompletionError), string dataAccessAuthMode = default(string), string snapshotAccessState = default(string)) + + { + this.TimeCreated = timeCreated; + this.OsType = osType; + this.HyperVGeneration = hyperVGeneration; + this.PurchasePlan = purchasePlan; + this.SupportedCapabilities = supportedCapabilities; + this.CreationData = creationData; + this.DiskSizeGB = diskSizeGb; + this.DiskSizeBytes = diskSizeBytes; + this.DiskState = diskState; + this.UniqueId = uniqueId; + this.EncryptionSettingsCollection = encryptionSettingsCollection; + this.ProvisioningState = provisioningState; + this.Incremental = incremental; + this.IncrementalSnapshotFamilyId = incrementalSnapshotFamilyId; + this.Encryption = encryption; + this.NetworkAccessPolicy = networkAccessPolicy; + this.DiskAccessId = diskAccessId; + this.SecurityProfile = securityProfile; + this.SupportsHibernation = supportsHibernation; + this.PublicNetworkAccess = publicNetworkAccess; + this.CompletionPercent = completionPercent; + this.CopyCompletionError = copyCompletionError; + this.DataAccessAuthMode = dataAccessAuthMode; + this.SnapshotAccessState = snapshotAccessState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the time when the snapshot was created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeCreated")] + public System.DateTime? TimeCreated {get; private set; } + + /// + /// Gets or sets the Operating System type. Possible values include: 'Windows', 'Linux' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public OperatingSystemTypes? OsType {get; set; } + + /// + /// Gets or sets the hypervisor generation of the Virtual Machine. Applicable + /// to OS disks only. Possible values include: 'V1', 'V2' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hyperVGeneration")] + public string HyperVGeneration {get; set; } + + /// + /// Gets or sets purchase plan information for the image from which the source + /// disk for the snapshot was originally created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "purchasePlan")] + public PurchasePlan PurchasePlan {get; set; } + + /// + /// Gets or sets list of supported capabilities for the image from which the + /// source disk from the snapshot was originally created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "supportedCapabilities")] + public SupportedCapabilities SupportedCapabilities {get; set; } + + /// + /// Gets or sets disk source information. CreationData information cannot be + /// changed after the disk has been created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "creationData")] + public CreationData CreationData {get; set; } + + /// + /// Gets or sets if creationData.createOption is Empty, this field is mandatory + /// and it indicates the size of the disk to create. If this field is present + /// for updates or creation with other options, it indicates a resize. Resizes + /// are only allowed if the disk is not attached to a running VM, and can only + /// increase the disk's size. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeGB")] + public int? DiskSizeGB {get; set; } + + /// + /// Gets the size of the disk in bytes. This field is read only. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeBytes")] + public long? DiskSizeBytes {get; private set; } + + /// + /// Gets the state of the snapshot. Possible values include: 'Unattached', 'Attached', 'Reserved', 'Frozen', 'ActiveSAS', 'ActiveSASFrozen', 'ReadyToUpload', 'ActiveUpload' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskState")] + public string DiskState {get; private set; } + + /// + /// Gets unique Guid identifying the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueId")] + public string UniqueId {get; private set; } + + /// + /// Gets or sets encryption settings collection used be Azure Disk Encryption, + /// can contain multiple encryption settings per disk or snapshot. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptionSettingsCollection")] + public EncryptionSettingsCollection EncryptionSettingsCollection {get; set; } + + /// + /// Gets the disk provisioning state. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets whether a snapshot is incremental. Incremental snapshots on + /// the same disk occupy less space than full snapshots and can be diffed. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "incremental")] + public bool? Incremental {get; set; } + + /// + /// Gets incremental snapshots for a disk share an incremental snapshot family + /// id. The Get Page Range Diff API can only be called on incremental snapshots + /// with the same family id. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "incrementalSnapshotFamilyId")] + public string IncrementalSnapshotFamilyId {get; private set; } + + /// + /// Gets or sets encryption property can be used to encrypt data at rest with + /// customer managed keys or platform managed keys. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encryption")] + public Encryption Encryption {get; set; } + + /// + /// Gets or sets policy for accessing the disk via network. Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkAccessPolicy")] + public string NetworkAccessPolicy {get; set; } + + /// + /// Gets or sets aRM id of the DiskAccess resource for using private endpoints + /// on disks. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskAccessId")] + public string DiskAccessId {get; set; } + + /// + /// Gets or sets contains the security related information for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "securityProfile")] + public DiskSecurityProfile SecurityProfile {get; set; } + + /// + /// Gets or sets indicates the OS on a snapshot supports hibernation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "supportsHibernation")] + public bool? SupportsHibernation {get; set; } + + /// + /// Gets or sets policy for controlling export on the disk. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicNetworkAccess")] + public string PublicNetworkAccess {get; set; } + + /// + /// Gets or sets percentage complete for the background copy when a resource is + /// created via the CopyStart operation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "completionPercent")] + public double? CompletionPercent {get; set; } + + /// + /// Gets or sets indicates the error details if the background copy of a + /// resource created via the CopyStart operation fails. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "copyCompletionError")] + public CopyCompletionError CopyCompletionError {get; set; } + + /// + /// Gets or sets additional authentication requirements when exporting or + /// uploading to a disk or snapshot. Possible values include: 'AzureActiveDirectory', 'None' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataAccessAuthMode")] + public string DataAccessAuthMode {get; set; } + + /// + /// Gets the state of snapshot which determines the access availability of the + /// snapshot. Possible values include: 'Unknown', 'Pending', 'Available', 'InstantAccess', 'AvailableWithInstantAccess' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "snapshotAccessState")] + public string SnapshotAccessState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.CreationData == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CreationData"); + } + + + if (this.PurchasePlan != null) + { + this.PurchasePlan.Validate(); + } + + if (this.CreationData != null) + { + this.CreationData.Validate(); + } + + + if (this.EncryptionSettingsCollection != null) + { + this.EncryptionSettingsCollection.Validate(); + } + + + + + + + + if (this.CopyCompletionError != null) + { + this.CopyCompletionError.Validate(); + } + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotSku.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotSku.cs index 4f67ff26f261..24daea453058 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotSku.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotSku.cs @@ -1,23 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// The snapshots sku name. Can be Standard_LRS, Premium_LRS, or - /// Standard_ZRS. This is an optional parameter for incremental snapshot - /// and the default behavior is the SKU will be set to the same sku as the - /// previous snapshot + /// The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. + /// This is an optional parameter for incremental snapshot and the default + /// behavior is the SKU will be set to the same sku as the previous snapshot /// public partial class SnapshotSku { @@ -32,13 +25,17 @@ public SnapshotSku() /// /// Initializes a new instance of the SnapshotSku class. /// - /// The sku name. Possible values include: - /// 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' - /// The sku tier. + + /// The sku name. + /// Possible values include: 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + + /// The sku tier. + /// public SnapshotSku(string name = default(string), string tier = default(string)) + { - Name = name; - Tier = tier; + this.Name = name; + this.Tier = tier; CustomInit(); } @@ -47,18 +44,17 @@ public SnapshotSku() /// partial void CustomInit(); + /// - /// Gets or sets the sku name. Possible values include: 'Standard_LRS', - /// 'Premium_LRS', 'Standard_ZRS' + /// Gets or sets the sku name. Possible values include: 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets the sku tier. /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] + public string Tier {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotStorageAccountTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotStorageAccountTypes.cs index 966937f79089..57b1fa629df2 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotStorageAccountTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotStorageAccountTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for SnapshotStorageAccountTypes. /// + + public static class SnapshotStorageAccountTypes { /// @@ -29,4 +26,4 @@ public static class SnapshotStorageAccountTypes /// public const string StandardZRS = "Standard_ZRS"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotUpdate.cs index 613064ad152f..08569b6a8e7d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotUpdate.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Snapshot update resource. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class SnapshotUpdate { /// @@ -34,58 +24,73 @@ public SnapshotUpdate() /// /// Initializes a new instance of the SnapshotUpdate class. /// - /// the Operating System type. Possible values - /// include: 'Windows', 'Linux' - /// If creationData.createOption is Empty, - /// this field is mandatory and it indicates the size of the disk to - /// create. If this field is present for updates or creation with other - /// options, it indicates a resize. Resizes are only allowed if the - /// disk is not attached to a running VM, and can only increase the - /// disk's size. - /// Encryption settings - /// collection used be Azure Disk Encryption, can contain multiple - /// encryption settings per disk or snapshot. - /// Encryption property can be used to encrypt - /// data at rest with customer managed keys or platform managed - /// keys. - /// Policy for accessing the disk via - /// network. Possible values include: 'AllowAll', 'AllowPrivate', - /// 'DenyAll' - /// ARM id of the DiskAccess resource for - /// using private endpoints on disks. - /// Indicates the OS on a snapshot - /// supports hibernation. - /// Policy for controlling export on - /// the disk. Possible values include: 'Enabled', 'Disabled' - /// Additional authentication - /// requirements when exporting or uploading to a disk or snapshot. - /// Possible values include: 'AzureActiveDirectory', 'None' - /// List of supported capabilities - /// for the image from which the OS disk was created. - /// The state of snapshot which - /// determines the access availability of the snapshot. Possible values - /// include: 'Unknown', 'Pending', 'Available', 'InstantAccess', - /// 'AvailableWithInstantAccess' - /// Resource tags - /// The snapshots sku name. Can be Standard_LRS, - /// Premium_LRS, or Standard_ZRS. This is an optional parameter for - /// incremental snapshot and the default behavior is the SKU will be - /// set to the same sku as the previous snapshot - public SnapshotUpdate(OperatingSystemTypes? osType = default(OperatingSystemTypes?), int? diskSizeGB = default(int?), EncryptionSettingsCollection encryptionSettingsCollection = default(EncryptionSettingsCollection), Encryption encryption = default(Encryption), string networkAccessPolicy = default(string), string diskAccessId = default(string), bool? supportsHibernation = default(bool?), string publicNetworkAccess = default(string), string dataAccessAuthMode = default(string), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), string snapshotAccessState = default(string), IDictionary tags = default(IDictionary), SnapshotSku sku = default(SnapshotSku)) + + /// Resource tags + /// + + /// The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. + /// This is an optional parameter for incremental snapshot and the default + /// behavior is the SKU will be set to the same sku as the previous snapshot + /// + + /// Encryption property can be used to encrypt data at rest with customer + /// managed keys or platform managed keys. + /// + + /// List of supported capabilities for the image from which the OS disk was + /// created. + /// + + /// the Operating System type. + /// Possible values include: 'Windows', 'Linux' + + /// If creationData.createOption is Empty, this field is mandatory and it + /// indicates the size of the disk to create. If this field is present for + /// updates or creation with other options, it indicates a resize. Resizes are + /// only allowed if the disk is not attached to a running VM, and can only + /// increase the disk's size. + /// + + /// Encryption settings collection used be Azure Disk Encryption, can contain + /// multiple encryption settings per disk or snapshot. + /// + + /// Policy for accessing the disk via network. + /// Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + + /// ARM id of the DiskAccess resource for using private endpoints on disks. + /// + + /// Indicates the OS on a snapshot supports hibernation. + /// + + /// Policy for controlling export on the disk. + /// Possible values include: 'Enabled', 'Disabled' + + /// Additional authentication requirements when exporting or uploading to a + /// disk or snapshot. + /// Possible values include: 'AzureActiveDirectory', 'None' + + /// The state of snapshot which determines the access availability of the + /// snapshot. + /// Possible values include: 'Unknown', 'Pending', 'Available', + /// 'InstantAccess', 'AvailableWithInstantAccess' + public SnapshotUpdate(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), SnapshotSku sku = default(SnapshotSku), Encryption encryption = default(Encryption), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), OperatingSystemTypes? osType = default(OperatingSystemTypes?), int? diskSizeGb = default(int?), EncryptionSettingsCollection encryptionSettingsCollection = default(EncryptionSettingsCollection), string networkAccessPolicy = default(string), string diskAccessId = default(string), bool? supportsHibernation = default(bool?), string publicNetworkAccess = default(string), string dataAccessAuthMode = default(string), string snapshotAccessState = default(string)) + { - OsType = osType; - DiskSizeGB = diskSizeGB; - EncryptionSettingsCollection = encryptionSettingsCollection; - Encryption = encryption; - NetworkAccessPolicy = networkAccessPolicy; - DiskAccessId = diskAccessId; - SupportsHibernation = supportsHibernation; - PublicNetworkAccess = publicNetworkAccess; - DataAccessAuthMode = dataAccessAuthMode; - SupportedCapabilities = supportedCapabilities; - SnapshotAccessState = snapshotAccessState; - Tags = tags; - Sku = sku; + this.Tags = tags; + this.Sku = sku; + this.Encryption = encryption; + this.SupportedCapabilities = supportedCapabilities; + this.OsType = osType; + this.DiskSizeGB = diskSizeGb; + this.EncryptionSettingsCollection = encryptionSettingsCollection; + this.NetworkAccessPolicy = networkAccessPolicy; + this.DiskAccessId = diskAccessId; + this.SupportsHibernation = supportsHibernation; + this.PublicNetworkAccess = publicNetworkAccess; + this.DataAccessAuthMode = dataAccessAuthMode; + this.SnapshotAccessState = snapshotAccessState; CustomInit(); } @@ -94,115 +99,119 @@ public SnapshotUpdate() /// partial void CustomInit(); + /// - /// Gets or sets the Operating System type. Possible values include: - /// 'Windows', 'Linux' + /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "properties.osType")] - public OperatingSystemTypes? OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets or sets if creationData.createOption is Empty, this field is - /// mandatory and it indicates the size of the disk to create. If this - /// field is present for updates or creation with other options, it - /// indicates a resize. Resizes are only allowed if the disk is not - /// attached to a running VM, and can only increase the disk's size. + /// Gets or sets the snapshots sku name. Can be Standard_LRS, Premium_LRS, or + /// Standard_ZRS. This is an optional parameter for incremental snapshot and + /// the default behavior is the SKU will be set to the same sku as the previous + /// snapshot /// - [JsonProperty(PropertyName = "properties.diskSizeGB")] - public int? DiskSizeGB { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public SnapshotSku Sku {get; set; } /// - /// Gets or sets encryption settings collection used be Azure Disk - /// Encryption, can contain multiple encryption settings per disk or - /// snapshot. + /// Gets or sets encryption property can be used to encrypt data at rest with + /// customer managed keys or platform managed keys. /// - [JsonProperty(PropertyName = "properties.encryptionSettingsCollection")] - public EncryptionSettingsCollection EncryptionSettingsCollection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryption")] + public Encryption Encryption {get; set; } /// - /// Gets or sets encryption property can be used to encrypt data at - /// rest with customer managed keys or platform managed keys. + /// Gets or sets list of supported capabilities for the image from which the OS + /// disk was created. /// - [JsonProperty(PropertyName = "properties.encryption")] - public Encryption Encryption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.supportedCapabilities")] + public SupportedCapabilities SupportedCapabilities {get; set; } /// - /// Gets or sets policy for accessing the disk via network. Possible - /// values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + /// Gets or sets the Operating System type. Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "properties.networkAccessPolicy")] - public string NetworkAccessPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osType")] + public OperatingSystemTypes? OsType {get; set; } /// - /// Gets or sets ARM id of the DiskAccess resource for using private - /// endpoints on disks. + /// Gets or sets if creationData.createOption is Empty, this field is mandatory + /// and it indicates the size of the disk to create. If this field is present + /// for updates or creation with other options, it indicates a resize. Resizes + /// are only allowed if the disk is not attached to a running VM, and can only + /// increase the disk's size. /// - [JsonProperty(PropertyName = "properties.diskAccessId")] - public string DiskAccessId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskSizeGB")] + public int? DiskSizeGB {get; set; } /// - /// Gets or sets indicates the OS on a snapshot supports hibernation. + /// Gets or sets encryption settings collection used be Azure Disk Encryption, + /// can contain multiple encryption settings per disk or snapshot. /// - [JsonProperty(PropertyName = "properties.supportsHibernation")] - public bool? SupportsHibernation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryptionSettingsCollection")] + public EncryptionSettingsCollection EncryptionSettingsCollection {get; set; } /// - /// Gets or sets policy for controlling export on the disk. Possible - /// values include: 'Enabled', 'Disabled' + /// Gets or sets policy for accessing the disk via network. Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' /// - [JsonProperty(PropertyName = "properties.publicNetworkAccess")] - public string PublicNetworkAccess { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkAccessPolicy")] + public string NetworkAccessPolicy {get; set; } /// - /// Gets or sets additional authentication requirements when exporting - /// or uploading to a disk or snapshot. Possible values include: - /// 'AzureActiveDirectory', 'None' + /// Gets or sets aRM id of the DiskAccess resource for using private endpoints + /// on disks. /// - [JsonProperty(PropertyName = "properties.dataAccessAuthMode")] - public string DataAccessAuthMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diskAccessId")] + public string DiskAccessId {get; set; } /// - /// Gets or sets list of supported capabilities for the image from - /// which the OS disk was created. + /// Gets or sets indicates the OS on a snapshot supports hibernation. /// - [JsonProperty(PropertyName = "properties.supportedCapabilities")] - public SupportedCapabilities SupportedCapabilities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.supportsHibernation")] + public bool? SupportsHibernation {get; set; } /// - /// Gets the state of snapshot which determines the access availability - /// of the snapshot. Possible values include: 'Unknown', 'Pending', - /// 'Available', 'InstantAccess', 'AvailableWithInstantAccess' + /// Gets or sets policy for controlling export on the disk. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.snapshotAccessState")] - public string SnapshotAccessState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicNetworkAccess")] + public string PublicNetworkAccess {get; set; } /// - /// Gets or sets resource tags + /// Gets or sets additional authentication requirements when exporting or + /// uploading to a disk or snapshot. Possible values include: 'AzureActiveDirectory', 'None' /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dataAccessAuthMode")] + public string DataAccessAuthMode {get; set; } /// - /// Gets or sets the snapshots sku name. Can be Standard_LRS, - /// Premium_LRS, or Standard_ZRS. This is an optional parameter for - /// incremental snapshot and the default behavior is the SKU will be - /// set to the same sku as the previous snapshot + /// Gets the state of snapshot which determines the access availability of the + /// snapshot. Possible values include: 'Unknown', 'Pending', 'Available', 'InstantAccess', 'AvailableWithInstantAccess' /// - [JsonProperty(PropertyName = "sku")] - public SnapshotSku Sku { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.snapshotAccessState")] + public string SnapshotAccessState {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (EncryptionSettingsCollection != null) + + + + + + if (this.EncryptionSettingsCollection != null) { - EncryptionSettingsCollection.Validate(); + this.EncryptionSettingsCollection.Validate(); } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotUpdateProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotUpdateProperties.cs new file mode 100644 index 000000000000..8d671fc945de --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SnapshotUpdateProperties.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Snapshot resource update properties. + /// + public partial class SnapshotUpdateProperties + { + /// + /// Initializes a new instance of the SnapshotUpdateProperties class. + /// + public SnapshotUpdateProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SnapshotUpdateProperties class. + /// + + /// the Operating System type. + /// Possible values include: 'Windows', 'Linux' + + /// If creationData.createOption is Empty, this field is mandatory and it + /// indicates the size of the disk to create. If this field is present for + /// updates or creation with other options, it indicates a resize. Resizes are + /// only allowed if the disk is not attached to a running VM, and can only + /// increase the disk's size. + /// + + /// Encryption settings collection used be Azure Disk Encryption, can contain + /// multiple encryption settings per disk or snapshot. + /// + + /// Encryption property can be used to encrypt data at rest with customer + /// managed keys or platform managed keys. + /// + + /// Policy for accessing the disk via network. + /// Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + + /// ARM id of the DiskAccess resource for using private endpoints on disks. + /// + + /// Indicates the OS on a snapshot supports hibernation. + /// + + /// Policy for controlling export on the disk. + /// Possible values include: 'Enabled', 'Disabled' + + /// Additional authentication requirements when exporting or uploading to a + /// disk or snapshot. + /// Possible values include: 'AzureActiveDirectory', 'None' + + /// List of supported capabilities for the image from which the OS disk was + /// created. + /// + + /// The state of snapshot which determines the access availability of the + /// snapshot. + /// Possible values include: 'Unknown', 'Pending', 'Available', + /// 'InstantAccess', 'AvailableWithInstantAccess' + public SnapshotUpdateProperties(OperatingSystemTypes? osType = default(OperatingSystemTypes?), int? diskSizeGb = default(int?), EncryptionSettingsCollection encryptionSettingsCollection = default(EncryptionSettingsCollection), Encryption encryption = default(Encryption), string networkAccessPolicy = default(string), string diskAccessId = default(string), bool? supportsHibernation = default(bool?), string publicNetworkAccess = default(string), string dataAccessAuthMode = default(string), SupportedCapabilities supportedCapabilities = default(SupportedCapabilities), string snapshotAccessState = default(string)) + + { + this.OsType = osType; + this.DiskSizeGB = diskSizeGb; + this.EncryptionSettingsCollection = encryptionSettingsCollection; + this.Encryption = encryption; + this.NetworkAccessPolicy = networkAccessPolicy; + this.DiskAccessId = diskAccessId; + this.SupportsHibernation = supportsHibernation; + this.PublicNetworkAccess = publicNetworkAccess; + this.DataAccessAuthMode = dataAccessAuthMode; + this.SupportedCapabilities = supportedCapabilities; + this.SnapshotAccessState = snapshotAccessState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the Operating System type. Possible values include: 'Windows', 'Linux' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public OperatingSystemTypes? OsType {get; set; } + + /// + /// Gets or sets if creationData.createOption is Empty, this field is mandatory + /// and it indicates the size of the disk to create. If this field is present + /// for updates or creation with other options, it indicates a resize. Resizes + /// are only allowed if the disk is not attached to a running VM, and can only + /// increase the disk's size. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeGB")] + public int? DiskSizeGB {get; set; } + + /// + /// Gets or sets encryption settings collection used be Azure Disk Encryption, + /// can contain multiple encryption settings per disk or snapshot. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptionSettingsCollection")] + public EncryptionSettingsCollection EncryptionSettingsCollection {get; set; } + + /// + /// Gets or sets encryption property can be used to encrypt data at rest with + /// customer managed keys or platform managed keys. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encryption")] + public Encryption Encryption {get; set; } + + /// + /// Gets or sets policy for accessing the disk via network. Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkAccessPolicy")] + public string NetworkAccessPolicy {get; set; } + + /// + /// Gets or sets aRM id of the DiskAccess resource for using private endpoints + /// on disks. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskAccessId")] + public string DiskAccessId {get; set; } + + /// + /// Gets or sets indicates the OS on a snapshot supports hibernation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "supportsHibernation")] + public bool? SupportsHibernation {get; set; } + + /// + /// Gets or sets policy for controlling export on the disk. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicNetworkAccess")] + public string PublicNetworkAccess {get; set; } + + /// + /// Gets or sets additional authentication requirements when exporting or + /// uploading to a disk or snapshot. Possible values include: 'AzureActiveDirectory', 'None' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataAccessAuthMode")] + public string DataAccessAuthMode {get; set; } + + /// + /// Gets or sets list of supported capabilities for the image from which the OS + /// disk was created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "supportedCapabilities")] + public SupportedCapabilities SupportedCapabilities {get; set; } + + /// + /// Gets the state of snapshot which determines the access availability of the + /// snapshot. Possible values include: 'Unknown', 'Pending', 'Available', 'InstantAccess', 'AvailableWithInstantAccess' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "snapshotAccessState")] + public string SnapshotAccessState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + if (this.EncryptionSettingsCollection != null) + { + this.EncryptionSettingsCollection.Validate(); + } + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SoftDeletePolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SoftDeletePolicy.cs index d0aa93c2b533..e8a5ebb4406c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SoftDeletePolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SoftDeletePolicy.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,14 @@ public SoftDeletePolicy() /// /// Initializes a new instance of the SoftDeletePolicy class. /// - /// Enables soft-deletion for - /// resources in this gallery, allowing them to be recovered within - /// retention time. + + /// Enables soft-deletion for resources in this gallery, allowing them to be + /// recovered within retention time. + /// public SoftDeletePolicy(bool? isSoftDeleteEnabled = default(bool?)) + { - IsSoftDeleteEnabled = isSoftDeleteEnabled; + this.IsSoftDeleteEnabled = isSoftDeleteEnabled; CustomInit(); } @@ -43,12 +39,12 @@ public SoftDeletePolicy() /// partial void CustomInit(); + /// - /// Gets or sets enables soft-deletion for resources in this gallery, - /// allowing them to be recovered within retention time. + /// Gets or sets enables soft-deletion for resources in this gallery, allowing + /// them to be recovered within retention time. /// - [JsonProperty(PropertyName = "isSoftDeleteEnabled")] - public bool? IsSoftDeleteEnabled { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "isSoftDeleteEnabled")] + public bool? IsSoftDeleteEnabled {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SoftDeletedArtifactTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SoftDeletedArtifactTypes.cs index f1bbd3a98d5b..64981dd3a600 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SoftDeletedArtifactTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SoftDeletedArtifactTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for SoftDeletedArtifactTypes. /// + + public static class SoftDeletedArtifactTypes { public const string Images = "Images"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SourceVault.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SourceVault.cs index 3d5219938ba9..6f8a5335fe32 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SourceVault.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SourceVault.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -30,10 +24,13 @@ public SourceVault() /// /// Initializes a new instance of the SourceVault class. /// - /// Resource Id + + /// Resource Id + /// public SourceVault(string id = default(string)) + { - Id = id; + this.Id = id; CustomInit(); } @@ -42,11 +39,11 @@ public SourceVault() /// partial void CustomInit(); + /// /// Gets or sets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SpotRestorePolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SpotRestorePolicy.cs index 3bbc5225f215..e1b551f50b0f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SpotRestorePolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SpotRestorePolicy.cs @@ -1,23 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// /// Specifies the Spot-Try-Restore properties for the virtual machine scale - /// set. With this property customer can enable or disable automatic - /// restore of the evicted Spot VMSS VM instances opportunistically based - /// on capacity availability and pricing constraint. + /// set. With this property customer can enable or disable automatic restore of + /// the evicted Spot VMSS VM instances opportunistically based on capacity + /// availability and pricing constraint. /// public partial class SpotRestorePolicy { @@ -32,17 +26,20 @@ public SpotRestorePolicy() /// /// Initializes a new instance of the SpotRestorePolicy class. /// - /// Enables the Spot-Try-Restore feature where - /// evicted VMSS SPOT instances will be tried to be restored - /// opportunistically based on capacity availability and pricing - /// constraints - /// Timeout value expressed as an ISO 8601 - /// time duration after which the platform will not try to restore the - /// VMSS SPOT instances + + /// Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will + /// be tried to be restored opportunistically based on capacity availability + /// and pricing constraints + /// + + /// Timeout value expressed as an ISO 8601 time duration after which the + /// platform will not try to restore the VMSS SPOT instances + /// public SpotRestorePolicy(bool? enabled = default(bool?), string restoreTimeout = default(string)) + { - Enabled = enabled; - RestoreTimeout = restoreTimeout; + this.Enabled = enabled; + this.RestoreTimeout = restoreTimeout; CustomInit(); } @@ -51,21 +48,20 @@ public SpotRestorePolicy() /// partial void CustomInit(); + /// - /// Gets or sets enables the Spot-Try-Restore feature where evicted - /// VMSS SPOT instances will be tried to be restored opportunistically - /// based on capacity availability and pricing constraints + /// Gets or sets enables the Spot-Try-Restore feature where evicted VMSS SPOT + /// instances will be tried to be restored opportunistically based on capacity + /// availability and pricing constraints /// - [JsonProperty(PropertyName = "enabled")] - public bool? Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } /// - /// Gets or sets timeout value expressed as an ISO 8601 time duration - /// after which the platform will not try to restore the VMSS SPOT - /// instances + /// Gets or sets timeout value expressed as an ISO 8601 time duration after + /// which the platform will not try to restore the VMSS SPOT instances /// - [JsonProperty(PropertyName = "restoreTimeout")] - public string RestoreTimeout { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "restoreTimeout")] + public string RestoreTimeout {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SshConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SshConfiguration.cs index fb30d37d3d54..e6f8d8af31a9 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SshConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SshConfiguration.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,11 +23,13 @@ public SshConfiguration() /// /// Initializes a new instance of the SshConfiguration class. /// - /// The list of SSH public keys used to - /// authenticate with linux based VMs. - public SshConfiguration(IList publicKeys = default(IList)) + + /// The list of SSH public keys used to authenticate with linux based VMs. + /// + public SshConfiguration(System.Collections.Generic.IList publicKeys = default(System.Collections.Generic.IList)) + { - PublicKeys = publicKeys; + this.PublicKeys = publicKeys; CustomInit(); } @@ -44,12 +38,12 @@ public SshConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets the list of SSH public keys used to authenticate with - /// linux based VMs. + /// Gets or sets the list of SSH public keys used to authenticate with linux + /// based VMs. /// - [JsonProperty(PropertyName = "publicKeys")] - public IList PublicKeys { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "publicKeys")] + public System.Collections.Generic.IList PublicKeys {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SshEncryptionTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SshEncryptionTypes.cs index 3f22d3f174e7..1c2fcc8c702a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SshEncryptionTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SshEncryptionTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for SshEncryptionTypes. /// + + public static class SshEncryptionTypes { public const string RSA = "RSA"; public const string Ed25519 = "Ed25519"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SshGenerateKeyPairInputParameters.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SshGenerateKeyPairInputParameters.cs index 16558fb2de77..229b61e11ac4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SshGenerateKeyPairInputParameters.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SshGenerateKeyPairInputParameters.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class SshGenerateKeyPairInputParameters { /// - /// Initializes a new instance of the SshGenerateKeyPairInputParameters - /// class. + /// Initializes a new instance of the SshGenerateKeyPairInputParameters class. /// public SshGenerateKeyPairInputParameters() { @@ -28,16 +21,16 @@ public SshGenerateKeyPairInputParameters() } /// - /// Initializes a new instance of the SshGenerateKeyPairInputParameters - /// class. + /// Initializes a new instance of the SshGenerateKeyPairInputParameters class. /// - /// The encryption type of the SSH keys to - /// be generated. See SshEncryptionTypes for possible set of values. If - /// not provided, will default to RSA. Possible values include: 'RSA', - /// 'Ed25519' + + /// The encryption type of the SSH keys to be generated. See SshEncryptionTypes + /// for possible set of values. If not provided, will default to RSA + /// Possible values include: 'RSA', 'Ed25519' public SshGenerateKeyPairInputParameters(string encryptionType = default(string)) + { - EncryptionType = encryptionType; + this.EncryptionType = encryptionType; CustomInit(); } @@ -46,13 +39,13 @@ public SshGenerateKeyPairInputParameters() /// partial void CustomInit(); + /// - /// Gets or sets the encryption type of the SSH keys to be generated. - /// See SshEncryptionTypes for possible set of values. If not provided, - /// will default to RSA. Possible values include: 'RSA', 'Ed25519' + /// Gets or sets the encryption type of the SSH keys to be generated. See + /// SshEncryptionTypes for possible set of values. If not provided, will + /// default to RSA Possible values include: 'RSA', 'Ed25519' /// - [JsonProperty(PropertyName = "encryptionType")] - public string EncryptionType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptionType")] + public string EncryptionType {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKey.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKey.cs index 8ba357135884..6af70b9e35d7 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKey.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKey.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Contains information about SSH certificate public key and the path on - /// the Linux VM where the public key is placed. + /// Contains information about SSH certificate public key and the path on the + /// Linux VM where the public key is placed. /// public partial class SshPublicKey { @@ -30,19 +24,22 @@ public SshPublicKey() /// /// Initializes a new instance of the SshPublicKey class. /// - /// Specifies the full path on the created VM where - /// ssh public key is stored. If the file already exists, the specified - /// key is appended to the file. Example: - /// /home/user/.ssh/authorized_keys - /// SSH public key certificate used to - /// authenticate with the VM through ssh. The key needs to be at least - /// 2048-bit and in ssh-rsa format. For creating ssh keys, see [Create - /// SSH keys on Linux and Mac for Linux VMs in - /// Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + + /// Specifies the full path on the created VM where ssh public key is stored. + /// If the file already exists, the specified key is appended to the file. + /// Example: /home/user/.ssh/authorized_keys + /// + + /// SSH public key certificate used to authenticate with the VM through ssh. + /// The key needs to be at least 2048-bit and in ssh-rsa format. For creating + /// ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in + /// Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + /// public SshPublicKey(string path = default(string), string keyData = default(string)) + { - Path = path; - KeyData = keyData; + this.Path = path; + this.KeyData = keyData; CustomInit(); } @@ -51,23 +48,23 @@ public SshPublicKey() /// partial void CustomInit(); + /// - /// Gets or sets specifies the full path on the created VM where ssh - /// public key is stored. If the file already exists, the specified key - /// is appended to the file. Example: /home/user/.ssh/authorized_keys + /// Gets or sets specifies the full path on the created VM where ssh public key + /// is stored. If the file already exists, the specified key is appended to the + /// file. Example: /home/user/.ssh/authorized_keys /// - [JsonProperty(PropertyName = "path")] - public string Path { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "path")] + public string Path {get; set; } /// - /// Gets or sets SSH public key certificate used to authenticate with - /// the VM through ssh. The key needs to be at least 2048-bit and in - /// ssh-rsa format. For creating ssh keys, see [Create SSH keys on - /// Linux and Mac for Linux VMs in + /// Gets or sets sSH public key certificate used to authenticate with the VM + /// through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. + /// For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs + /// in /// Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). /// - [JsonProperty(PropertyName = "keyData")] - public string KeyData { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "keyData")] + public string KeyData {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKeyGenerateKeyPairResult.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKeyGenerateKeyPairResult.cs index 35ef9c46d432..f84070d4686b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKeyGenerateKeyPairResult.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKeyGenerateKeyPairResult.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class SshPublicKeyGenerateKeyPairResult { /// - /// Initializes a new instance of the SshPublicKeyGenerateKeyPairResult - /// class. + /// Initializes a new instance of the SshPublicKeyGenerateKeyPairResult class. /// public SshPublicKeyGenerateKeyPairResult() { @@ -29,23 +21,27 @@ public SshPublicKeyGenerateKeyPairResult() } /// - /// Initializes a new instance of the SshPublicKeyGenerateKeyPairResult - /// class. + /// Initializes a new instance of the SshPublicKeyGenerateKeyPairResult class. /// - /// Private key portion of the key pair used - /// to authenticate to a virtual machine through ssh. The private key - /// is returned in RFC3447 format and should be treated as a - /// secret. - /// Public key portion of the key pair used to - /// authenticate to a virtual machine through ssh. The public key is in - /// ssh-rsa format. + + /// Private key portion of the key pair used to authenticate to a virtual + /// machine through ssh. The private key is returned in RFC3447 format and + /// should be treated as a secret. + /// + + /// Public key portion of the key pair used to authenticate to a virtual + /// machine through ssh. The public key is in ssh-rsa format. + /// + /// The ARM resource id in the form of - /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} + /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} + /// public SshPublicKeyGenerateKeyPairResult(string privateKey, string publicKey, string id) + { - PrivateKey = privateKey; - PublicKey = publicKey; - Id = id; + this.PrivateKey = privateKey; + this.PublicKey = publicKey; + this.Id = id; CustomInit(); } @@ -54,49 +50,51 @@ public SshPublicKeyGenerateKeyPairResult(string privateKey, string publicKey, st /// partial void CustomInit(); + /// - /// Gets or sets private key portion of the key pair used to - /// authenticate to a virtual machine through ssh. The private key is - /// returned in RFC3447 format and should be treated as a secret. + /// Gets or sets private key portion of the key pair used to authenticate to a + /// virtual machine through ssh. The private key is returned in RFC3447 format + /// and should be treated as a secret. /// - [JsonProperty(PropertyName = "privateKey")] - public string PrivateKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "privateKey")] + public string PrivateKey {get; set; } /// - /// Gets or sets public key portion of the key pair used to - /// authenticate to a virtual machine through ssh. The public key is in - /// ssh-rsa format. + /// Gets or sets public key portion of the key pair used to authenticate to a + /// virtual machine through ssh. The public key is in ssh-rsa format. /// - [JsonProperty(PropertyName = "publicKey")] - public string PublicKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publicKey")] + public string PublicKey {get; set; } /// /// Gets or sets the ARM resource id in the form of /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (PrivateKey == null) + if (this.PrivateKey == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "PrivateKey"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PrivateKey"); } - if (PublicKey == null) + if (this.PublicKey == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "PublicKey"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PublicKey"); } - if (Id == null) + if (this.Id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); } + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKeyResource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKeyResource.cs index 409120e82f04..8168fc893434 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKeyResource.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKeyResource.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specifies information about the SSH public key. /// - [Rest.Serialization.JsonTransformation] - public partial class SshPublicKeyResource : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class SshPublicKeyResource : TrackedResource { /// /// Initializes a new instance of the SshPublicKeyResource class. @@ -34,21 +24,33 @@ public SshPublicKeyResource() /// /// Initializes a new instance of the SshPublicKeyResource class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// SSH public key used to authenticate to a - /// virtual machine through ssh. If this property is not initially - /// provided when the resource is created, the publicKey property will - /// be populated when generateKeyPair is called. If the public key is - /// provided upon resource creation, the provided public key needs to - /// be at least 2048-bit and in ssh-rsa format. - public SshPublicKeyResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string publicKey = default(string)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// SSH public key used to authenticate to a virtual machine through ssh. If + /// this property is not initially provided when the resource is created, the + /// publicKey property will be populated when generateKeyPair is called. If the + /// public key is provided upon resource creation, the provided public key + /// needs to be at least 2048-bit and in ssh-rsa format. + /// + public SshPublicKeyResource(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string publicKey = default(string)) + + : base(location, id, name, type, tags) { - PublicKey = publicKey; + this.PublicKey = publicKey; CustomInit(); } @@ -57,26 +59,26 @@ public SshPublicKeyResource() /// partial void CustomInit(); + /// - /// Gets or sets SSH public key used to authenticate to a virtual - /// machine through ssh. If this property is not initially provided - /// when the resource is created, the publicKey property will be - /// populated when generateKeyPair is called. If the public key is - /// provided upon resource creation, the provided public key needs to - /// be at least 2048-bit and in ssh-rsa format. + /// Gets or sets sSH public key used to authenticate to a virtual machine + /// through ssh. If this property is not initially provided when the resource + /// is created, the publicKey property will be populated when generateKeyPair + /// is called. If the public key is provided upon resource creation, the + /// provided public key needs to be at least 2048-bit and in ssh-rsa format. /// - [JsonProperty(PropertyName = "properties.publicKey")] - public string PublicKey { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicKey")] + public string PublicKey {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKeyResourceProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKeyResourceProperties.cs new file mode 100644 index 000000000000..a84732ac301d --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKeyResourceProperties.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Properties of the SSH public key. + /// + public partial class SshPublicKeyResourceProperties + { + /// + /// Initializes a new instance of the SshPublicKeyResourceProperties class. + /// + public SshPublicKeyResourceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SshPublicKeyResourceProperties class. + /// + + /// SSH public key used to authenticate to a virtual machine through ssh. If + /// this property is not initially provided when the resource is created, the + /// publicKey property will be populated when generateKeyPair is called. If the + /// public key is provided upon resource creation, the provided public key + /// needs to be at least 2048-bit and in ssh-rsa format. + /// + public SshPublicKeyResourceProperties(string publicKey = default(string)) + + { + this.PublicKey = publicKey; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets sSH public key used to authenticate to a virtual machine + /// through ssh. If this property is not initially provided when the resource + /// is created, the publicKey property will be populated when generateKeyPair + /// is called. If the public key is provided upon resource creation, the + /// provided public key needs to be at least 2048-bit and in ssh-rsa format. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicKey")] + public string PublicKey {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKeyUpdateResource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKeyUpdateResource.cs index 9a42496ed622..98d1a925f75a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKeyUpdateResource.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SshPublicKeyUpdateResource.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Specifies information about the SSH public key. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class SshPublicKeyUpdateResource : UpdateResource { /// @@ -34,17 +24,21 @@ public SshPublicKeyUpdateResource() /// /// Initializes a new instance of the SshPublicKeyUpdateResource class. /// - /// Resource tags - /// SSH public key used to authenticate to a - /// virtual machine through ssh. If this property is not initially - /// provided when the resource is created, the publicKey property will - /// be populated when generateKeyPair is called. If the public key is - /// provided upon resource creation, the provided public key needs to - /// be at least 2048-bit and in ssh-rsa format. - public SshPublicKeyUpdateResource(IDictionary tags = default(IDictionary), string publicKey = default(string)) - : base(tags) + + /// Resource tags + /// + + /// SSH public key used to authenticate to a virtual machine through ssh. If + /// this property is not initially provided when the resource is created, the + /// publicKey property will be populated when generateKeyPair is called. If the + /// public key is provided upon resource creation, the provided public key + /// needs to be at least 2048-bit and in ssh-rsa format. + /// + public SshPublicKeyUpdateResource(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string publicKey = default(string)) + + : base(tags) { - PublicKey = publicKey; + this.PublicKey = publicKey; CustomInit(); } @@ -53,16 +47,15 @@ public SshPublicKeyUpdateResource() /// partial void CustomInit(); + /// - /// Gets or sets SSH public key used to authenticate to a virtual - /// machine through ssh. If this property is not initially provided - /// when the resource is created, the publicKey property will be - /// populated when generateKeyPair is called. If the public key is - /// provided upon resource creation, the provided public key needs to - /// be at least 2048-bit and in ssh-rsa format. + /// Gets or sets sSH public key used to authenticate to a virtual machine + /// through ssh. If this property is not initially provided when the resource + /// is created, the publicKey property will be populated when generateKeyPair + /// is called. If the public key is provided upon resource creation, the + /// provided public key needs to be at least 2048-bit and in ssh-rsa format. /// - [JsonProperty(PropertyName = "properties.publicKey")] - public string PublicKey { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicKey")] + public string PublicKey {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/StatusLevelTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/StatusLevelTypes.cs index 1ce3be166e64..39c392dcd1e1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/StatusLevelTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/StatusLevelTypes.cs @@ -1,31 +1,24 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for StatusLevelTypes. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum StatusLevelTypes { - [EnumMember(Value = "Info")] + [System.Runtime.Serialization.EnumMember(Value = "Info")] Info, - [EnumMember(Value = "Warning")] + [System.Runtime.Serialization.EnumMember(Value = "Warning")] Warning, - [EnumMember(Value = "Error")] + [System.Runtime.Serialization.EnumMember(Value = "Error")] Error } internal static class StatusLevelTypesEnumExtension @@ -34,7 +27,6 @@ internal static string ToSerializedValue(this StatusLevelTypes? value) { return value == null ? null : ((StatusLevelTypes)value).ToSerializedValue(); } - internal static string ToSerializedValue(this StatusLevelTypes value) { switch( value ) @@ -48,7 +40,6 @@ internal static string ToSerializedValue(this StatusLevelTypes value) } return null; } - internal static StatusLevelTypes? ParseStatusLevelTypes(this string value) { switch( value ) @@ -63,4 +54,4 @@ internal static string ToSerializedValue(this StatusLevelTypes value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/StorageAccountType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/StorageAccountType.cs index b202e1b4d38f..f9a4d924b47e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/StorageAccountType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/StorageAccountType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for StorageAccountType. /// + + public static class StorageAccountType { public const string StandardLRS = "Standard_LRS"; @@ -21,4 +18,4 @@ public static class StorageAccountType public const string PremiumLRS = "Premium_LRS"; public const string PremiumV2LRS = "PremiumV2_LRS"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/StorageAccountTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/StorageAccountTypes.cs index 840b7e7dc687..49e72737a7b8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/StorageAccountTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/StorageAccountTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for StorageAccountTypes. /// + + public static class StorageAccountTypes { public const string StandardLRS = "Standard_LRS"; @@ -24,4 +21,4 @@ public static class StorageAccountTypes public const string StandardSSDZRS = "StandardSSD_ZRS"; public const string PremiumV2LRS = "PremiumV2_LRS"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/StorageProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/StorageProfile.cs index 11027ea21524..69a0542b099b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/StorageProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/StorageProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,42 +23,48 @@ public StorageProfile() /// /// Initializes a new instance of the StorageProfile class. /// - /// Specifies information about the image - /// to use. You can specify information about platform images, - /// marketplace images, or virtual machine images. This element is - /// required when you want to use a platform image, marketplace image, - /// or virtual machine image, but is not used in other creation - /// operations. - /// Specifies information about the operating - /// system disk used by the virtual machine. For more information about - /// disks, see [About disks and VHDs for Azure virtual - /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). - /// Specifies the parameters that are used to - /// add a data disk to a virtual machine. For more information about - /// disks, see [About disks and VHDs for Azure virtual - /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). - /// Specifies the disk controller type - /// configured for the VM. **Note:** This property will be set to the - /// default disk controller type if not specified provided virtual - /// machine is being created with 'hyperVGeneration' set to V2 based on - /// the capabilities of the operating system disk and VM size from the - /// the specified minimum api version. You need to deallocate the VM - /// before updating its disk controller type unless you are updating - /// the VM size in the VM configuration which implicitly deallocates - /// and reallocates the VM. Minimum api-version: 2022-08-01. Possible - /// values include: 'SCSI', 'NVMe' - /// Specifies whether the - /// regional disks should be aligned/moved to the VM zone. This is - /// applicable only for VMs with placement property set. Please note - /// that this change is irreversible. Minimum api-version: - /// 2024-11-01. - public StorageProfile(ImageReference imageReference = default(ImageReference), OSDisk osDisk = default(OSDisk), IList dataDisks = default(IList), string diskControllerType = default(string), bool? alignRegionalDisksToVMZone = default(bool?)) + + /// Specifies information about the image to use. You can specify information + /// about platform images, marketplace images, or virtual machine images. This + /// element is required when you want to use a platform image, marketplace + /// image, or virtual machine image, but is not used in other creation + /// operations. + /// + + /// Specifies information about the operating system disk used by the virtual + /// machine. For more information about disks, see [About disks and VHDs for + /// Azure virtual + /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + /// + + /// Specifies the parameters that are used to add a data disk to a virtual + /// machine. For more information about disks, see [About disks and VHDs for + /// Azure virtual + /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + /// + + /// Specifies the disk controller type configured for the VM. **Note:** This + /// property will be set to the default disk controller type if not specified + /// provided virtual machine is being created with 'hyperVGeneration' set to V2 + /// based on the capabilities of the operating system disk and VM size from the + /// the specified minimum api version. You need to deallocate the VM before + /// updating its disk controller type unless you are updating the VM size in + /// the VM configuration which implicitly deallocates and reallocates the VM. + /// Minimum api-version: 2022-08-01. + /// Possible values include: 'SCSI', 'NVMe' + + /// Specifies whether the regional disks should be aligned/moved to the VM + /// zone. This is applicable only for VMs with placement property set. Please + /// note that this change is irreversible. Minimum api-version: 2024-11-01. + /// + public StorageProfile(ImageReference imageReference = default(ImageReference), OSDisk osDisk = default(OSDisk), System.Collections.Generic.IList dataDisks = default(System.Collections.Generic.IList), string diskControllerType = default(string), bool? alignRegionalDisksToVMZone = default(bool?)) + { - ImageReference = imageReference; - OsDisk = osDisk; - DataDisks = dataDisks; - DiskControllerType = diskControllerType; - AlignRegionalDisksToVMZone = alignRegionalDisksToVMZone; + this.ImageReference = imageReference; + this.OsDisk = osDisk; + this.DataDisks = dataDisks; + this.DiskControllerType = diskControllerType; + this.AlignRegionalDisksToVMZone = alignRegionalDisksToVMZone; CustomInit(); } @@ -75,73 +73,72 @@ public StorageProfile() /// partial void CustomInit(); + /// - /// Gets or sets specifies information about the image to use. You can - /// specify information about platform images, marketplace images, or - /// virtual machine images. This element is required when you want to - /// use a platform image, marketplace image, or virtual machine image, - /// but is not used in other creation operations. + /// Gets or sets specifies information about the image to use. You can specify + /// information about platform images, marketplace images, or virtual machine + /// images. This element is required when you want to use a platform image, + /// marketplace image, or virtual machine image, but is not used in other + /// creation operations. /// - [JsonProperty(PropertyName = "imageReference")] - public ImageReference ImageReference { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "imageReference")] + public ImageReference ImageReference {get; set; } /// - /// Gets or sets specifies information about the operating system disk - /// used by the virtual machine. For more information about disks, see - /// [About disks and VHDs for Azure virtual + /// Gets or sets specifies information about the operating system disk used by + /// the virtual machine. For more information about disks, see [About disks and + /// VHDs for Azure virtual /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). /// - [JsonProperty(PropertyName = "osDisk")] - public OSDisk OsDisk { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osDisk")] + public OSDisk OsDisk {get; set; } /// - /// Gets or sets specifies the parameters that are used to add a data - /// disk to a virtual machine. For more information about disks, see - /// [About disks and VHDs for Azure virtual + /// Gets or sets specifies the parameters that are used to add a data disk to a + /// virtual machine. For more information about disks, see [About disks and + /// VHDs for Azure virtual /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). /// - [JsonProperty(PropertyName = "dataDisks")] - public IList DataDisks { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDisks")] + public System.Collections.Generic.IList DataDisks {get; set; } /// - /// Gets or sets specifies the disk controller type configured for the - /// VM. **Note:** This property will be set to the default disk - /// controller type if not specified provided virtual machine is being - /// created with 'hyperVGeneration' set to V2 based on the capabilities - /// of the operating system disk and VM size from the the specified - /// minimum api version. You need to deallocate the VM before updating - /// its disk controller type unless you are updating the VM size in the - /// VM configuration which implicitly deallocates and reallocates the - /// VM. Minimum api-version: 2022-08-01. Possible values include: - /// 'SCSI', 'NVMe' + /// Gets or sets specifies the disk controller type configured for the VM. + /// **Note:** This property will be set to the default disk controller type if + /// not specified provided virtual machine is being created with + /// 'hyperVGeneration' set to V2 based on the capabilities of the operating + /// system disk and VM size from the the specified minimum api version. You + /// need to deallocate the VM before updating its disk controller type unless + /// you are updating the VM size in the VM configuration which implicitly + /// deallocates and reallocates the VM. Minimum api-version: 2022-08-01. Possible values include: 'SCSI', 'NVMe' /// - [JsonProperty(PropertyName = "diskControllerType")] - public string DiskControllerType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskControllerType")] + public string DiskControllerType {get; set; } /// - /// Gets or sets specifies whether the regional disks should be - /// aligned/moved to the VM zone. This is applicable only for VMs with - /// placement property set. Please note that this change is - /// irreversible. Minimum api-version: 2024-11-01. + /// Gets or sets specifies whether the regional disks should be aligned/moved + /// to the VM zone. This is applicable only for VMs with placement property + /// set. Please note that this change is irreversible. Minimum api-version: + /// 2024-11-01. /// - [JsonProperty(PropertyName = "alignRegionalDisksToVMZone")] - public bool? AlignRegionalDisksToVMZone { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "alignRegionalDisksToVMZone")] + public bool? AlignRegionalDisksToVMZone {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (OsDisk != null) + + if (this.OsDisk != null) { - OsDisk.Validate(); + this.OsDisk.Validate(); } - if (DataDisks != null) + if (this.DataDisks != null) { - foreach (var element in DataDisks) + foreach (var element in this.DataDisks) { if (element != null) { @@ -149,6 +146,7 @@ public virtual void Validate() } } } + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SubResource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SubResource.cs index 6db613291fae..48a5704df1f0 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SubResource.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SubResource.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; public partial class SubResource @@ -26,10 +20,13 @@ public SubResource() /// /// Initializes a new instance of the SubResource class. /// - /// Resource Id + + /// Resource Id + /// public SubResource(string id = default(string)) + { - Id = id; + this.Id = id; CustomInit(); } @@ -38,11 +35,11 @@ public SubResource() /// partial void CustomInit(); + /// /// Gets or sets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SubResourceReadOnly.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SubResourceReadOnly.cs index 4bf2726f8ee8..22768b18f193 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SubResourceReadOnly.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SubResourceReadOnly.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; public partial class SubResourceReadOnly @@ -26,10 +20,13 @@ public SubResourceReadOnly() /// /// Initializes a new instance of the SubResourceReadOnly class. /// - /// Resource Id + + /// Resource Id + /// public SubResourceReadOnly(string id = default(string)) + { - Id = id; + this.Id = id; CustomInit(); } @@ -38,11 +35,11 @@ public SubResourceReadOnly() /// partial void CustomInit(); + /// /// Gets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SubResourceWithColocationStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SubResourceWithColocationStatus.cs index a90746619824..e158e8c8e042 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SubResourceWithColocationStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SubResourceWithColocationStatus.cs @@ -1,23 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; public partial class SubResourceWithColocationStatus : SubResource { /// - /// Initializes a new instance of the SubResourceWithColocationStatus - /// class. + /// Initializes a new instance of the SubResourceWithColocationStatus class. /// public SubResourceWithColocationStatus() { @@ -25,16 +18,19 @@ public SubResourceWithColocationStatus() } /// - /// Initializes a new instance of the SubResourceWithColocationStatus - /// class. + /// Initializes a new instance of the SubResourceWithColocationStatus class. /// - /// Resource Id - /// Describes colocation status of a - /// resource in the Proximity Placement Group. + + /// Resource Id + /// + + /// Describes colocation status of a resource in the Proximity Placement Group. + /// public SubResourceWithColocationStatus(string id = default(string), InstanceViewStatus colocationStatus = default(InstanceViewStatus)) - : base(id) + + : base(id) { - ColocationStatus = colocationStatus; + this.ColocationStatus = colocationStatus; CustomInit(); } @@ -43,12 +39,12 @@ public SubResourceWithColocationStatus() /// partial void CustomInit(); + /// - /// Gets or sets describes colocation status of a resource in the - /// Proximity Placement Group. + /// Gets or sets describes colocation status of a resource in the Proximity + /// Placement Group. /// - [JsonProperty(PropertyName = "colocationStatus")] - public InstanceViewStatus ColocationStatus { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "colocationStatus")] + public InstanceViewStatus ColocationStatus {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SupportedCapabilities.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SupportedCapabilities.cs index c1a7f8ee3167..53b866eadf99 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SupportedCapabilities.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SupportedCapabilities.cs @@ -1,21 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// List of supported capabilities persisted on the disk resource for VM - /// use. + /// List of supported capabilities persisted on the disk resource for VM use. /// public partial class SupportedCapabilities { @@ -30,23 +23,29 @@ public SupportedCapabilities() /// /// Initializes a new instance of the SupportedCapabilities class. /// - /// The disk controllers that an OS - /// disk supports. If set it can be SCSI or SCSI, NVME or NVME, - /// SCSI. - /// True if the image from which the - /// OS disk is created supports accelerated networking. - /// CPU architecture supported by an OS - /// disk. Possible values include: 'x64', 'Arm64' - /// Refers to the security - /// capability of the disk supported to create a Trusted launch or - /// Confidential VM. Possible values include: 'TrustedLaunchSupported', - /// 'TrustedLaunchAndConfidentialVMSupported' + + /// The disk controllers that an OS disk supports. If set it can be SCSI or + /// SCSI, NVME or NVME, SCSI. + /// + + /// True if the image from which the OS disk is created supports accelerated + /// networking. + /// + + /// CPU architecture supported by an OS disk. + /// Possible values include: 'x64', 'Arm64' + + /// Refers to the security capability of the disk supported to create a Trusted + /// launch or Confidential VM + /// Possible values include: 'TrustedLaunchSupported', + /// 'TrustedLaunchAndConfidentialVMSupported' public SupportedCapabilities(string diskControllerTypes = default(string), bool? acceleratedNetwork = default(bool?), string architecture = default(string), string supportedSecurityOption = default(string)) + { - DiskControllerTypes = diskControllerTypes; - AcceleratedNetwork = acceleratedNetwork; - Architecture = architecture; - SupportedSecurityOption = supportedSecurityOption; + this.DiskControllerTypes = diskControllerTypes; + this.AcceleratedNetwork = acceleratedNetwork; + this.Architecture = architecture; + this.SupportedSecurityOption = supportedSecurityOption; CustomInit(); } @@ -55,35 +54,32 @@ public SupportedCapabilities() /// partial void CustomInit(); + /// - /// Gets or sets the disk controllers that an OS disk supports. If set - /// it can be SCSI or SCSI, NVME or NVME, SCSI. + /// Gets or sets the disk controllers that an OS disk supports. If set it can + /// be SCSI or SCSI, NVME or NVME, SCSI. /// - [JsonProperty(PropertyName = "diskControllerTypes")] - public string DiskControllerTypes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskControllerTypes")] + public string DiskControllerTypes {get; set; } /// - /// Gets or sets true if the image from which the OS disk is created - /// supports accelerated networking. + /// Gets or sets true if the image from which the OS disk is created supports + /// accelerated networking. /// - [JsonProperty(PropertyName = "acceleratedNetwork")] - public bool? AcceleratedNetwork { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "acceleratedNetwork")] + public bool? AcceleratedNetwork {get; set; } /// - /// Gets or sets CPU architecture supported by an OS disk. Possible - /// values include: 'x64', 'Arm64' + /// Gets or sets cPU architecture supported by an OS disk. Possible values include: 'x64', 'Arm64' /// - [JsonProperty(PropertyName = "architecture")] - public string Architecture { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "architecture")] + public string Architecture {get; set; } /// - /// Gets or sets refers to the security capability of the disk - /// supported to create a Trusted launch or Confidential VM. Possible - /// values include: 'TrustedLaunchSupported', - /// 'TrustedLaunchAndConfidentialVMSupported' + /// Gets or sets refers to the security capability of the disk supported to + /// create a Trusted launch or Confidential VM Possible values include: 'TrustedLaunchSupported', 'TrustedLaunchAndConfidentialVMSupported' /// - [JsonProperty(PropertyName = "supportedSecurityOption")] - public string SupportedSecurityOption { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "supportedSecurityOption")] + public string SupportedSecurityOption {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SupportedSecurityOption.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SupportedSecurityOption.cs index 313a71cb62f8..737b52f5e1db 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SupportedSecurityOption.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SupportedSecurityOption.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for SupportedSecurityOption. /// + + public static class SupportedSecurityOption { /// @@ -21,9 +18,8 @@ public static class SupportedSecurityOption /// public const string TrustedLaunchSupported = "TrustedLaunchSupported"; /// - /// The disk supports creating both Trusted Launch and Confidential - /// VMs. + /// The disk supports creating both Trusted Launch and Confidential VMs. /// public const string TrustedLaunchAndConfidentialVMSupported = "TrustedLaunchAndConfidentialVMSupported"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SystemData.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SystemData.cs index 7f55b8ef0c06..bf0fae6838aa 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SystemData.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SystemData.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,28 +23,33 @@ public SystemData() /// /// Initializes a new instance of the SystemData class. /// - /// The identity that created the - /// resource. - /// The type of identity that created the - /// resource. Possible values include: 'User', 'Application', - /// 'ManagedIdentity', 'Key' - /// The timestamp of resource creation - /// (UTC). - /// The identity that last modified the - /// resource. - /// The type of identity that last - /// modified the resource. Possible values include: 'User', - /// 'Application', 'ManagedIdentity', 'Key' - /// The timestamp of resource last - /// modification (UTC) + + /// The identity that created the resource. + /// + + /// The type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + + /// The timestamp of resource creation (UTC). + /// + + /// The identity that last modified the resource. + /// + + /// The type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + + /// The timestamp of resource last modification (UTC) + /// public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { - CreatedBy = createdBy; - CreatedByType = createdByType; - CreatedAt = createdAt; - LastModifiedBy = lastModifiedBy; - LastModifiedByType = lastModifiedByType; - LastModifiedAt = lastModifiedAt; + this.CreatedBy = createdBy; + this.CreatedByType = createdByType; + this.CreatedAt = createdAt; + this.LastModifiedBy = lastModifiedBy; + this.LastModifiedByType = lastModifiedByType; + this.LastModifiedAt = lastModifiedAt; CustomInit(); } @@ -59,45 +58,41 @@ public SystemData() /// partial void CustomInit(); + /// /// Gets or sets the identity that created the resource. /// - [JsonProperty(PropertyName = "createdBy")] - public string CreatedBy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createdBy")] + public string CreatedBy {get; set; } /// - /// Gets or sets the type of identity that created the resource. - /// Possible values include: 'User', 'Application', 'ManagedIdentity', - /// 'Key' + /// Gets or sets the type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' /// - [JsonProperty(PropertyName = "createdByType")] - public string CreatedByType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createdByType")] + public string CreatedByType {get; set; } /// /// Gets or sets the timestamp of resource creation (UTC). /// - [JsonProperty(PropertyName = "createdAt")] - public System.DateTime? CreatedAt { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt {get; set; } /// /// Gets or sets the identity that last modified the resource. /// - [JsonProperty(PropertyName = "lastModifiedBy")] - public string LastModifiedBy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy {get; set; } /// - /// Gets or sets the type of identity that last modified the resource. - /// Possible values include: 'User', 'Application', 'ManagedIdentity', - /// 'Key' + /// Gets or sets the type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' /// - [JsonProperty(PropertyName = "lastModifiedByType")] - public string LastModifiedByType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType {get; set; } /// /// Gets or sets the timestamp of resource last modification (UTC) /// - [JsonProperty(PropertyName = "lastModifiedAt")] - public System.DateTime? LastModifiedAt { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SystemDataAutoGenerated.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SystemDataAutoGenerated.cs new file mode 100644 index 000000000000..42d7981052d5 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/SystemDataAutoGenerated.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// The system meta data relating to this resource. + /// + public partial class SystemDataAutoGenerated + { + /// + /// Initializes a new instance of the SystemDataAutoGenerated class. + /// + public SystemDataAutoGenerated() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemDataAutoGenerated class. + /// + + /// Specifies the time in UTC at which the Cloud Service (extended support) + /// resource was created. <br />Minimum api-version: 2022-04-04. + /// + + /// Specifies the time in UTC at which the Cloud Service (extended support) + /// resource was last modified. <br />Minimum api-version: 2022-04-04. + /// + public SystemDataAutoGenerated(System.DateTime? createdAt = default(System.DateTime?), System.DateTime? lastModifiedAt = default(System.DateTime?)) + + { + this.CreatedAt = createdAt; + this.LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets specifies the time in UTC at which the Cloud Service (extended + /// support) resource was created. <br />Minimum api-version: 2022-04-04. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt {get; private set; } + + /// + /// Gets specifies the time in UTC at which the Cloud Service (extended + /// support) resource was last modified. <br />Minimum api-version: 2022-04-04. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt {get; private set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/SystemDataModel.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/SystemDataModel.cs deleted file mode 100644 index f052aad4ae8c..000000000000 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/SystemDataModel.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The system meta data relating to this resource. - /// - public partial class SystemDataModel - { - /// - /// Initializes a new instance of the SystemDataModel class. - /// - public SystemDataModel() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SystemDataModel class. - /// - /// Specifies the time in UTC at which the - /// Cloud Service (extended support) resource was created. <br - /// />Minimum api-version: 2022-04-04. - /// Specifies the time in UTC at which the - /// Cloud Service (extended support) resource was last modified. <br - /// />Minimum api-version: 2022-04-04. - public SystemDataModel(System.DateTime? createdAt = default(System.DateTime?), System.DateTime? lastModifiedAt = default(System.DateTime?)) - { - CreatedAt = createdAt; - LastModifiedAt = lastModifiedAt; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets specifies the time in UTC at which the Cloud Service (extended - /// support) resource was created. &lt;br /&gt;Minimum - /// api-version: 2022-04-04. - /// - [JsonProperty(PropertyName = "createdAt")] - public System.DateTime? CreatedAt { get; private set; } - - /// - /// Gets specifies the time in UTC at which the Cloud Service (extended - /// support) resource was last modified. &lt;br /&gt;Minimum - /// api-version: 2022-04-04. - /// - [JsonProperty(PropertyName = "lastModifiedAt")] - public System.DateTime? LastModifiedAt { get; private set; } - - } -} diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/TargetRegion.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/TargetRegion.cs index 60b5b73937d2..3e70073b2bfa 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/TargetRegion.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/TargetRegion.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,29 +23,38 @@ public TargetRegion() /// /// Initializes a new instance of the TargetRegion class. /// - /// The name of the region. - /// The number of replicas of the - /// Image Version to be created per region. This property is - /// updatable. - /// Specifies the storage account type - /// to be used to store the image. This property is not updatable. - /// Possible values include: 'Standard_LRS', 'Standard_ZRS', - /// 'Premium_LRS', 'PremiumV2_LRS' - /// Optional. Allows users to provide customer - /// managed keys for encrypting the OS and data disks in the gallery - /// artifact. - /// Contains the flag setting to hide - /// an image when users specify version='latest' - /// List of storage sku with - /// replica count to create direct drive replicas. - public TargetRegion(string name, int? regionalReplicaCount = default(int?), string storageAccountType = default(string), EncryptionImages encryption = default(EncryptionImages), bool? excludeFromLatest = default(bool?), IList additionalReplicaSets = default(IList)) + + /// The name of the region. + /// + + /// The number of replicas of the Image Version to be created per region. This + /// property is updatable. + /// + + /// Specifies the storage account type to be used to store the image. This + /// property is not updatable. + /// Possible values include: 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS', + /// 'PremiumV2_LRS' + + /// Optional. Allows users to provide customer managed keys for encrypting the + /// OS and data disks in the gallery artifact. + /// + + /// Contains the flag setting to hide an image when users specify + /// version='latest' + /// + + /// List of storage sku with replica count to create direct drive replicas. + /// + public TargetRegion(string name, int? regionalReplicaCount = default(int?), string storageAccountType = default(string), EncryptionImages encryption = default(EncryptionImages), bool? excludeFromLatest = default(bool?), System.Collections.Generic.IList additionalReplicaSets = default(System.Collections.Generic.IList)) + { - Name = name; - RegionalReplicaCount = regionalReplicaCount; - StorageAccountType = storageAccountType; - Encryption = encryption; - ExcludeFromLatest = excludeFromLatest; - AdditionalReplicaSets = additionalReplicaSets; + this.Name = name; + this.RegionalReplicaCount = regionalReplicaCount; + this.StorageAccountType = storageAccountType; + this.Encryption = encryption; + this.ExcludeFromLatest = excludeFromLatest; + this.AdditionalReplicaSets = additionalReplicaSets; CustomInit(); } @@ -63,60 +63,63 @@ public TargetRegion() /// partial void CustomInit(); + /// /// Gets or sets the name of the region. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the number of replicas of the Image Version to be - /// created per region. This property is updatable. + /// Gets or sets the number of replicas of the Image Version to be created per + /// region. This property is updatable. /// - [JsonProperty(PropertyName = "regionalReplicaCount")] - public int? RegionalReplicaCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "regionalReplicaCount")] + public int? RegionalReplicaCount {get; set; } /// - /// Gets or sets specifies the storage account type to be used to store - /// the image. This property is not updatable. Possible values include: - /// 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS', 'PremiumV2_LRS' + /// Gets or sets specifies the storage account type to be used to store the + /// image. This property is not updatable. Possible values include: 'Standard_LRS', 'Standard_ZRS', 'Premium_LRS', 'PremiumV2_LRS' /// - [JsonProperty(PropertyName = "storageAccountType")] - public string StorageAccountType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountType")] + public string StorageAccountType {get; set; } /// - /// Gets or sets optional. Allows users to provide customer managed - /// keys for encrypting the OS and data disks in the gallery artifact. + /// Gets or sets optional. Allows users to provide customer managed keys for + /// encrypting the OS and data disks in the gallery artifact. /// - [JsonProperty(PropertyName = "encryption")] - public EncryptionImages Encryption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "encryption")] + public EncryptionImages Encryption {get; set; } /// - /// Gets or sets contains the flag setting to hide an image when users - /// specify version='latest' + /// Gets or sets contains the flag setting to hide an image when users specify + /// version='latest' /// - [JsonProperty(PropertyName = "excludeFromLatest")] - public bool? ExcludeFromLatest { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "excludeFromLatest")] + public bool? ExcludeFromLatest {get; set; } /// - /// Gets or sets list of storage sku with replica count to create - /// direct drive replicas. + /// Gets or sets list of storage sku with replica count to create direct drive + /// replicas. /// - [JsonProperty(PropertyName = "additionalReplicaSets")] - public IList AdditionalReplicaSets { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalReplicaSets")] + public System.Collections.Generic.IList AdditionalReplicaSets {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/TerminateNotificationProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/TerminateNotificationProfile.cs index 734e97adc35a..efa7930d06cb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/TerminateNotificationProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/TerminateNotificationProfile.cs @@ -1,23 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; public partial class TerminateNotificationProfile { /// - /// Initializes a new instance of the TerminateNotificationProfile - /// class. + /// Initializes a new instance of the TerminateNotificationProfile class. /// public TerminateNotificationProfile() { @@ -25,20 +18,22 @@ public TerminateNotificationProfile() } /// - /// Initializes a new instance of the TerminateNotificationProfile - /// class. + /// Initializes a new instance of the TerminateNotificationProfile class. /// - /// Configurable length of time a - /// Virtual Machine being deleted will have to potentially approve the - /// Terminate Scheduled Event before the event is auto approved (timed - /// out). The configuration must be specified in ISO 8601 format, the - /// default value is 5 minutes (PT5M) - /// Specifies whether the Terminate Scheduled - /// event is enabled or disabled. + + /// Configurable length of time a Virtual Machine being deleted will have to + /// potentially approve the Terminate Scheduled Event before the event is auto + /// approved (timed out). The configuration must be specified in ISO 8601 + /// format, the default value is 5 minutes (PT5M) + /// + + /// Specifies whether the Terminate Scheduled event is enabled or disabled. + /// public TerminateNotificationProfile(string notBeforeTimeout = default(string), bool? enable = default(bool?)) + { - NotBeforeTimeout = notBeforeTimeout; - Enable = enable; + this.NotBeforeTimeout = notBeforeTimeout; + this.Enable = enable; CustomInit(); } @@ -47,22 +42,21 @@ public TerminateNotificationProfile() /// partial void CustomInit(); + /// - /// Gets or sets configurable length of time a Virtual Machine being - /// deleted will have to potentially approve the Terminate Scheduled - /// Event before the event is auto approved (timed out). The - /// configuration must be specified in ISO 8601 format, the default - /// value is 5 minutes (PT5M) + /// Gets or sets configurable length of time a Virtual Machine being deleted + /// will have to potentially approve the Terminate Scheduled Event before the + /// event is auto approved (timed out). The configuration must be specified in + /// ISO 8601 format, the default value is 5 minutes (PT5M) /// - [JsonProperty(PropertyName = "notBeforeTimeout")] - public string NotBeforeTimeout { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "notBeforeTimeout")] + public string NotBeforeTimeout {get; set; } /// - /// Gets or sets specifies whether the Terminate Scheduled event is - /// enabled or disabled. + /// Gets or sets specifies whether the Terminate Scheduled event is enabled or + /// disabled. /// - [JsonProperty(PropertyName = "enable")] - public bool? Enable { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "enable")] + public bool? Enable {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ThrottledRequestsInput.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ThrottledRequestsInput.cs index 969e1d214be4..a3d9c63fca36 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ThrottledRequestsInput.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ThrottledRequestsInput.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -28,22 +23,34 @@ public ThrottledRequestsInput() /// /// Initializes a new instance of the ThrottledRequestsInput class. /// - /// SAS Uri of the logging blob - /// container to which LogAnalytics Api writes output logs to. - /// From time of the query - /// To time of the query - /// Group query result by Throttle - /// Policy applied. - /// Group query result by Operation - /// Name. - /// Group query result by Resource - /// Name. - /// Group query result by - /// Client Application ID. - /// Group query result by User - /// Agent. + + /// SAS Uri of the logging blob container to which LogAnalytics Api writes + /// output logs to. + /// + + /// From time of the query + /// + + /// To time of the query + /// + + /// Group query result by Throttle Policy applied. + /// + + /// Group query result by Operation Name. + /// + + /// Group query result by Resource Name. + /// + + /// Group query result by Client Application ID. + /// + + /// Group query result by User Agent. + /// public ThrottledRequestsInput(string blobContainerSasUri, System.DateTime fromTime, System.DateTime toTime, bool? groupByThrottlePolicy = default(bool?), bool? groupByOperationName = default(bool?), bool? groupByResourceName = default(bool?), bool? groupByClientApplicationId = default(bool?), bool? groupByUserAgent = default(bool?)) - : base(blobContainerSasUri, fromTime, toTime, groupByThrottlePolicy, groupByOperationName, groupByResourceName, groupByClientApplicationId, groupByUserAgent) + + : base(blobContainerSasUri, fromTime, toTime, groupByThrottlePolicy, groupByOperationName, groupByResourceName, groupByClientApplicationId, groupByUserAgent) { CustomInit(); } @@ -56,7 +63,7 @@ public ThrottledRequestsInput() /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() @@ -64,4 +71,4 @@ public override void Validate() base.Validate(); } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/TrackedResource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/TrackedResource.cs new file mode 100644 index 000000000000..47b151d246c3 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/TrackedResource.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// The Resource model definition. + /// + public partial class TrackedResource : Microsoft.Rest.Azure.IResource + { + /// + /// Initializes a new instance of the TrackedResource class. + /// + public TrackedResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TrackedResource class. + /// + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + + { + this.Id = id; + this.Name = name; + this.Type = type; + this.Location = location; + this.Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets resource Id + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } + + /// + /// Gets resource name + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } + + /// + /// Gets resource type + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } + + /// + /// Gets or sets resource location + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets resource tags + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Location == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); + } + + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UefiKey.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UefiKey.cs index 200638332ef0..eda81b51fbba 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UefiKey.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UefiKey.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,13 +23,17 @@ public UefiKey() /// /// Initializes a new instance of the UefiKey class. /// - /// The type of key signature. Possible values - /// include: 'sha256', 'x509' - /// The value of the key signature. - public UefiKey(string type = default(string), IList value = default(IList)) + + /// The type of key signature. + /// Possible values include: 'sha256', 'x509' + + /// The value of the key signature. + /// + public UefiKey(string type = default(string), System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Type = type; - Value = value; + this.Type = type; + this.Value = value; CustomInit(); } @@ -46,18 +42,17 @@ public UefiKey() /// partial void CustomInit(); + /// - /// Gets or sets the type of key signature. Possible values include: - /// 'sha256', 'x509' + /// Gets or sets the type of key signature. Possible values include: 'sha256', 'x509' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets the value of the key signature. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UefiKeySignatures.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UefiKeySignatures.cs index e0a795ee0a9e..c032b7ccfb9e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UefiKeySignatures.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UefiKeySignatures.cs @@ -1,23 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Additional UEFI key signatures that will be added to the image in - /// addition to the signature templates + /// Additional UEFI key signatures that will be added to the image in addition + /// to the signature templates /// public partial class UefiKeySignatures { @@ -32,19 +24,25 @@ public UefiKeySignatures() /// /// Initializes a new instance of the UefiKeySignatures class. /// - /// The Platform Key of this image version. - /// The Key Encryption Keys of this image - /// version. - /// The database of UEFI keys for this image - /// version. - /// The database of revoked UEFI keys for this image - /// version. - public UefiKeySignatures(UefiKey pk = default(UefiKey), IList kek = default(IList), IList db = default(IList), IList dbx = default(IList)) + + /// The Platform Key of this image version. + /// + + /// The Key Encryption Keys of this image version. + /// + + /// The database of UEFI keys for this image version. + /// + + /// The database of revoked UEFI keys for this image version. + /// + public UefiKeySignatures(UefiKey pk = default(UefiKey), System.Collections.Generic.IList kek = default(System.Collections.Generic.IList), System.Collections.Generic.IList db = default(System.Collections.Generic.IList), System.Collections.Generic.IList dbx = default(System.Collections.Generic.IList)) + { - Pk = pk; - Kek = kek; - Db = db; - Dbx = dbx; + this.Pk = pk; + this.Kek = kek; + this.Db = db; + this.Dbx = dbx; CustomInit(); } @@ -53,30 +51,29 @@ public UefiKeySignatures() /// partial void CustomInit(); + /// /// Gets or sets the Platform Key of this image version. /// - [JsonProperty(PropertyName = "pk")] - public UefiKey Pk { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "pk")] + public UefiKey Pk {get; set; } /// /// Gets or sets the Key Encryption Keys of this image version. /// - [JsonProperty(PropertyName = "kek")] - public IList Kek { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "kek")] + public System.Collections.Generic.IList Kek {get; set; } /// /// Gets or sets the database of UEFI keys for this image version. /// - [JsonProperty(PropertyName = "db")] - public IList Db { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "db")] + public System.Collections.Generic.IList Db {get; set; } /// - /// Gets or sets the database of revoked UEFI keys for this image - /// version. + /// Gets or sets the database of revoked UEFI keys for this image version. /// - [JsonProperty(PropertyName = "dbx")] - public IList Dbx { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "dbx")] + public System.Collections.Generic.IList Dbx {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UefiKeyType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UefiKeyType.cs index 684901b220f7..606bd9c06f12 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UefiKeyType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UefiKeyType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for UefiKeyType. /// + + public static class UefiKeyType { public const string Sha256 = "sha256"; public const string X509 = "x509"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UefiSettings.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UefiSettings.cs index bc34cfa01514..9ad371c32575 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UefiSettings.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UefiSettings.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -30,15 +24,19 @@ public UefiSettings() /// /// Initializes a new instance of the UefiSettings class. /// - /// Specifies whether secure boot - /// should be enabled on the virtual machine. Minimum api-version: - /// 2020-12-01. - /// Specifies whether vTPM should be enabled - /// on the virtual machine. Minimum api-version: 2020-12-01. + + /// Specifies whether secure boot should be enabled on the virtual machine. + /// Minimum api-version: 2020-12-01. + /// + + /// Specifies whether vTPM should be enabled on the virtual machine. Minimum + /// api-version: 2020-12-01. + /// public UefiSettings(bool? secureBootEnabled = default(bool?), bool? vTpmEnabled = default(bool?)) + { - SecureBootEnabled = secureBootEnabled; - VTpmEnabled = vTpmEnabled; + this.SecureBootEnabled = secureBootEnabled; + this.VTpmEnabled = vTpmEnabled; CustomInit(); } @@ -47,19 +45,19 @@ public UefiSettings() /// partial void CustomInit(); + /// - /// Gets or sets specifies whether secure boot should be enabled on the - /// virtual machine. Minimum api-version: 2020-12-01. + /// Gets or sets specifies whether secure boot should be enabled on the virtual + /// machine. Minimum api-version: 2020-12-01. /// - [JsonProperty(PropertyName = "secureBootEnabled")] - public bool? SecureBootEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "secureBootEnabled")] + public bool? SecureBootEnabled {get; set; } /// - /// Gets or sets specifies whether vTPM should be enabled on the - /// virtual machine. Minimum api-version: 2020-12-01. + /// Gets or sets specifies whether vTPM should be enabled on the virtual + /// machine. Minimum api-version: 2020-12-01. /// - [JsonProperty(PropertyName = "vTpmEnabled")] - public bool? VTpmEnabled { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "vTpmEnabled")] + public bool? VTpmEnabled {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UefiSignatureTemplateName.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UefiSignatureTemplateName.cs index 8e06e76f9812..62571b581c95 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UefiSignatureTemplateName.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UefiSignatureTemplateName.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for UefiSignatureTemplateName. /// + + public static class UefiSignatureTemplateName { public const string NoSignatureTemplate = "NoSignatureTemplate"; public const string MicrosoftUefiCertificateAuthorityTemplate = "MicrosoftUefiCertificateAuthorityTemplate"; public const string MicrosoftWindowsTemplate = "MicrosoftWindowsTemplate"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UpdateResource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UpdateResource.cs index 36966c4d5b76..5add54c95c13 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UpdateResource.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UpdateResource.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public UpdateResource() /// /// Initializes a new instance of the UpdateResource class. /// - /// Resource tags - public UpdateResource(IDictionary tags = default(IDictionary)) + + /// Resource tags + /// + public UpdateResource(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { - Tags = tags; + this.Tags = tags; CustomInit(); } @@ -43,11 +38,11 @@ public UpdateResource() /// partial void CustomInit(); + /// /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UpdateResourceDefinition.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UpdateResourceDefinition.cs index 5e3c55aa2d7d..c6bf7b9aec15 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UpdateResourceDefinition.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UpdateResourceDefinition.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,16 +23,25 @@ public UpdateResourceDefinition() /// /// Initializes a new instance of the UpdateResourceDefinition class. /// - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - public UpdateResourceDefinition(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource tags + /// + public UpdateResourceDefinition(string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { - Id = id; - Name = name; - Type = type; - Tags = tags; + this.Id = id; + this.Name = name; + this.Type = type; + this.Tags = tags; CustomInit(); } @@ -49,29 +50,29 @@ public UpdateResourceDefinition() /// partial void CustomInit(); + /// /// Gets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeMode.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeMode.cs index b68f7260974e..46c5708b0efe 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeMode.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeMode.cs @@ -1,31 +1,24 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for UpgradeMode. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum UpgradeMode { - [EnumMember(Value = "Automatic")] + [System.Runtime.Serialization.EnumMember(Value = "Automatic")] Automatic, - [EnumMember(Value = "Manual")] + [System.Runtime.Serialization.EnumMember(Value = "Manual")] Manual, - [EnumMember(Value = "Rolling")] + [System.Runtime.Serialization.EnumMember(Value = "Rolling")] Rolling } internal static class UpgradeModeEnumExtension @@ -34,7 +27,6 @@ internal static string ToSerializedValue(this UpgradeMode? value) { return value == null ? null : ((UpgradeMode)value).ToSerializedValue(); } - internal static string ToSerializedValue(this UpgradeMode value) { switch( value ) @@ -48,7 +40,6 @@ internal static string ToSerializedValue(this UpgradeMode value) } return null; } - internal static UpgradeMode? ParseUpgradeMode(this string value) { switch( value ) @@ -63,4 +54,4 @@ internal static string ToSerializedValue(this UpgradeMode value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationHistoricalStatusInfo.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationHistoricalStatusInfo.cs index 4abc3b68b679..fc57fbd8e092 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationHistoricalStatusInfo.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationHistoricalStatusInfo.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class UpgradeOperationHistoricalStatusInfo { /// - /// Initializes a new instance of the - /// UpgradeOperationHistoricalStatusInfo class. + /// Initializes a new instance of the UpgradeOperationHistoricalStatusInfo class. /// public UpgradeOperationHistoricalStatusInfo() { @@ -28,18 +21,23 @@ public UpgradeOperationHistoricalStatusInfo() } /// - /// Initializes a new instance of the - /// UpgradeOperationHistoricalStatusInfo class. + /// Initializes a new instance of the UpgradeOperationHistoricalStatusInfo class. /// - /// Information about the properties of the - /// upgrade operation. - /// Resource type - /// Resource location + + /// Information about the properties of the upgrade operation. + /// + + /// Resource type + /// + + /// Resource location + /// public UpgradeOperationHistoricalStatusInfo(UpgradeOperationHistoricalStatusInfoProperties properties = default(UpgradeOperationHistoricalStatusInfoProperties), string type = default(string), string location = default(string)) + { - Properties = properties; - Type = type; - Location = location; + this.Properties = properties; + this.Type = type; + this.Location = location; CustomInit(); } @@ -48,23 +46,23 @@ public UpgradeOperationHistoricalStatusInfo() /// partial void CustomInit(); + /// /// Gets information about the properties of the upgrade operation. /// - [JsonProperty(PropertyName = "properties")] - public UpgradeOperationHistoricalStatusInfoProperties Properties { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public UpgradeOperationHistoricalStatusInfoProperties Properties {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationHistoricalStatusInfoProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationHistoricalStatusInfoProperties.cs index 9223ff4f85cb..b23b19e41465 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationHistoricalStatusInfoProperties.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationHistoricalStatusInfoProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class UpgradeOperationHistoricalStatusInfoProperties { /// - /// Initializes a new instance of the - /// UpgradeOperationHistoricalStatusInfoProperties class. + /// Initializes a new instance of the UpgradeOperationHistoricalStatusInfoProperties class. /// public UpgradeOperationHistoricalStatusInfoProperties() { @@ -28,27 +21,35 @@ public UpgradeOperationHistoricalStatusInfoProperties() } /// - /// Initializes a new instance of the - /// UpgradeOperationHistoricalStatusInfoProperties class. + /// Initializes a new instance of the UpgradeOperationHistoricalStatusInfoProperties class. /// - /// Information about the overall status of - /// the upgrade operation. - /// Counts of the VMs in each state. - /// Error Details for this upgrade if there are - /// any. - /// Invoker of the Upgrade Operation. Possible - /// values include: 'Unknown', 'User', 'Platform' - /// Image Reference details - /// Information about OS rollback if - /// performed + + /// Information about the overall status of the upgrade operation. + /// + + /// Counts of the VMs in each state. + /// + + /// Error Details for this upgrade if there are any. + /// + + /// Invoker of the Upgrade Operation + /// Possible values include: 'Unknown', 'User', 'Platform' + + /// Image Reference details + /// + + /// Information about OS rollback if performed + /// public UpgradeOperationHistoricalStatusInfoProperties(UpgradeOperationHistoryStatus runningStatus = default(UpgradeOperationHistoryStatus), RollingUpgradeProgressInfo progress = default(RollingUpgradeProgressInfo), ApiError error = default(ApiError), UpgradeOperationInvoker? startedBy = default(UpgradeOperationInvoker?), ImageReference targetImageReference = default(ImageReference), RollbackStatusInfo rollbackInfo = default(RollbackStatusInfo)) + { - RunningStatus = runningStatus; - Progress = progress; - Error = error; - StartedBy = startedBy; - TargetImageReference = targetImageReference; - RollbackInfo = rollbackInfo; + this.RunningStatus = runningStatus; + this.Progress = progress; + this.Error = error; + this.StartedBy = startedBy; + this.TargetImageReference = targetImageReference; + this.RollbackInfo = rollbackInfo; CustomInit(); } @@ -57,42 +58,41 @@ public UpgradeOperationHistoricalStatusInfoProperties() /// partial void CustomInit(); + /// /// Gets information about the overall status of the upgrade operation. /// - [JsonProperty(PropertyName = "runningStatus")] - public UpgradeOperationHistoryStatus RunningStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "runningStatus")] + public UpgradeOperationHistoryStatus RunningStatus {get; private set; } /// /// Gets counts of the VMs in each state. /// - [JsonProperty(PropertyName = "progress")] - public RollingUpgradeProgressInfo Progress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "progress")] + public RollingUpgradeProgressInfo Progress {get; private set; } /// /// Gets error Details for this upgrade if there are any. /// - [JsonProperty(PropertyName = "error")] - public ApiError Error { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ApiError Error {get; private set; } /// - /// Gets invoker of the Upgrade Operation. Possible values include: - /// 'Unknown', 'User', 'Platform' + /// Gets invoker of the Upgrade Operation Possible values include: 'Unknown', 'User', 'Platform' /// - [JsonProperty(PropertyName = "startedBy")] - public UpgradeOperationInvoker? StartedBy { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startedBy")] + public UpgradeOperationInvoker? StartedBy {get; private set; } /// /// Gets image Reference details /// - [JsonProperty(PropertyName = "targetImageReference")] - public ImageReference TargetImageReference { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetImageReference")] + public ImageReference TargetImageReference {get; private set; } /// /// Gets information about OS rollback if performed /// - [JsonProperty(PropertyName = "rollbackInfo")] - public RollbackStatusInfo RollbackInfo { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "rollbackInfo")] + public RollbackStatusInfo RollbackInfo {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationHistoryStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationHistoryStatus.cs index 2cf34e000ae4..3a999e97d1bb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationHistoryStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationHistoryStatus.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class UpgradeOperationHistoryStatus { /// - /// Initializes a new instance of the UpgradeOperationHistoryStatus - /// class. + /// Initializes a new instance of the UpgradeOperationHistoryStatus class. /// public UpgradeOperationHistoryStatus() { @@ -28,19 +21,24 @@ public UpgradeOperationHistoryStatus() } /// - /// Initializes a new instance of the UpgradeOperationHistoryStatus - /// class. + /// Initializes a new instance of the UpgradeOperationHistoryStatus class. /// - /// Code indicating the current status of the - /// upgrade. Possible values include: 'RollingForward', 'Cancelled', - /// 'Completed', 'Faulted' - /// Start time of the upgrade. - /// End time of the upgrade. + + /// Code indicating the current status of the upgrade. + /// Possible values include: 'RollingForward', 'Cancelled', 'Completed', + /// 'Faulted' + + /// Start time of the upgrade. + /// + + /// End time of the upgrade. + /// public UpgradeOperationHistoryStatus(UpgradeState? code = default(UpgradeState?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?)) + { - Code = code; - StartTime = startTime; - EndTime = endTime; + this.Code = code; + this.StartTime = startTime; + this.EndTime = endTime; CustomInit(); } @@ -49,25 +47,23 @@ public UpgradeOperationHistoryStatus() /// partial void CustomInit(); + /// - /// Gets code indicating the current status of the upgrade. Possible - /// values include: 'RollingForward', 'Cancelled', 'Completed', - /// 'Faulted' + /// Gets code indicating the current status of the upgrade. Possible values include: 'RollingForward', 'Cancelled', 'Completed', 'Faulted' /// - [JsonProperty(PropertyName = "code")] - public UpgradeState? Code { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public UpgradeState? Code {get; private set; } /// /// Gets start time of the upgrade. /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime {get; private set; } /// /// Gets end time of the upgrade. /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTime? EndTime { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationInvoker.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationInvoker.cs index 50decd99c59f..7cc00f2f3ede 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationInvoker.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeOperationInvoker.cs @@ -1,31 +1,24 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for UpgradeOperationInvoker. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum UpgradeOperationInvoker { - [EnumMember(Value = "Unknown")] + [System.Runtime.Serialization.EnumMember(Value = "Unknown")] Unknown, - [EnumMember(Value = "User")] + [System.Runtime.Serialization.EnumMember(Value = "User")] User, - [EnumMember(Value = "Platform")] + [System.Runtime.Serialization.EnumMember(Value = "Platform")] Platform } internal static class UpgradeOperationInvokerEnumExtension @@ -34,7 +27,6 @@ internal static string ToSerializedValue(this UpgradeOperationInvoker? value) { return value == null ? null : ((UpgradeOperationInvoker)value).ToSerializedValue(); } - internal static string ToSerializedValue(this UpgradeOperationInvoker value) { switch( value ) @@ -48,7 +40,6 @@ internal static string ToSerializedValue(this UpgradeOperationInvoker value) } return null; } - internal static UpgradeOperationInvoker? ParseUpgradeOperationInvoker(this string value) { switch( value ) @@ -63,4 +54,4 @@ internal static string ToSerializedValue(this UpgradeOperationInvoker value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradePolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradePolicy.cs index 03e3f9eb4939..b4c693d98a98 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradePolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradePolicy.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,23 +23,25 @@ public UpgradePolicy() /// /// Initializes a new instance of the UpgradePolicy class. /// - /// Specifies the mode of an upgrade to virtual - /// machines in the scale set.<br /><br /> Possible values - /// are:<br /><br /> **Manual** - You control the - /// application of updates to virtual machines in the scale set. You do - /// this by using the manualUpgrade action.<br /><br /> - /// **Automatic** - All virtual machines in the scale set are - /// automatically updated at the same time. Possible values include: - /// 'Automatic', 'Manual', 'Rolling' - /// The configuration parameters - /// used while performing a rolling upgrade. - /// Configuration parameters - /// used for performing automatic OS Upgrade. + + /// Specifies the mode of an upgrade to virtual machines in the scale set.<br + /// /><br /> Possible values are:<br /><br /> **Manual** - You control the + /// application of updates to virtual machines in the scale set. You do this by + /// using the manualUpgrade action.<br /><br /> **Automatic** - All virtual + /// machines in the scale set are automatically updated at the same time. + /// Possible values include: 'Automatic', 'Manual', 'Rolling' + + /// The configuration parameters used while performing a rolling upgrade. + /// + + /// Configuration parameters used for performing automatic OS Upgrade. + /// public UpgradePolicy(UpgradeMode? mode = default(UpgradeMode?), RollingUpgradePolicy rollingUpgradePolicy = default(RollingUpgradePolicy), AutomaticOSUpgradePolicy automaticOSUpgradePolicy = default(AutomaticOSUpgradePolicy)) + { - Mode = mode; - RollingUpgradePolicy = rollingUpgradePolicy; - AutomaticOSUpgradePolicy = automaticOSUpgradePolicy; + this.Mode = mode; + this.RollingUpgradePolicy = rollingUpgradePolicy; + this.AutomaticOSUpgradePolicy = automaticOSUpgradePolicy; CustomInit(); } @@ -54,45 +50,45 @@ public UpgradePolicy() /// partial void CustomInit(); + /// - /// Gets or sets specifies the mode of an upgrade to virtual machines - /// in the scale set.&lt;br /&gt;&lt;br /&gt; Possible - /// values are:&lt;br /&gt;&lt;br /&gt; **Manual** - - /// You control the application of updates to virtual machines in the - /// scale set. You do this by using the manualUpgrade action.&lt;br - /// /&gt;&lt;br /&gt; **Automatic** - All virtual machines - /// in the scale set are automatically updated at the same time. - /// Possible values include: 'Automatic', 'Manual', 'Rolling' + /// Gets or sets specifies the mode of an upgrade to virtual machines in the + /// scale set.<br /><br /> Possible values are:<br /><br /> **Manual** - You + /// control the application of updates to virtual machines in the scale set. + /// You do this by using the manualUpgrade action.<br /><br /> **Automatic** - + /// All virtual machines in the scale set are automatically updated at the + /// same time. Possible values include: 'Automatic', 'Manual', 'Rolling' /// - [JsonProperty(PropertyName = "mode")] - public UpgradeMode? Mode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "mode")] + public UpgradeMode? Mode {get; set; } /// - /// Gets or sets the configuration parameters used while performing a - /// rolling upgrade. + /// Gets or sets the configuration parameters used while performing a rolling + /// upgrade. /// - [JsonProperty(PropertyName = "rollingUpgradePolicy")] - public RollingUpgradePolicy RollingUpgradePolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "rollingUpgradePolicy")] + public RollingUpgradePolicy RollingUpgradePolicy {get; set; } /// - /// Gets or sets configuration parameters used for performing automatic - /// OS Upgrade. + /// Gets or sets configuration parameters used for performing automatic OS + /// Upgrade. /// - [JsonProperty(PropertyName = "automaticOSUpgradePolicy")] - public AutomaticOSUpgradePolicy AutomaticOSUpgradePolicy { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "automaticOSUpgradePolicy")] + public AutomaticOSUpgradePolicy AutomaticOSUpgradePolicy {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RollingUpgradePolicy != null) + + if (this.RollingUpgradePolicy != null) { - RollingUpgradePolicy.Validate(); + this.RollingUpgradePolicy.Validate(); } + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeState.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeState.cs index 24d3093b3803..aabcc6a25690 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeState.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UpgradeState.cs @@ -1,33 +1,26 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for UpgradeState. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum UpgradeState { - [EnumMember(Value = "RollingForward")] + [System.Runtime.Serialization.EnumMember(Value = "RollingForward")] RollingForward, - [EnumMember(Value = "Cancelled")] + [System.Runtime.Serialization.EnumMember(Value = "Cancelled")] Cancelled, - [EnumMember(Value = "Completed")] + [System.Runtime.Serialization.EnumMember(Value = "Completed")] Completed, - [EnumMember(Value = "Faulted")] + [System.Runtime.Serialization.EnumMember(Value = "Faulted")] Faulted } internal static class UpgradeStateEnumExtension @@ -36,7 +29,6 @@ internal static string ToSerializedValue(this UpgradeState? value) { return value == null ? null : ((UpgradeState)value).ToSerializedValue(); } - internal static string ToSerializedValue(this UpgradeState value) { switch( value ) @@ -52,7 +44,6 @@ internal static string ToSerializedValue(this UpgradeState value) } return null; } - internal static UpgradeState? ParseUpgradeState(this string value) { switch( value ) @@ -69,4 +60,4 @@ internal static string ToSerializedValue(this UpgradeState value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/Usage.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/Usage.cs index 20ec92fe5c68..767fe79a29a6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/Usage.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/Usage.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,16 +23,21 @@ public Usage() /// /// Initializes a new instance of the Usage class. /// - /// The current usage of the - /// resource. - /// The maximum permitted usage of the - /// resource. - /// The name of the type of usage. + + /// The current usage of the resource. + /// + + /// The maximum permitted usage of the resource. + /// + + /// The name of the type of usage. + /// public Usage(int currentValue, long limit, UsageName name) + { - CurrentValue = currentValue; - Limit = limit; - Name = name; + this.CurrentValue = currentValue; + this.Limit = limit; + this.Name = name; CustomInit(); } /// @@ -55,42 +53,43 @@ static Usage() /// partial void CustomInit(); + /// /// Gets or sets the current usage of the resource. /// - [JsonProperty(PropertyName = "currentValue")] - public int CurrentValue { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "currentValue")] + public int CurrentValue {get; set; } /// /// Gets or sets the maximum permitted usage of the resource. /// - [JsonProperty(PropertyName = "limit")] - public long Limit { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "limit")] + public long Limit {get; set; } /// /// Gets or sets the name of the type of usage. /// - [JsonProperty(PropertyName = "name")] - public UsageName Name { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public UsageName Name {get; set; } /// - /// An enum describing the unit of usage measurement. + /// Gets or sets an enum describing the unit of usage measurement. /// - [JsonProperty(PropertyName = "unit")] - public static string Unit { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "unit")] + public static string Unit {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UsageName.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UsageName.cs index f7cd7d3ae483..67cebe9367db 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UsageName.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UsageName.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public UsageName() /// /// Initializes a new instance of the UsageName class. /// - /// The name of the resource. - /// The localized name of the - /// resource. + + /// The name of the resource. + /// + + /// The localized name of the resource. + /// public UsageName(string value = default(string), string localizedValue = default(string)) + { - Value = value; - LocalizedValue = localizedValue; + this.Value = value; + this.LocalizedValue = localizedValue; CustomInit(); } @@ -44,17 +42,17 @@ public UsageName() /// partial void CustomInit(); + /// /// Gets or sets the name of the resource. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } /// /// Gets or sets the localized name of the resource. /// - [JsonProperty(PropertyName = "localizedValue")] - public string LocalizedValue { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "localizedValue")] + public string LocalizedValue {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UsageUnit.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UsageUnit.cs new file mode 100644 index 000000000000..a78d6860067a --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UsageUnit.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + + /// + /// Defines values for UsageUnit. + /// + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum UsageUnit + { + [System.Runtime.Serialization.EnumMember(Value = "Count")] + Count + } + internal static class UsageUnitEnumExtension + { + internal static string ToSerializedValue(this UsageUnit? value) + { + return value == null ? null : ((UsageUnit)value).ToSerializedValue(); + } + internal static string ToSerializedValue(this UsageUnit value) + { + switch( value ) + { + case UsageUnit.Count: + return "Count"; + } + return null; + } + internal static UsageUnit? ParseUsageUnit(this string value) + { + switch( value ) + { + case "Count": + return UsageUnit.Count; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UserArtifactManage.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UserArtifactManage.cs index c071bf5d91f4..bcafc24f14c1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UserArtifactManage.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UserArtifactManage.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; public partial class UserArtifactManage @@ -27,21 +20,26 @@ public UserArtifactManage() /// /// Initializes a new instance of the UserArtifactManage class. /// - /// Required. The path and arguments to install - /// the gallery application. This is limited to 4096 - /// characters. - /// Required. The path and arguments to remove the - /// gallery application. This is limited to 4096 characters. - /// Optional. The path and arguments to update the - /// gallery application. If not present, then update operation will - /// invoke remove command on the previous version and install command - /// on the current version of the gallery application. This is limited - /// to 4096 characters. + + /// Required. The path and arguments to install the gallery application. This + /// is limited to 4096 characters. + /// + + /// Required. The path and arguments to remove the gallery application. This is + /// limited to 4096 characters. + /// + + /// Optional. The path and arguments to update the gallery application. If not + /// present, then update operation will invoke remove command on the previous + /// version and install command on the current version of the gallery + /// application. This is limited to 4096 characters. + /// public UserArtifactManage(string install, string remove, string update = default(string)) + { - Install = install; - Remove = remove; - Update = update; + this.Install = install; + this.Remove = remove; + this.Update = update; CustomInit(); } @@ -50,46 +48,48 @@ public UserArtifactManage() /// partial void CustomInit(); + /// - /// Gets or sets required. The path and arguments to install the - /// gallery application. This is limited to 4096 characters. + /// Gets or sets required. The path and arguments to install the gallery + /// application. This is limited to 4096 characters. /// - [JsonProperty(PropertyName = "install")] - public string Install { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "install")] + public string Install {get; set; } /// /// Gets or sets required. The path and arguments to remove the gallery /// application. This is limited to 4096 characters. /// - [JsonProperty(PropertyName = "remove")] - public string Remove { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "remove")] + public string Remove {get; set; } /// /// Gets or sets optional. The path and arguments to update the gallery - /// application. If not present, then update operation will invoke - /// remove command on the previous version and install command on the - /// current version of the gallery application. This is limited to 4096 - /// characters. + /// application. If not present, then update operation will invoke remove + /// command on the previous version and install command on the current version + /// of the gallery application. This is limited to 4096 characters. /// - [JsonProperty(PropertyName = "update")] - public string Update { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "update")] + public string Update {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Install == null) + if (this.Install == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Install"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Install"); } - if (Remove == null) + if (this.Remove == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Remove"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Remove"); } + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UserArtifactSettings.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UserArtifactSettings.cs index 799067dd57e7..66bca284478e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UserArtifactSettings.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UserArtifactSettings.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -30,23 +24,26 @@ public UserArtifactSettings() /// /// Initializes a new instance of the UserArtifactSettings class. /// - /// Optional. The name to assign the - /// downloaded package file on the VM. This is limited to 4096 - /// characters. If not specified, the package file will be named the - /// same as the Gallery Application name. - /// Optional. The name to assign the - /// downloaded config file on the VM. This is limited to 4096 - /// characters. If not specified, the config file will be named the - /// Gallery Application name appended with "_config". - /// Optional. The action to be - /// taken with regards to install/update/remove of the gallery - /// application in the event of a reboot. Possible values include: - /// 'None', 'Rerun' + + /// Optional. The name to assign the downloaded package file on the VM. This is + /// limited to 4096 characters. If not specified, the package file will be + /// named the same as the Gallery Application name. + /// + + /// Optional. The name to assign the downloaded config file on the VM. This is + /// limited to 4096 characters. If not specified, the config file will be named + /// the Gallery Application name appended with "_config". + /// + + /// Optional. The action to be taken with regards to install/update/remove of + /// the gallery application in the event of a reboot. + /// Possible values include: 'None', 'Rerun' public UserArtifactSettings(string packageFileName = default(string), string configFileName = default(string), string scriptBehaviorAfterReboot = default(string)) + { - PackageFileName = packageFileName; - ConfigFileName = configFileName; - ScriptBehaviorAfterReboot = scriptBehaviorAfterReboot; + this.PackageFileName = packageFileName; + this.ConfigFileName = configFileName; + this.ScriptBehaviorAfterReboot = scriptBehaviorAfterReboot; CustomInit(); } @@ -55,31 +52,28 @@ public UserArtifactSettings() /// partial void CustomInit(); + /// - /// Gets or sets optional. The name to assign the downloaded package - /// file on the VM. This is limited to 4096 characters. If not - /// specified, the package file will be named the same as the Gallery - /// Application name. + /// Gets or sets optional. The name to assign the downloaded package file on + /// the VM. This is limited to 4096 characters. If not specified, the package + /// file will be named the same as the Gallery Application name. /// - [JsonProperty(PropertyName = "packageFileName")] - public string PackageFileName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "packageFileName")] + public string PackageFileName {get; set; } /// - /// Gets or sets optional. The name to assign the downloaded config - /// file on the VM. This is limited to 4096 characters. If not - /// specified, the config file will be named the Gallery Application - /// name appended with "_config". + /// Gets or sets optional. The name to assign the downloaded config file on the + /// VM. This is limited to 4096 characters. If not specified, the config file + /// will be named the Gallery Application name appended with "_config". /// - [JsonProperty(PropertyName = "configFileName")] - public string ConfigFileName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "configFileName")] + public string ConfigFileName {get; set; } /// /// Gets or sets optional. The action to be taken with regards to - /// install/update/remove of the gallery application in the event of a - /// reboot. Possible values include: 'None', 'Rerun' + /// install/update/remove of the gallery application in the event of a reboot. Possible values include: 'None', 'Rerun' /// - [JsonProperty(PropertyName = "scriptBehaviorAfterReboot")] - public string ScriptBehaviorAfterReboot { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "scriptBehaviorAfterReboot")] + public string ScriptBehaviorAfterReboot {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UserArtifactSource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UserArtifactSource.cs index 3af7ac1a8a5d..ad3d0cdba93a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UserArtifactSource.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UserArtifactSource.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,15 +23,19 @@ public UserArtifactSource() /// /// Initializes a new instance of the UserArtifactSource class. /// - /// Required. The mediaLink of the artifact, - /// must be a readable storage page blob. - /// Optional. The - /// defaultConfigurationLink of the artifact, must be a readable - /// storage page blob. + + /// Required. The mediaLink of the artifact, must be a readable storage page + /// blob. + /// + + /// Optional. The defaultConfigurationLink of the artifact, must be a readable + /// storage page blob. + /// public UserArtifactSource(string mediaLink, string defaultConfigurationLink = default(string)) + { - MediaLink = mediaLink; - DefaultConfigurationLink = defaultConfigurationLink; + this.MediaLink = mediaLink; + this.DefaultConfigurationLink = defaultConfigurationLink; CustomInit(); } @@ -47,32 +44,34 @@ public UserArtifactSource() /// partial void CustomInit(); + /// - /// Gets or sets required. The mediaLink of the artifact, must be a - /// readable storage page blob. + /// Gets or sets required. The mediaLink of the artifact, must be a readable + /// storage page blob. /// - [JsonProperty(PropertyName = "mediaLink")] - public string MediaLink { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "mediaLink")] + public string MediaLink {get; set; } /// - /// Gets or sets optional. The defaultConfigurationLink of the - /// artifact, must be a readable storage page blob. + /// Gets or sets optional. The defaultConfigurationLink of the artifact, must + /// be a readable storage page blob. /// - [JsonProperty(PropertyName = "defaultConfigurationLink")] - public string DefaultConfigurationLink { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultConfigurationLink")] + public string DefaultConfigurationLink {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (MediaLink == null) + if (this.MediaLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "MediaLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "MediaLink"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UserAssignedIdentitiesValue.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UserAssignedIdentitiesValue.cs index 54cb43c1bd6b..4c19b2391719 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UserAssignedIdentitiesValue.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UserAssignedIdentitiesValue.cs @@ -1,23 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; public partial class UserAssignedIdentitiesValue { /// - /// Initializes a new instance of the UserAssignedIdentitiesValue - /// class. + /// Initializes a new instance of the UserAssignedIdentitiesValue class. /// public UserAssignedIdentitiesValue() { @@ -25,17 +18,19 @@ public UserAssignedIdentitiesValue() } /// - /// Initializes a new instance of the UserAssignedIdentitiesValue - /// class. + /// Initializes a new instance of the UserAssignedIdentitiesValue class. /// - /// The principal id of user assigned - /// identity. - /// The client id of user assigned - /// identity. + + /// The principal id of user assigned identity. + /// + + /// The client id of user assigned identity. + /// public UserAssignedIdentitiesValue(string principalId = default(string), string clientId = default(string)) + { - PrincipalId = principalId; - ClientId = clientId; + this.PrincipalId = principalId; + this.ClientId = clientId; CustomInit(); } @@ -44,17 +39,17 @@ public UserAssignedIdentitiesValue() /// partial void CustomInit(); + /// /// Gets the principal id of user assigned identity. /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; private set; } /// /// Gets the client id of user assigned identity. /// - [JsonProperty(PropertyName = "clientId")] - public string ClientId { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "clientId")] + public string ClientId {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UserInitiatedReboot.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UserInitiatedReboot.cs index 8179754f7f7d..fb8178bf2e56 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UserInitiatedReboot.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UserInitiatedReboot.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public UserInitiatedReboot() /// /// Initializes a new instance of the UserInitiatedReboot class. /// - /// Specifies Reboot Scheduled Event - /// related configurations. + + /// Specifies Reboot Scheduled Event related configurations. + /// public UserInitiatedReboot(bool? automaticallyApprove = default(bool?)) + { - AutomaticallyApprove = automaticallyApprove; + this.AutomaticallyApprove = automaticallyApprove; CustomInit(); } @@ -42,12 +38,11 @@ public UserInitiatedReboot() /// partial void CustomInit(); + /// - /// Gets or sets specifies Reboot Scheduled Event related - /// configurations. + /// Gets or sets specifies Reboot Scheduled Event related configurations. /// - [JsonProperty(PropertyName = "automaticallyApprove")] - public bool? AutomaticallyApprove { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "automaticallyApprove")] + public bool? AutomaticallyApprove {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/UserInitiatedRedeploy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/UserInitiatedRedeploy.cs index d065ae67650c..d68d5fd47734 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/UserInitiatedRedeploy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/UserInitiatedRedeploy.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public UserInitiatedRedeploy() /// /// Initializes a new instance of the UserInitiatedRedeploy class. /// - /// Specifies Redeploy Scheduled - /// Event related configurations. + + /// Specifies Redeploy Scheduled Event related configurations. + /// public UserInitiatedRedeploy(bool? automaticallyApprove = default(bool?)) + { - AutomaticallyApprove = automaticallyApprove; + this.AutomaticallyApprove = automaticallyApprove; CustomInit(); } @@ -42,12 +38,11 @@ public UserInitiatedRedeploy() /// partial void CustomInit(); + /// - /// Gets or sets specifies Redeploy Scheduled Event related - /// configurations. + /// Gets or sets specifies Redeploy Scheduled Event related configurations. /// - [JsonProperty(PropertyName = "automaticallyApprove")] - public bool? AutomaticallyApprove { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "automaticallyApprove")] + public bool? AutomaticallyApprove {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VMDiskSecurityProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VMDiskSecurityProfile.cs index 635aa02df981..1893a534602c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VMDiskSecurityProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VMDiskSecurityProfile.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Specifies the security profile settings for the managed disk. **Note:** - /// It can only be set for Confidential VMs. + /// Specifies the security profile settings for the managed disk. **Note:** It + /// can only be set for Confidential VMs. /// public partial class VMDiskSecurityProfile { @@ -30,22 +24,24 @@ public VMDiskSecurityProfile() /// /// Initializes a new instance of the VMDiskSecurityProfile class. /// - /// Specifies the EncryptionType - /// of the managed disk. It is set to DiskWithVMGuestState for - /// encryption of the managed disk along with VMGuestState blob, - /// VMGuestStateOnly for encryption of just the VMGuestState blob, and - /// NonPersistedTPM for not persisting firmware state in the - /// VMGuestState blob.. **Note:** It can be set for only Confidential - /// VMs. Possible values include: 'VMGuestStateOnly', - /// 'DiskWithVMGuestState', 'NonPersistedTPM' - /// Specifies the customer managed disk - /// encryption set resource id for the managed disk that is used for - /// Customer Managed Key encrypted ConfidentialVM OS Disk and VMGuest - /// blob. + + /// Specifies the EncryptionType of the managed disk. It is set to + /// DiskWithVMGuestState for encryption of the managed disk along with + /// VMGuestState blob, VMGuestStateOnly for encryption of just the VMGuestState + /// blob, and NonPersistedTPM for not persisting firmware state in the + /// VMGuestState blob.. **Note:** It can be set for only Confidential VMs. + /// Possible values include: 'VMGuestStateOnly', 'DiskWithVMGuestState', + /// 'NonPersistedTPM' + + /// Specifies the customer managed disk encryption set resource id for the + /// managed disk that is used for Customer Managed Key encrypted ConfidentialVM + /// OS Disk and VMGuest blob. + /// public VMDiskSecurityProfile(string securityEncryptionType = default(string), DiskEncryptionSetParameters diskEncryptionSet = default(DiskEncryptionSetParameters)) + { - SecurityEncryptionType = securityEncryptionType; - DiskEncryptionSet = diskEncryptionSet; + this.SecurityEncryptionType = securityEncryptionType; + this.DiskEncryptionSet = diskEncryptionSet; CustomInit(); } @@ -54,25 +50,23 @@ public VMDiskSecurityProfile() /// partial void CustomInit(); + /// - /// Gets or sets specifies the EncryptionType of the managed disk. It - /// is set to DiskWithVMGuestState for encryption of the managed disk - /// along with VMGuestState blob, VMGuestStateOnly for encryption of - /// just the VMGuestState blob, and NonPersistedTPM for not persisting - /// firmware state in the VMGuestState blob.. **Note:** It can be set - /// for only Confidential VMs. Possible values include: - /// 'VMGuestStateOnly', 'DiskWithVMGuestState', 'NonPersistedTPM' + /// Gets or sets specifies the EncryptionType of the managed disk. It is set to + /// DiskWithVMGuestState for encryption of the managed disk along with + /// VMGuestState blob, VMGuestStateOnly for encryption of just the VMGuestState + /// blob, and NonPersistedTPM for not persisting firmware state in the + /// VMGuestState blob.. **Note:** It can be set for only Confidential VMs. Possible values include: 'VMGuestStateOnly', 'DiskWithVMGuestState', 'NonPersistedTPM' /// - [JsonProperty(PropertyName = "securityEncryptionType")] - public string SecurityEncryptionType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "securityEncryptionType")] + public string SecurityEncryptionType {get; set; } /// - /// Gets or sets specifies the customer managed disk encryption set - /// resource id for the managed disk that is used for Customer Managed - /// Key encrypted ConfidentialVM OS Disk and VMGuest blob. + /// Gets or sets specifies the customer managed disk encryption set resource id + /// for the managed disk that is used for Customer Managed Key encrypted + /// ConfidentialVM OS Disk and VMGuest blob. /// - [JsonProperty(PropertyName = "diskEncryptionSet")] - public DiskEncryptionSetParameters DiskEncryptionSet { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "diskEncryptionSet")] + public DiskEncryptionSetParameters DiskEncryptionSet {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VMGalleryApplication.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VMGalleryApplication.cs index 5fbe6c6dfc01..1aca326a8b01 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VMGalleryApplication.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VMGalleryApplication.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -31,30 +24,37 @@ public VMGalleryApplication() /// /// Initializes a new instance of the VMGalleryApplication class. /// - /// Specifies the - /// GalleryApplicationVersion resource id on the form of - /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} - /// Optional, Specifies a passthrough value for more - /// generic context. - /// Optional, Specifies the order in which the - /// packages have to be installed - /// Optional, Specifies the uri to - /// an azure blob that will replace the default configuration for the - /// package if provided - /// Optional, If true, - /// any failure for any operation in the VmApplication will fail the - /// deployment - /// If set to true, when a new - /// Gallery Application version is available in PIR/SIG, it will be - /// automatically updated for the VM/VMSS + + /// Optional, Specifies a passthrough value for more generic context. + /// + + /// Optional, Specifies the order in which the packages have to be installed + /// + + /// Specifies the GalleryApplicationVersion resource id on the form of + /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} + /// + + /// Optional, Specifies the uri to an azure blob that will replace the default + /// configuration for the package if provided + /// + + /// Optional, If true, any failure for any operation in the VmApplication will + /// fail the deployment + /// + + /// If set to true, when a new Gallery Application version is available in + /// PIR/SIG, it will be automatically updated for the VM/VMSS + /// public VMGalleryApplication(string packageReferenceId, string tags = default(string), int? order = default(int?), string configurationReference = default(string), bool? treatFailureAsDeploymentFailure = default(bool?), bool? enableAutomaticUpgrade = default(bool?)) + { - Tags = tags; - Order = order; - PackageReferenceId = packageReferenceId; - ConfigurationReference = configurationReference; - TreatFailureAsDeploymentFailure = treatFailureAsDeploymentFailure; - EnableAutomaticUpgrade = enableAutomaticUpgrade; + this.Tags = tags; + this.Order = order; + this.PackageReferenceId = packageReferenceId; + this.ConfigurationReference = configurationReference; + this.TreatFailureAsDeploymentFailure = treatFailureAsDeploymentFailure; + this.EnableAutomaticUpgrade = enableAutomaticUpgrade; CustomInit(); } @@ -63,62 +63,64 @@ public VMGalleryApplication() /// partial void CustomInit(); + /// - /// Gets or sets optional, Specifies a passthrough value for more - /// generic context. + /// Gets or sets optional, Specifies a passthrough value for more generic + /// context. /// - [JsonProperty(PropertyName = "tags")] - public string Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public string Tags {get; set; } /// - /// Gets or sets optional, Specifies the order in which the packages - /// have to be installed + /// Gets or sets optional, Specifies the order in which the packages have to be + /// installed /// - [JsonProperty(PropertyName = "order")] - public int? Order { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "order")] + public int? Order {get; set; } /// - /// Gets or sets specifies the GalleryApplicationVersion resource id on - /// the form of + /// Gets or sets specifies the GalleryApplicationVersion resource id on the + /// form of /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} /// - [JsonProperty(PropertyName = "packageReferenceId")] - public string PackageReferenceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "packageReferenceId")] + public string PackageReferenceId {get; set; } /// - /// Gets or sets optional, Specifies the uri to an azure blob that will - /// replace the default configuration for the package if provided + /// Gets or sets optional, Specifies the uri to an azure blob that will replace + /// the default configuration for the package if provided /// - [JsonProperty(PropertyName = "configurationReference")] - public string ConfigurationReference { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "configurationReference")] + public string ConfigurationReference {get; set; } /// - /// Gets or sets optional, If true, any failure for any operation in - /// the VmApplication will fail the deployment + /// Gets or sets optional, If true, any failure for any operation in the + /// VmApplication will fail the deployment /// - [JsonProperty(PropertyName = "treatFailureAsDeploymentFailure")] - public bool? TreatFailureAsDeploymentFailure { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "treatFailureAsDeploymentFailure")] + public bool? TreatFailureAsDeploymentFailure {get; set; } /// - /// Gets or sets if set to true, when a new Gallery Application version - /// is available in PIR/SIG, it will be automatically updated for the - /// VM/VMSS + /// Gets or sets if set to true, when a new Gallery Application version is + /// available in PIR/SIG, it will be automatically updated for the VM/VMSS /// - [JsonProperty(PropertyName = "enableAutomaticUpgrade")] - public bool? EnableAutomaticUpgrade { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "enableAutomaticUpgrade")] + public bool? EnableAutomaticUpgrade {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (PackageReferenceId == null) + if (this.PackageReferenceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "PackageReferenceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "PackageReferenceId"); } + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchClassificationLinux.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchClassificationLinux.cs index 0cc53c8e44fc..7b4895761db2 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchClassificationLinux.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchClassificationLinux.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for VMGuestPatchClassificationLinux. /// + + public static class VMGuestPatchClassificationLinux { public const string Critical = "Critical"; public const string Security = "Security"; public const string Other = "Other"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchClassificationWindows.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchClassificationWindows.cs index e98f65e64153..edb8441a1753 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchClassificationWindows.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchClassificationWindows.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for VMGuestPatchClassificationWindows. /// + + public static class VMGuestPatchClassificationWindows { public const string Critical = "Critical"; @@ -25,4 +22,4 @@ public static class VMGuestPatchClassificationWindows public const string Tools = "Tools"; public const string Updates = "Updates"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchRebootBehavior.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchRebootBehavior.cs index 87a76dded6d9..5ad2508b3d2e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchRebootBehavior.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchRebootBehavior.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for VMGuestPatchRebootBehavior. /// + + public static class VMGuestPatchRebootBehavior { public const string Unknown = "Unknown"; @@ -21,4 +18,4 @@ public static class VMGuestPatchRebootBehavior public const string AlwaysRequiresReboot = "AlwaysRequiresReboot"; public const string CanRequestReboot = "CanRequestReboot"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchRebootSetting.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchRebootSetting.cs index ebfef92400a4..0a8e54709cdb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchRebootSetting.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchRebootSetting.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for VMGuestPatchRebootSetting. /// + + public static class VMGuestPatchRebootSetting { public const string IfRequired = "IfRequired"; public const string Never = "Never"; public const string Always = "Always"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchRebootStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchRebootStatus.cs index f9bf1a04138e..acaff0172d70 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchRebootStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VMGuestPatchRebootStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for VMGuestPatchRebootStatus. /// + + public static class VMGuestPatchRebootStatus { public const string Unknown = "Unknown"; @@ -23,4 +20,4 @@ public static class VMGuestPatchRebootStatus public const string Failed = "Failed"; public const string Completed = "Completed"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VMScaleSetConvertToSinglePlacementGroupInput.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VMScaleSetConvertToSinglePlacementGroupInput.cs index b2955a8cb32d..8c929a4b6fab 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VMScaleSetConvertToSinglePlacementGroupInput.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VMScaleSetConvertToSinglePlacementGroupInput.cs @@ -1,23 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; public partial class VMScaleSetConvertToSinglePlacementGroupInput { /// - /// Initializes a new instance of the - /// VMScaleSetConvertToSinglePlacementGroupInput class. + /// Initializes a new instance of the VMScaleSetConvertToSinglePlacementGroupInput class. /// public VMScaleSetConvertToSinglePlacementGroupInput() { @@ -25,17 +18,18 @@ public VMScaleSetConvertToSinglePlacementGroupInput() } /// - /// Initializes a new instance of the - /// VMScaleSetConvertToSinglePlacementGroupInput class. + /// Initializes a new instance of the VMScaleSetConvertToSinglePlacementGroupInput class. /// - /// Id of the placement group in - /// which you want future virtual machine instances to be placed. To - /// query placement group Id, please use Virtual Machine Scale Set VMs - /// - Get API. If not provided, the platform will choose one with - /// maximum number of virtual machine instances. + + /// Id of the placement group in which you want future virtual machine + /// instances to be placed. To query placement group Id, please use Virtual + /// Machine Scale Set VMs - Get API. If not provided, the platform will choose + /// one with maximum number of virtual machine instances. + /// public VMScaleSetConvertToSinglePlacementGroupInput(string activePlacementGroupId = default(string)) + { - ActivePlacementGroupId = activePlacementGroupId; + this.ActivePlacementGroupId = activePlacementGroupId; CustomInit(); } @@ -44,15 +38,14 @@ public VMScaleSetConvertToSinglePlacementGroupInput() /// partial void CustomInit(); + /// - /// Gets or sets id of the placement group in which you want future - /// virtual machine instances to be placed. To query placement group - /// Id, please use Virtual Machine Scale Set VMs - Get API. If not - /// provided, the platform will choose one with maximum number of - /// virtual machine instances. + /// Gets or sets id of the placement group in which you want future virtual + /// machine instances to be placed. To query placement group Id, please use + /// Virtual Machine Scale Set VMs - Get API. If not provided, the platform will + /// choose one with maximum number of virtual machine instances. /// - [JsonProperty(PropertyName = "activePlacementGroupId")] - public string ActivePlacementGroupId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "activePlacementGroupId")] + public string ActivePlacementGroupId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VMScaleSetScaleOutInput.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VMScaleSetScaleOutInput.cs index 3aa20cf1de93..289bece71f41 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VMScaleSetScaleOutInput.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VMScaleSetScaleOutInput.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public VMScaleSetScaleOutInput() /// /// Initializes a new instance of the VMScaleSetScaleOutInput class. /// - /// Specifies the number of virtual machines in - /// the scale set. - /// The input properties for ScaleOut + + /// Specifies the number of virtual machines in the scale set. + /// + + /// The input properties for ScaleOut + /// public VMScaleSetScaleOutInput(long capacity, VMScaleSetScaleOutInputProperties properties = default(VMScaleSetScaleOutInputProperties)) + { - Capacity = capacity; - Properties = properties; + this.Capacity = capacity; + this.Properties = properties; CustomInit(); } @@ -44,27 +42,27 @@ public VMScaleSetScaleOutInput() /// partial void CustomInit(); + /// - /// Gets or sets specifies the number of virtual machines in the scale - /// set. + /// Gets or sets specifies the number of virtual machines in the scale set. /// - [JsonProperty(PropertyName = "capacity")] - public long Capacity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "capacity")] + public long Capacity {get; set; } /// /// Gets or sets the input properties for ScaleOut /// - [JsonProperty(PropertyName = "properties")] - public VMScaleSetScaleOutInputProperties Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public VMScaleSetScaleOutInputProperties Properties {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VMScaleSetScaleOutInputProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VMScaleSetScaleOutInputProperties.cs index 4d3252f0346f..9b919a9f8982 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VMScaleSetScaleOutInputProperties.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VMScaleSetScaleOutInputProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VMScaleSetScaleOutInputProperties { /// - /// Initializes a new instance of the VMScaleSetScaleOutInputProperties - /// class. + /// Initializes a new instance of the VMScaleSetScaleOutInputProperties class. /// public VMScaleSetScaleOutInputProperties() { @@ -28,14 +21,16 @@ public VMScaleSetScaleOutInputProperties() } /// - /// Initializes a new instance of the VMScaleSetScaleOutInputProperties - /// class. + /// Initializes a new instance of the VMScaleSetScaleOutInputProperties class. /// - /// The zone in which the scale out is requested for - /// the virtual machine scale set. + + /// The zone in which the scale out is requested for the virtual machine scale + /// set. + /// public VMScaleSetScaleOutInputProperties(string zone = default(string)) + { - Zone = zone; + this.Zone = zone; CustomInit(); } @@ -44,12 +39,12 @@ public VMScaleSetScaleOutInputProperties() /// partial void CustomInit(); + /// - /// Gets or sets the zone in which the scale out is requested for the - /// virtual machine scale set. + /// Gets or sets the zone in which the scale out is requested for the virtual + /// machine scale set. /// - [JsonProperty(PropertyName = "zone")] - public string Zone { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "zone")] + public string Zone {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VMSizeProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VMSizeProperties.cs index 5963fed3cae9..bea68db5b22e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VMSizeProperties.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VMSizeProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,24 +23,26 @@ public VMSizeProperties() /// /// Initializes a new instance of the VMSizeProperties class. /// - /// Specifies the number of vCPUs - /// available for the VM. When this property is not specified in the - /// request body the default behavior is to set it to the value of - /// vCPUs available for that VM size exposed in api response of [List + + /// Specifies the number of vCPUs available for the VM. When this property is + /// not specified in the request body the default behavior is to set it to the + /// value of vCPUs available for that VM size exposed in api response of [List /// all available virtual machine sizes in a - /// region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). - /// Specifies the vCPU to physical core - /// ratio. When this property is not specified in the request body the - /// default behavior is set to the value of vCPUsPerCore for the VM - /// Size exposed in api response of [List all available virtual machine - /// sizes in a /// region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). - /// **Setting this property to 1 also means that hyper-threading is - /// disabled.** - public VMSizeProperties(int? vCPUsAvailable = default(int?), int? vCPUsPerCore = default(int?)) + /// + + /// Specifies the vCPU to physical core ratio. When this property is not + /// specified in the request body the default behavior is set to the value of + /// vCPUsPerCore for the VM Size exposed in api response of [List all available + /// virtual machine sizes in a + /// region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + /// **Setting this property to 1 also means that hyper-threading is disabled.** + /// + public VMSizeProperties(int? vcpUsAvailable = default(int?), int? vcpUsPerCore = default(int?)) + { - VCPUsAvailable = vCPUsAvailable; - VCPUsPerCore = vCPUsPerCore; + this.VCPUsAvailable = vcpUsAvailable; + this.VCPUsPerCore = vcpUsPerCore; CustomInit(); } @@ -55,28 +51,26 @@ public VMSizeProperties() /// partial void CustomInit(); + /// - /// Gets or sets specifies the number of vCPUs available for the VM. - /// When this property is not specified in the request body the default - /// behavior is to set it to the value of vCPUs available for that VM - /// size exposed in api response of [List all available virtual machine - /// sizes in a + /// Gets or sets specifies the number of vCPUs available for the VM. When this + /// property is not specified in the request body the default behavior is to + /// set it to the value of vCPUs available for that VM size exposed in api + /// response of [List all available virtual machine sizes in a /// region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). /// - [JsonProperty(PropertyName = "vCPUsAvailable")] - public int? VCPUsAvailable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vCPUsAvailable")] + public int? VCPUsAvailable {get; set; } /// - /// Gets or sets specifies the vCPU to physical core ratio. When this - /// property is not specified in the request body the default behavior - /// is set to the value of vCPUsPerCore for the VM Size exposed in api - /// response of [List all available virtual machine sizes in a + /// Gets or sets specifies the vCPU to physical core ratio. When this property + /// is not specified in the request body the default behavior is set to the + /// value of vCPUsPerCore for the VM Size exposed in api response of [List all + /// available virtual machine sizes in a /// region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). - /// **Setting this property to 1 also means that hyper-threading is - /// disabled.** + /// **Setting this property to 1 also means that hyper-threading is disabled.** /// - [JsonProperty(PropertyName = "vCPUsPerCore")] - public int? VCPUsPerCore { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "vCPUsPerCore")] + public int? VCPUsPerCore {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ValidationStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ValidationStatus.cs index 3bb9dba98dba..db85645aff63 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ValidationStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ValidationStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ValidationStatus. /// + + public static class ValidationStatus { public const string Unknown = "Unknown"; public const string Failed = "Failed"; public const string Succeeded = "Succeeded"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ValidationsProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ValidationsProfile.cs index c62da832eb17..e2f3ab6bcfd6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ValidationsProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ValidationsProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,15 +23,22 @@ public ValidationsProfile() /// /// Initializes a new instance of the ValidationsProfile class. /// - /// The published time of the image - /// version - /// This specifies the pub, offer, sku - /// and version of the image version metadata - public ValidationsProfile(string validationEtag = default(string), IList executedValidations = default(IList), IList platformAttributes = default(IList)) + + /// The published time of the image version + /// + + /// + /// + + /// This specifies the pub, offer, sku and version of the image version + /// metadata + /// + public ValidationsProfile(string validationEtag = default(string), System.Collections.Generic.IList executedValidations = default(System.Collections.Generic.IList), System.Collections.Generic.IList platformAttributes = default(System.Collections.Generic.IList)) + { - ValidationEtag = validationEtag; - ExecutedValidations = executedValidations; - PlatformAttributes = platformAttributes; + this.ValidationEtag = validationEtag; + this.ExecutedValidations = executedValidations; + this.PlatformAttributes = platformAttributes; CustomInit(); } @@ -48,23 +47,24 @@ public ValidationsProfile() /// partial void CustomInit(); + /// /// Gets or sets the published time of the image version /// - [JsonProperty(PropertyName = "validationEtag")] - public string ValidationEtag { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "validationEtag")] + public string ValidationEtag {get; set; } /// + /// Gets or sets /// - [JsonProperty(PropertyName = "executedValidations")] - public IList ExecutedValidations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "executedValidations")] + public System.Collections.Generic.IList ExecutedValidations {get; set; } /// - /// Gets or sets this specifies the pub, offer, sku and version of the - /// image version metadata + /// Gets or sets this specifies the pub, offer, sku and version of the image + /// version metadata /// - [JsonProperty(PropertyName = "platformAttributes")] - public IList PlatformAttributes { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "platformAttributes")] + public System.Collections.Generic.IList PlatformAttributes {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VaultCertificate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VaultCertificate.cs index a2da70a8a3cb..b06b2afc4da6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VaultCertificate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VaultCertificate.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -30,33 +24,35 @@ public VaultCertificate() /// /// Initializes a new instance of the VaultCertificate class. /// - /// This is the URL of a certificate that - /// has been uploaded to Key Vault as a secret. For adding a secret to - /// the Key Vault, see [Add a key or secret to the key + + /// This is the URL of a certificate that has been uploaded to Key Vault as a + /// secret. For adding a secret to the Key Vault, see [Add a key or secret to + /// the key /// vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). - /// In this case, your certificate needs to be It is the Base64 - /// encoding of the following JSON Object which is encoded in UTF-8: - /// <br><br> {<br> - /// "data":"<Base64-encoded-certificate>",<br> - /// "dataType":"pfx",<br> - /// "password":"<pfx-file-password>"<br>} <br> To - /// install certificates on a virtual machine it is recommended to use - /// the [Azure Key Vault virtual machine extension for + /// In this case, your certificate needs to be It is the Base64 encoding of the + /// following JSON Object which is encoded in UTF-8: <br><br> {<br> + /// "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> + /// "password":"<pfx-file-password>"<br>} <br> To install certificates on a + /// virtual machine it is recommended to use the [Azure Key Vault virtual + /// machine extension for /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) /// or the [Azure Key Vault virtual machine extension for - /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). - /// For Windows VMs, specifies the - /// certificate store on the Virtual Machine to which the certificate - /// should be added. The specified certificate store is implicitly in - /// the LocalMachine account. For Linux VMs, the certificate file is - /// placed under the /var/lib/waagent directory, with the file name - /// &lt;UppercaseThumbprint&gt;.crt for the X509 certificate - /// file and &lt;UppercaseThumbprint&gt;.prv for private key. - /// Both of these files are .pem formatted. + /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + /// + + /// For Windows VMs, specifies the certificate store on the Virtual Machine to + /// which the certificate should be added. The specified certificate store is + /// implicitly in the LocalMachine account. For Linux VMs, the certificate file + /// is placed under the /var/lib/waagent directory, with the file name + /// &lt;UppercaseThumbprint&gt;.crt for the X509 certificate file and + /// &lt;UppercaseThumbprint&gt;.prv for private key. Both of these files are + /// .pem formatted. + /// public VaultCertificate(string certificateUrl = default(string), string certificateStore = default(string)) + { - CertificateUrl = certificateUrl; - CertificateStore = certificateStore; + this.CertificateUrl = certificateUrl; + this.CertificateStore = certificateStore; CustomInit(); } @@ -65,40 +61,35 @@ public VaultCertificate() /// partial void CustomInit(); + /// - /// Gets or sets this is the URL of a certificate that has been - /// uploaded to Key Vault as a secret. For adding a secret to the Key - /// Vault, see [Add a key or secret to the key + /// Gets or sets this is the URL of a certificate that has been uploaded to Key + /// Vault as a secret. For adding a secret to the Key Vault, see [Add a key or + /// secret to the key /// vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). - /// In this case, your certificate needs to be It is the Base64 - /// encoding of the following JSON Object which is encoded in UTF-8: - /// &lt;br&gt;&lt;br&gt; {&lt;br&gt; - /// "data":"&lt;Base64-encoded-certificate&gt;",&lt;br&gt; - /// "dataType":"pfx",&lt;br&gt; - /// "password":"&lt;pfx-file-password&gt;"&lt;br&gt;} - /// &lt;br&gt; To install certificates on a virtual machine it - /// is recommended to use the [Azure Key Vault virtual machine - /// extension for + /// In this case, your certificate needs to be It is the Base64 encoding of the + /// following JSON Object which is encoded in UTF-8: <br><br> {<br> + /// "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> + /// "password":"<pfx-file-password>"<br>} <br> To install certificates on a + /// virtual machine it is recommended to use the [Azure Key Vault virtual + /// machine extension for /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) /// or the [Azure Key Vault virtual machine extension for /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). /// - [JsonProperty(PropertyName = "certificateUrl")] - public string CertificateUrl { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "certificateUrl")] + public string CertificateUrl {get; set; } /// - /// Gets or sets for Windows VMs, specifies the certificate store on - /// the Virtual Machine to which the certificate should be added. The - /// specified certificate store is implicitly in the LocalMachine - /// account. For Linux VMs, the certificate file is placed under the - /// /var/lib/waagent directory, with the file name - /// &amp;lt;UppercaseThumbprint&amp;gt;.crt for the X509 - /// certificate file and - /// &amp;lt;UppercaseThumbprint&amp;gt;.prv for private key. - /// Both of these files are .pem formatted. + /// Gets or sets for Windows VMs, specifies the certificate store on the + /// Virtual Machine to which the certificate should be added. The specified + /// certificate store is implicitly in the LocalMachine account. For Linux VMs, + /// the certificate file is placed under the /var/lib/waagent directory, with + /// the file name &lt;UppercaseThumbprint&gt;.crt for the X509 certificate file + /// and &lt;UppercaseThumbprint&gt;.prv for private key. Both of these files + /// are .pem formatted. /// - [JsonProperty(PropertyName = "certificateStore")] - public string CertificateStore { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "certificateStore")] + public string CertificateStore {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VaultSecretGroup.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VaultSecretGroup.cs index 059934972a21..555323a3724a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VaultSecretGroup.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VaultSecretGroup.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,14 +23,18 @@ public VaultSecretGroup() /// /// Initializes a new instance of the VaultSecretGroup class. /// - /// The relative URL of the Key Vault - /// containing all of the certificates in VaultCertificates. - /// The list of key vault references in - /// SourceVault which contain certificates. - public VaultSecretGroup(SubResource sourceVault = default(SubResource), IList vaultCertificates = default(IList)) + + /// The relative URL of the Key Vault containing all of the certificates in + /// VaultCertificates. + /// + + /// The list of key vault references in SourceVault which contain certificates. + /// + public VaultSecretGroup(SubResource sourceVault = default(SubResource), System.Collections.Generic.IList vaultCertificates = default(System.Collections.Generic.IList)) + { - SourceVault = sourceVault; - VaultCertificates = vaultCertificates; + this.SourceVault = sourceVault; + this.VaultCertificates = vaultCertificates; CustomInit(); } @@ -47,19 +43,19 @@ public VaultSecretGroup() /// partial void CustomInit(); + /// - /// Gets or sets the relative URL of the Key Vault containing all of - /// the certificates in VaultCertificates. + /// Gets or sets the relative URL of the Key Vault containing all of the + /// certificates in VaultCertificates. /// - [JsonProperty(PropertyName = "sourceVault")] - public SubResource SourceVault { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceVault")] + public SubResource SourceVault {get; set; } /// - /// Gets or sets the list of key vault references in SourceVault which - /// contain certificates. + /// Gets or sets the list of key vault references in SourceVault which contain + /// certificates. /// - [JsonProperty(PropertyName = "vaultCertificates")] - public IList VaultCertificates { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "vaultCertificates")] + public System.Collections.Generic.IList VaultCertificates {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualHardDisk.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualHardDisk.cs index 5434e0ff26be..fde820786d99 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualHardDisk.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualHardDisk.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public VirtualHardDisk() /// /// Initializes a new instance of the VirtualHardDisk class. /// - /// Specifies the virtual hard disk's uri. + + /// Specifies the virtual hard disk's uri. + /// public VirtualHardDisk(string uri = default(string)) + { - Uri = uri; + this.Uri = uri; CustomInit(); } @@ -41,11 +38,11 @@ public VirtualHardDisk() /// partial void CustomInit(); + /// - /// Gets or sets specifies the virtual hard disk's uri. + /// Gets or sets specifies the virtual hard disk's uri. /// - [JsonProperty(PropertyName = "uri")] - public string Uri { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "uri")] + public string Uri {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachine.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachine.cs index b81cd31d8ea6..f08cf211b49a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachine.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachine.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Describes a Virtual Machine. /// - [Rest.Serialization.JsonTransformation] - public partial class VirtualMachine : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class VirtualMachine : TrackedResource { /// /// Initializes a new instance of the VirtualMachine class. @@ -34,188 +24,233 @@ public VirtualMachine() /// /// Initializes a new instance of the VirtualMachine class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// Specifies the hardware settings for - /// the virtual machine. - /// Specifies Redeploy, Reboot and - /// ScheduledEventsAdditionalPublishingTargets Scheduled Event related - /// configurations for the virtual machine. - /// Specifies the storage settings for the - /// virtual machine disks. - /// Specifies additional - /// capabilities enabled or disabled on the virtual machine. - /// Specifies the operating system settings - /// used while creating the virtual machine. Some of the settings - /// cannot be changed once VM is provisioned. - /// Specifies the network interfaces of - /// the virtual machine. - /// Specifies the Security related - /// profile settings for the virtual machine. - /// Specifies the boot diagnostic - /// settings state. Minimum api-version: 2015-06-15. - /// Specifies information about the - /// availability set that the virtual machine should be assigned to. - /// Virtual machines specified in the same availability set are - /// allocated to different nodes to maximize availability. For more + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// Specifies information about the marketplace image used to create the + /// virtual machine. This element is only used for marketplace images. Before + /// you can use a marketplace image from an API, you must enable the image for + /// programmatic use. In the Azure portal, find the marketplace image that you + /// want to use and then click **Want to deploy programmatically, Get Started + /// ->**. Enter any required information and then click **Save**. + /// + + /// The virtual machine child extension resources. + /// + + /// The identity of the virtual machine, if configured. + /// + + /// The availability zones. + /// + + /// The extended location of the Virtual Machine. + /// + + /// ManagedBy is set to Virtual Machine Scale Set(VMSS) flex ARM resourceID, if + /// the VM is part of the VMSS. This property is used by platform for internal + /// resource group delete optimization. + /// + + /// Etag is property returned in Create/Update/Get response of the VM, so that + /// customer can supply it in the header to ensure optimistic updates. + /// + + /// Placement section specifies the user-defined constraints for virtual + /// machine hardware placement. This property cannot be changed once VM is + /// provisioned. Minimum api-version: 2024-11-01. + /// + + /// Specifies the hardware settings for the virtual machine. + /// + + /// Specifies the storage settings for the virtual machine disks. + /// + + /// Specifies additional capabilities enabled or disabled on the virtual + /// machine. + /// + + /// Specifies the operating system settings used while creating the virtual + /// machine. Some of the settings cannot be changed once VM is provisioned. + /// + + /// Specifies the network interfaces of the virtual machine. + /// + + /// Specifies the Security related profile settings for the virtual machine. + /// + + /// Specifies the boot diagnostic settings state. Minimum api-version: + /// 2015-06-15. + /// + + /// Specifies the billing related details of a Azure Spot virtual machine. + /// Minimum api-version: 2019-03-01. + /// + + /// Specifies the gallery applications that should be made available to the + /// VM/VMSS. + /// + + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets + /// Scheduled Event related configurations for the virtual machine. + /// + + /// Specifies information about the availability set that the virtual machine + /// should be assigned to. Virtual machines specified in the same availability + /// set are allocated to different nodes to maximize availability. For more /// information about availability sets, see [Availability sets /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). - /// For more information on Azure planned maintenance, see [Maintenance - /// and updates for Virtual Machines in + /// For more information on Azure planned maintenance, see [Maintenance and + /// updates for Virtual Machines in /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). - /// Currently, a VM can only be added to availability set at creation - /// time. The availability set to which the VM is being added should be - /// under the same resource group as the availability set resource. An - /// existing VM cannot be added to an availability set. This property - /// cannot exist along with a non-null - /// properties.virtualMachineScaleSet reference. - /// Specifies information about - /// the virtual machine scale set that the virtual machine should be - /// assigned to. Virtual machines specified in the same virtual machine - /// scale set are allocated to different nodes to maximize - /// availability. Currently, a VM can only be added to virtual machine - /// scale set at creation time. An existing VM cannot be added to a - /// virtual machine scale set. This property cannot exist along with a - /// non-null properties.availabilitySet reference. Minimum api‐version: - /// 2019‐03‐01. - /// Specifies information about - /// the proximity placement group that the virtual machine should be - /// assigned to. Minimum api-version: 2018-04-01. - /// Specifies the priority for the virtual - /// machine. Minimum api-version: 2019-03-01. Possible values include: - /// 'Regular', 'Low', 'Spot' - /// Specifies the eviction policy for the - /// Azure Spot virtual machine and Azure Spot scale set. For Azure Spot - /// virtual machines, both 'Deallocate' and 'Delete' are supported and - /// the minimum api-version is 2019-03-01. For Azure Spot scale sets, - /// both 'Deallocate' and 'Delete' are supported and the minimum - /// api-version is 2017-10-30-preview. Possible values include: - /// 'Deallocate', 'Delete' - /// Specifies the billing related details - /// of a Azure Spot virtual machine. Minimum api-version: - /// 2019-03-01. - /// Specifies information about the dedicated host - /// that the virtual machine resides in. Minimum api-version: - /// 2018-10-01. - /// Specifies information about the dedicated - /// host group that the virtual machine resides in. **Note:** User - /// cannot specify both host and hostGroup properties. Minimum - /// api-version: 2020-06-01. - /// The provisioning state, which only - /// appears in the response. - /// The virtual machine instance - /// view. - /// Specifies that the image or disk that is - /// being used was licensed on-premises. <br><br> Possible - /// values for Windows Server operating system are: - /// <br><br> Windows_Client <br><br> - /// Windows_Server <br><br> Possible values for Linux - /// Server operating system are: <br><br> RHEL_BYOS (for - /// RHEL) <br><br> SLES_BYOS (for SUSE) - /// <br><br> For more information, see [Azure Hybrid Use - /// Benefit for Windows + /// Currently, a VM can only be added to availability set at creation time. The + /// availability set to which the VM is being added should be under the same + /// resource group as the availability set resource. An existing VM cannot be + /// added to an availability set. This property cannot exist along with a + /// non-null properties.virtualMachineScaleSet reference. + /// + + /// Specifies information about the virtual machine scale set that the virtual + /// machine should be assigned to. Virtual machines specified in the same + /// virtual machine scale set are allocated to different nodes to maximize + /// availability. Currently, a VM can only be added to virtual machine scale + /// set at creation time. An existing VM cannot be added to a virtual machine + /// scale set. This property cannot exist along with a non-null + /// properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. + /// + + /// Specifies information about the proximity placement group that the virtual + /// machine should be assigned to. Minimum api-version: 2018-04-01. + /// + + /// Specifies the priority for the virtual machine. Minimum api-version: + /// 2019-03-01 + /// Possible values include: 'Regular', 'Low', 'Spot' + + /// Specifies the eviction policy for the Azure Spot virtual machine and Azure + /// Spot scale set. For Azure Spot virtual machines, both 'Deallocate' and + /// 'Delete' are supported and the minimum api-version is 2019-03-01. For Azure + /// Spot scale sets, both 'Deallocate' and 'Delete' are supported and the + /// minimum api-version is 2017-10-30-preview. + /// Possible values include: 'Deallocate', 'Delete' + + /// Specifies information about the dedicated host that the virtual machine + /// resides in. Minimum api-version: 2018-10-01. + /// + + /// Specifies information about the dedicated host group that the virtual + /// machine resides in. **Note:** User cannot specify both host and hostGroup + /// properties. Minimum api-version: 2020-06-01. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// The virtual machine instance view. + /// + + /// Specifies that the image or disk that is being used was licensed + /// on-premises. <br><br> Possible values for Windows Server operating system + /// are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible + /// values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) + /// <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure + /// Hybrid Use Benefit for Windows /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) /// <br><br> [Azure Hybrid Use Benefit for Linux /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) - /// <br><br> Minimum api-version: 2015-06-15 - /// Specifies the VM unique ID which is a 128-bits - /// identifier that is encoded and stored in all Azure IaaS VMs SMBIOS - /// and can be read using platform BIOS commands. - /// Specifies the time alloted for - /// all extensions to start. The time duration should be between 15 - /// minutes and 120 minutes (inclusive) and should be specified in ISO - /// 8601 format. The default value is 90 minutes (PT1H30M). Minimum - /// api-version: 2020-06-01. - /// Specifies the scale set logical - /// fault domain into which the Virtual Machine will be created. By - /// default, the Virtual Machine will by automatically assigned to a - /// fault domain that best maintains balance across available fault - /// domains. This is applicable only if the 'virtualMachineScaleSet' - /// property of this Virtual Machine is set. The Virtual Machine Scale - /// Set that is referenced, must have 'platformFaultDomainCount' - /// greater than 1. This property cannot be updated once the Virtual - /// Machine is created. Fault domain assignment can be viewed in the - /// Virtual Machine Instance View. Minimum api‐version: - /// 2020‐12‐01. - /// Specifies Scheduled Event - /// related configurations. - /// UserData for the VM, which must be base-64 - /// encoded. Customer should not pass any secrets in here. Minimum - /// api-version: 2021-03-01. - /// Specifies information about the - /// capacity reservation that is used to allocate virtual machine. - /// Minimum api-version: 2021-04-01. - /// Specifies the gallery applications - /// that should be made available to the VM/VMSS. - /// Specifies the time at which the Virtual - /// Machine resource was created. Minimum api-version: - /// 2021-11-01. - /// Specifies information about the marketplace - /// image used to create the virtual machine. This element is only used - /// for marketplace images. Before you can use a marketplace image from - /// an API, you must enable the image for programmatic use. In the - /// Azure portal, find the marketplace image that you want to use and - /// then click **Want to deploy programmatically, Get Started ->**. - /// Enter any required information and then click **Save**. - /// The virtual machine child extension - /// resources. - /// The identity of the virtual machine, if - /// configured. - /// The availability zones. - /// The extended location of the Virtual - /// Machine. - /// ManagedBy is set to Virtual Machine Scale - /// Set(VMSS) flex ARM resourceID, if the VM is part of the VMSS. This - /// property is used by platform for internal resource group delete - /// optimization. - /// Etag is property returned in Create/Update/Get - /// response of the VM, so that customer can supply it in the header to - /// ensure optimistic updates. - /// Placement section specifies the - /// user-defined constraints for virtual machine hardware placement. - /// This property cannot be changed once VM is provisioned. Minimum - /// api-version: 2024-11-01. - public VirtualMachine(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), HardwareProfile hardwareProfile = default(HardwareProfile), ScheduledEventsPolicy scheduledEventsPolicy = default(ScheduledEventsPolicy), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), ScheduledEventsProfile scheduledEventsProfile = default(ScheduledEventsProfile), string userData = default(string), CapacityReservationProfile capacityReservation = default(CapacityReservationProfile), ApplicationProfile applicationProfile = default(ApplicationProfile), System.DateTime? timeCreated = default(System.DateTime?), Plan plan = default(Plan), IList resources = default(IList), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList), ExtendedLocation extendedLocation = default(ExtendedLocation), string managedBy = default(string), string etag = default(string), Placement placement = default(Placement)) - : base(location, id, name, type, tags) + /// <br><br> Minimum api-version: 2015-06-15 + /// + + /// Specifies the VM unique ID which is a 128-bits identifier that is encoded + /// and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS + /// commands. + /// + + /// Specifies the time alloted for all extensions to start. The time duration + /// should be between 15 minutes and 120 minutes (inclusive) and should be + /// specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). + /// Minimum api-version: 2020-06-01. + /// + + /// Specifies the scale set logical fault domain into which the Virtual Machine + /// will be created. By default, the Virtual Machine will by automatically + /// assigned to a fault domain that best maintains balance across available + /// fault domains. This is applicable only if the 'virtualMachineScaleSet' + /// property of this Virtual Machine is set. The Virtual Machine Scale Set that + /// is referenced, must have 'platformFaultDomainCount' greater than 1. This + /// property cannot be updated once the Virtual Machine is created. Fault + /// domain assignment can be viewed in the Virtual Machine Instance View. + /// Minimum api‐version: 2020‐12‐01. + /// + + /// Specifies Scheduled Event related configurations. + /// + + /// UserData for the VM, which must be base-64 encoded. Customer should not + /// pass any secrets in here. Minimum api-version: 2021-03-01. + /// + + /// Specifies information about the capacity reservation that is used to + /// allocate virtual machine. Minimum api-version: 2021-04-01. + /// + + /// Specifies the time at which the Virtual Machine resource was created. + /// Minimum api-version: 2021-11-01. + /// + public VirtualMachine(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), Plan plan = default(Plan), System.Collections.Generic.IList resources = default(System.Collections.Generic.IList), VirtualMachineIdentity identity = default(VirtualMachineIdentity), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), ExtendedLocation extendedLocation = default(ExtendedLocation), string managedBy = default(string), string etag = default(string), Placement placement = default(Placement), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), BillingProfile billingProfile = default(BillingProfile), ApplicationProfile applicationProfile = default(ApplicationProfile), ScheduledEventsPolicy scheduledEventsPolicy = default(ScheduledEventsPolicy), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), ScheduledEventsProfile scheduledEventsProfile = default(ScheduledEventsProfile), string userData = default(string), CapacityReservationProfile capacityReservation = default(CapacityReservationProfile), System.DateTime? timeCreated = default(System.DateTime?)) + + : base(location, id, name, type, tags) { - HardwareProfile = hardwareProfile; - ScheduledEventsPolicy = scheduledEventsPolicy; - StorageProfile = storageProfile; - AdditionalCapabilities = additionalCapabilities; - OsProfile = osProfile; - NetworkProfile = networkProfile; - SecurityProfile = securityProfile; - DiagnosticsProfile = diagnosticsProfile; - AvailabilitySet = availabilitySet; - VirtualMachineScaleSet = virtualMachineScaleSet; - ProximityPlacementGroup = proximityPlacementGroup; - Priority = priority; - EvictionPolicy = evictionPolicy; - BillingProfile = billingProfile; - Host = host; - HostGroup = hostGroup; - ProvisioningState = provisioningState; - InstanceView = instanceView; - LicenseType = licenseType; - VmId = vmId; - ExtensionsTimeBudget = extensionsTimeBudget; - PlatformFaultDomain = platformFaultDomain; - ScheduledEventsProfile = scheduledEventsProfile; - UserData = userData; - CapacityReservation = capacityReservation; - ApplicationProfile = applicationProfile; - TimeCreated = timeCreated; - Plan = plan; - Resources = resources; - Identity = identity; - Zones = zones; - ExtendedLocation = extendedLocation; - ManagedBy = managedBy; - Etag = etag; - Placement = placement; + this.Plan = plan; + this.Resources = resources; + this.Identity = identity; + this.Zones = zones; + this.ExtendedLocation = extendedLocation; + this.ManagedBy = managedBy; + this.Etag = etag; + this.Placement = placement; + this.HardwareProfile = hardwareProfile; + this.StorageProfile = storageProfile; + this.AdditionalCapabilities = additionalCapabilities; + this.OsProfile = osProfile; + this.NetworkProfile = networkProfile; + this.SecurityProfile = securityProfile; + this.DiagnosticsProfile = diagnosticsProfile; + this.BillingProfile = billingProfile; + this.ApplicationProfile = applicationProfile; + this.ScheduledEventsPolicy = scheduledEventsPolicy; + this.AvailabilitySet = availabilitySet; + this.VirtualMachineScaleSet = virtualMachineScaleSet; + this.ProximityPlacementGroup = proximityPlacementGroup; + this.Priority = priority; + this.EvictionPolicy = evictionPolicy; + this.Host = host; + this.HostGroup = hostGroup; + this.ProvisioningState = provisioningState; + this.InstanceView = instanceView; + this.LicenseType = licenseType; + this.VmId = vmId; + this.ExtensionsTimeBudget = extensionsTimeBudget; + this.PlatformFaultDomain = platformFaultDomain; + this.ScheduledEventsProfile = scheduledEventsProfile; + this.UserData = userData; + this.CapacityReservation = capacityReservation; + this.TimeCreated = timeCreated; CustomInit(); } @@ -224,328 +259,302 @@ public VirtualMachine() /// partial void CustomInit(); + /// - /// Gets or sets specifies the hardware settings for the virtual - /// machine. + /// Gets or sets specifies information about the marketplace image used to + /// create the virtual machine. This element is only used for marketplace + /// images. Before you can use a marketplace image from an API, you must enable + /// the image for programmatic use. In the Azure portal, find the marketplace + /// image that you want to use and then click **Want to deploy + /// programmatically, Get Started ->**. Enter any required information and then + /// click **Save**. /// - [JsonProperty(PropertyName = "properties.hardwareProfile")] - public HardwareProfile HardwareProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "plan")] + public Plan Plan {get; set; } /// - /// Gets or sets specifies Redeploy, Reboot and - /// ScheduledEventsAdditionalPublishingTargets Scheduled Event related - /// configurations for the virtual machine. + /// Gets the virtual machine child extension resources. /// - [JsonProperty(PropertyName = "properties.scheduledEventsPolicy")] - public ScheduledEventsPolicy ScheduledEventsPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resources")] + public System.Collections.Generic.IList Resources {get; private set; } /// - /// Gets or sets specifies the storage settings for the virtual machine - /// disks. + /// Gets or sets the identity of the virtual machine, if configured. /// - [JsonProperty(PropertyName = "properties.storageProfile")] - public StorageProfile StorageProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public VirtualMachineIdentity Identity {get; set; } /// - /// Gets or sets specifies additional capabilities enabled or disabled - /// on the virtual machine. + /// Gets or sets the availability zones. /// - [JsonProperty(PropertyName = "properties.additionalCapabilities")] - public AdditionalCapabilities AdditionalCapabilities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } /// - /// Gets or sets specifies the operating system settings used while - /// creating the virtual machine. Some of the settings cannot be - /// changed once VM is provisioned. + /// Gets or sets the extended location of the Virtual Machine. /// - [JsonProperty(PropertyName = "properties.osProfile")] - public OSProfile OsProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation {get; set; } /// - /// Gets or sets specifies the network interfaces of the virtual - /// machine. + /// Gets managedBy is set to Virtual Machine Scale Set(VMSS) flex ARM + /// resourceID, if the VM is part of the VMSS. This property is used by + /// platform for internal resource group delete optimization. /// - [JsonProperty(PropertyName = "properties.networkProfile")] - public NetworkProfile NetworkProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managedBy")] + public string ManagedBy {get; private set; } /// - /// Gets or sets specifies the Security related profile settings for - /// the virtual machine. + /// Gets etag is property returned in Create/Update/Get response of the VM, so + /// that customer can supply it in the header to ensure optimistic updates. /// - [JsonProperty(PropertyName = "properties.securityProfile")] - public SecurityProfile SecurityProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets specifies the boot diagnostic settings state. Minimum - /// api-version: 2015-06-15. + /// Gets or sets placement section specifies the user-defined constraints for + /// virtual machine hardware placement. This property cannot be changed once VM + /// is provisioned. Minimum api-version: 2024-11-01. /// - [JsonProperty(PropertyName = "properties.diagnosticsProfile")] - public DiagnosticsProfile DiagnosticsProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "placement")] + public Placement Placement {get; set; } /// - /// Gets or sets specifies information about the availability set that - /// the virtual machine should be assigned to. Virtual machines - /// specified in the same availability set are allocated to different - /// nodes to maximize availability. For more information about - /// availability sets, see [Availability sets - /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). - /// For more information on Azure planned maintenance, see [Maintenance - /// and updates for Virtual Machines in - /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). - /// Currently, a VM can only be added to availability set at creation - /// time. The availability set to which the VM is being added should be - /// under the same resource group as the availability set resource. An - /// existing VM cannot be added to an availability set. This property - /// cannot exist along with a non-null - /// properties.virtualMachineScaleSet reference. + /// Gets or sets specifies the hardware settings for the virtual machine. /// - [JsonProperty(PropertyName = "properties.availabilitySet")] - public SubResource AvailabilitySet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hardwareProfile")] + public HardwareProfile HardwareProfile {get; set; } /// - /// Gets or sets specifies information about the virtual machine scale - /// set that the virtual machine should be assigned to. Virtual - /// machines specified in the same virtual machine scale set are - /// allocated to different nodes to maximize availability. Currently, a - /// VM can only be added to virtual machine scale set at creation time. - /// An existing VM cannot be added to a virtual machine scale set. This - /// property cannot exist along with a non-null - /// properties.availabilitySet reference. Minimum api‐version: - /// 2019‐03‐01. + /// Gets or sets specifies the storage settings for the virtual machine disks. /// - [JsonProperty(PropertyName = "properties.virtualMachineScaleSet")] - public SubResource VirtualMachineScaleSet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageProfile")] + public StorageProfile StorageProfile {get; set; } /// - /// Gets or sets specifies information about the proximity placement - /// group that the virtual machine should be assigned to. Minimum - /// api-version: 2018-04-01. + /// Gets or sets specifies additional capabilities enabled or disabled on the + /// virtual machine. /// - [JsonProperty(PropertyName = "properties.proximityPlacementGroup")] - public SubResource ProximityPlacementGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.additionalCapabilities")] + public AdditionalCapabilities AdditionalCapabilities {get; set; } /// - /// Gets or sets specifies the priority for the virtual machine. - /// Minimum api-version: 2019-03-01. Possible values include: - /// 'Regular', 'Low', 'Spot' + /// Gets or sets specifies the operating system settings used while creating + /// the virtual machine. Some of the settings cannot be changed once VM is + /// provisioned. /// - [JsonProperty(PropertyName = "properties.priority")] - public string Priority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osProfile")] + public OSProfile OsProfile {get; set; } /// - /// Gets or sets specifies the eviction policy for the Azure Spot - /// virtual machine and Azure Spot scale set. For Azure Spot virtual - /// machines, both 'Deallocate' and 'Delete' are supported and the - /// minimum api-version is 2019-03-01. For Azure Spot scale sets, both - /// 'Deallocate' and 'Delete' are supported and the minimum api-version - /// is 2017-10-30-preview. Possible values include: 'Deallocate', - /// 'Delete' + /// Gets or sets specifies the network interfaces of the virtual machine. /// - [JsonProperty(PropertyName = "properties.evictionPolicy")] - public string EvictionPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkProfile")] + public NetworkProfile NetworkProfile {get; set; } /// - /// Gets or sets specifies the billing related details of a Azure Spot - /// virtual machine. Minimum api-version: 2019-03-01. + /// Gets or sets specifies the Security related profile settings for the + /// virtual machine. /// - [JsonProperty(PropertyName = "properties.billingProfile")] - public BillingProfile BillingProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityProfile")] + public SecurityProfile SecurityProfile {get; set; } /// - /// Gets or sets specifies information about the dedicated host that - /// the virtual machine resides in. Minimum api-version: 2018-10-01. + /// Gets or sets specifies the boot diagnostic settings state. Minimum + /// api-version: 2015-06-15. /// - [JsonProperty(PropertyName = "properties.host")] - public SubResource Host { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diagnosticsProfile")] + public DiagnosticsProfile DiagnosticsProfile {get; set; } /// - /// Gets or sets specifies information about the dedicated host group - /// that the virtual machine resides in. **Note:** User cannot specify - /// both host and hostGroup properties. Minimum api-version: - /// 2020-06-01. + /// Gets or sets specifies the billing related details of a Azure Spot virtual + /// machine. Minimum api-version: 2019-03-01. /// - [JsonProperty(PropertyName = "properties.hostGroup")] - public SubResource HostGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.billingProfile")] + public BillingProfile BillingProfile {get; set; } /// - /// Gets the provisioning state, which only appears in the response. + /// Gets or sets specifies the gallery applications that should be made + /// available to the VM/VMSS. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicationProfile")] + public ApplicationProfile ApplicationProfile {get; set; } /// - /// Gets the virtual machine instance view. + /// Gets or sets specifies Redeploy, Reboot and + /// ScheduledEventsAdditionalPublishingTargets Scheduled Event related + /// configurations for the virtual machine. /// - [JsonProperty(PropertyName = "properties.instanceView")] - public VirtualMachineInstanceView InstanceView { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scheduledEventsPolicy")] + public ScheduledEventsPolicy ScheduledEventsPolicy {get; set; } /// - /// Gets or sets specifies that the image or disk that is being used - /// was licensed on-premises. &lt;br&gt;&lt;br&gt; - /// Possible values for Windows Server operating system are: - /// &lt;br&gt;&lt;br&gt; Windows_Client - /// &lt;br&gt;&lt;br&gt; Windows_Server - /// &lt;br&gt;&lt;br&gt; Possible values for Linux - /// Server operating system are: &lt;br&gt;&lt;br&gt; - /// RHEL_BYOS (for RHEL) &lt;br&gt;&lt;br&gt; SLES_BYOS - /// (for SUSE) &lt;br&gt;&lt;br&gt; For more - /// information, see [Azure Hybrid Use Benefit for Windows - /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - /// &lt;br&gt;&lt;br&gt; [Azure Hybrid Use Benefit for - /// Linux - /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) - /// &lt;br&gt;&lt;br&gt; Minimum api-version: - /// 2015-06-15 + /// Gets or sets specifies information about the availability set that the + /// virtual machine should be assigned to. Virtual machines specified in the + /// same availability set are allocated to different nodes to maximize + /// availability. For more information about availability sets, see + /// [Availability sets + /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + /// For more information on Azure planned maintenance, see [Maintenance and + /// updates for Virtual Machines in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). + /// Currently, a VM can only be added to availability set at creation time. The + /// availability set to which the VM is being added should be under the same + /// resource group as the availability set resource. An existing VM cannot be + /// added to an availability set. This property cannot exist along with a + /// non-null properties.virtualMachineScaleSet reference. /// - [JsonProperty(PropertyName = "properties.licenseType")] - public string LicenseType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.availabilitySet")] + public SubResource AvailabilitySet {get; set; } /// - /// Gets specifies the VM unique ID which is a 128-bits identifier that - /// is encoded and stored in all Azure IaaS VMs SMBIOS and can be read - /// using platform BIOS commands. + /// Gets or sets specifies information about the virtual machine scale set that + /// the virtual machine should be assigned to. Virtual machines specified in + /// the same virtual machine scale set are allocated to different nodes to + /// maximize availability. Currently, a VM can only be added to virtual machine + /// scale set at creation time. An existing VM cannot be added to a virtual + /// machine scale set. This property cannot exist along with a non-null + /// properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. /// - [JsonProperty(PropertyName = "properties.vmId")] - public string VmId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachineScaleSet")] + public SubResource VirtualMachineScaleSet {get; set; } /// - /// Gets or sets specifies the time alloted for all extensions to - /// start. The time duration should be between 15 minutes and 120 - /// minutes (inclusive) and should be specified in ISO 8601 format. The - /// default value is 90 minutes (PT1H30M). Minimum api-version: - /// 2020-06-01. + /// Gets or sets specifies information about the proximity placement group that + /// the virtual machine should be assigned to. Minimum api-version: 2018-04-01. /// - [JsonProperty(PropertyName = "properties.extensionsTimeBudget")] - public string ExtensionsTimeBudget { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.proximityPlacementGroup")] + public SubResource ProximityPlacementGroup {get; set; } /// - /// Gets or sets specifies the scale set logical fault domain into - /// which the Virtual Machine will be created. By default, the Virtual - /// Machine will by automatically assigned to a fault domain that best - /// maintains balance across available fault domains. This is - /// applicable only if the 'virtualMachineScaleSet' property of this - /// Virtual Machine is set. The Virtual Machine Scale Set that is - /// referenced, must have 'platformFaultDomainCount' greater than 1. - /// This property cannot be updated once the Virtual Machine is - /// created. Fault domain assignment can be viewed in the Virtual - /// Machine Instance View. Minimum api‐version: 2020‐12‐01. + /// Gets or sets specifies the priority for the virtual machine. Minimum + /// api-version: 2019-03-01 Possible values include: 'Regular', 'Low', 'Spot' /// - [JsonProperty(PropertyName = "properties.platformFaultDomain")] - public int? PlatformFaultDomain { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + public string Priority {get; set; } /// - /// Gets or sets specifies Scheduled Event related configurations. + /// Gets or sets specifies the eviction policy for the Azure Spot virtual + /// machine and Azure Spot scale set. For Azure Spot virtual machines, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version is + /// 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are + /// supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' /// - [JsonProperty(PropertyName = "properties.scheduledEventsProfile")] - public ScheduledEventsProfile ScheduledEventsProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.evictionPolicy")] + public string EvictionPolicy {get; set; } /// - /// Gets or sets userData for the VM, which must be base-64 encoded. - /// Customer should not pass any secrets in here. Minimum api-version: - /// 2021-03-01. + /// Gets or sets specifies information about the dedicated host that the + /// virtual machine resides in. Minimum api-version: 2018-10-01. /// - [JsonProperty(PropertyName = "properties.userData")] - public string UserData { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.host")] + public SubResource Host {get; set; } /// - /// Gets or sets specifies information about the capacity reservation - /// that is used to allocate virtual machine. Minimum api-version: - /// 2021-04-01. + /// Gets or sets specifies information about the dedicated host group that the + /// virtual machine resides in. **Note:** User cannot specify both host and + /// hostGroup properties. Minimum api-version: 2020-06-01. /// - [JsonProperty(PropertyName = "properties.capacityReservation")] - public CapacityReservationProfile CapacityReservation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hostGroup")] + public SubResource HostGroup {get; set; } /// - /// Gets or sets specifies the gallery applications that should be made - /// available to the VM/VMSS. + /// Gets the provisioning state, which only appears in the response. /// - [JsonProperty(PropertyName = "properties.applicationProfile")] - public ApplicationProfile ApplicationProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets specifies the time at which the Virtual Machine resource was - /// created. Minimum api-version: 2021-11-01. + /// Gets the virtual machine instance view. /// - [JsonProperty(PropertyName = "properties.timeCreated")] - public System.DateTime? TimeCreated { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.instanceView")] + public VirtualMachineInstanceView InstanceView {get; private set; } /// - /// Gets or sets specifies information about the marketplace image used - /// to create the virtual machine. This element is only used for - /// marketplace images. Before you can use a marketplace image from an - /// API, you must enable the image for programmatic use. In the Azure - /// portal, find the marketplace image that you want to use and then - /// click **Want to deploy programmatically, Get Started -&gt;**. - /// Enter any required information and then click **Save**. + /// Gets or sets specifies that the image or disk that is being used was + /// licensed on-premises. <br><br> Possible values for Windows Server operating + /// system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> + /// Possible values for Linux Server operating system are: <br><br> RHEL_BYOS + /// (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see + /// [Azure Hybrid Use Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 /// - [JsonProperty(PropertyName = "plan")] - public Plan Plan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.licenseType")] + public string LicenseType {get; set; } /// - /// Gets the virtual machine child extension resources. + /// Gets specifies the VM unique ID which is a 128-bits identifier that is + /// encoded and stored in all Azure IaaS VMs SMBIOS and can be read using + /// platform BIOS commands. /// - [JsonProperty(PropertyName = "resources")] - public IList Resources { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vmId")] + public string VmId {get; private set; } /// - /// Gets or sets the identity of the virtual machine, if configured. + /// Gets or sets specifies the time alloted for all extensions to start. The + /// time duration should be between 15 minutes and 120 minutes (inclusive) and + /// should be specified in ISO 8601 format. The default value is 90 minutes + /// (PT1H30M). Minimum api-version: 2020-06-01. /// - [JsonProperty(PropertyName = "identity")] - public VirtualMachineIdentity Identity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.extensionsTimeBudget")] + public string ExtensionsTimeBudget {get; set; } /// - /// Gets or sets the availability zones. + /// Gets or sets specifies the scale set logical fault domain into which the + /// Virtual Machine will be created. By default, the Virtual Machine will by + /// automatically assigned to a fault domain that best maintains balance across + /// available fault domains. This is applicable only if the + /// 'virtualMachineScaleSet' property of this Virtual Machine is set. The + /// Virtual Machine Scale Set that is referenced, must have + /// 'platformFaultDomainCount' greater than 1. This property cannot be updated + /// once the Virtual Machine is created. Fault domain assignment can be viewed + /// in the Virtual Machine Instance View. Minimum api‐version: 2020‐12‐01. /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.platformFaultDomain")] + public int? PlatformFaultDomain {get; set; } /// - /// Gets or sets the extended location of the Virtual Machine. + /// Gets or sets specifies Scheduled Event related configurations. /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scheduledEventsProfile")] + public ScheduledEventsProfile ScheduledEventsProfile {get; set; } /// - /// Gets managedBy is set to Virtual Machine Scale Set(VMSS) flex ARM - /// resourceID, if the VM is part of the VMSS. This property is used by - /// platform for internal resource group delete optimization. + /// Gets or sets userData for the VM, which must be base-64 encoded. Customer + /// should not pass any secrets in here. Minimum api-version: 2021-03-01. /// - [JsonProperty(PropertyName = "managedBy")] - public string ManagedBy { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.userData")] + public string UserData {get; set; } /// - /// Gets etag is property returned in Create/Update/Get response of the - /// VM, so that customer can supply it in the header to ensure - /// optimistic updates. + /// Gets or sets specifies information about the capacity reservation that is + /// used to allocate virtual machine. Minimum api-version: 2021-04-01. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.capacityReservation")] + public CapacityReservationProfile CapacityReservation {get; set; } /// - /// Gets or sets placement section specifies the user-defined - /// constraints for virtual machine hardware placement. This property - /// cannot be changed once VM is provisioned. Minimum api-version: - /// 2024-11-01. + /// Gets specifies the time at which the Virtual Machine resource was created. + /// Minimum api-version: 2021-11-01. /// - [JsonProperty(PropertyName = "placement")] - public Placement Placement { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeCreated")] + public System.DateTime? TimeCreated {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (StorageProfile != null) - { - StorageProfile.Validate(); - } - if (Resources != null) + + if (this.Resources != null) { - foreach (var element in Resources) + foreach (var element in this.Resources) { if (element != null) { @@ -553,6 +562,40 @@ public override void Validate() } } } + + + + + + + + if (this.StorageProfile != null) + { + this.StorageProfile.Validate(); + } + + + + + + + + + + + + + + + + + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineAgentInstanceView.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineAgentInstanceView.cs index 2399739f2cfd..089f28420693 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineAgentInstanceView.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineAgentInstanceView.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineAgentInstanceView { /// - /// Initializes a new instance of the VirtualMachineAgentInstanceView - /// class. + /// Initializes a new instance of the VirtualMachineAgentInstanceView class. /// public VirtualMachineAgentInstanceView() { @@ -30,18 +21,23 @@ public VirtualMachineAgentInstanceView() } /// - /// Initializes a new instance of the VirtualMachineAgentInstanceView - /// class. + /// Initializes a new instance of the VirtualMachineAgentInstanceView class. /// - /// The VM Agent full version. - /// The virtual machine extension - /// handler instance view. - /// The resource status information. - public VirtualMachineAgentInstanceView(string vmAgentVersion = default(string), IList extensionHandlers = default(IList), IList statuses = default(IList)) + + /// The VM Agent full version. + /// + + /// The virtual machine extension handler instance view. + /// + + /// The resource status information. + /// + public VirtualMachineAgentInstanceView(string vmAgentVersion = default(string), System.Collections.Generic.IList extensionHandlers = default(System.Collections.Generic.IList), System.Collections.Generic.IList statuses = default(System.Collections.Generic.IList)) + { - VmAgentVersion = vmAgentVersion; - ExtensionHandlers = extensionHandlers; - Statuses = statuses; + this.VmAgentVersion = vmAgentVersion; + this.ExtensionHandlers = extensionHandlers; + this.Statuses = statuses; CustomInit(); } @@ -50,23 +46,23 @@ public VirtualMachineAgentInstanceView() /// partial void CustomInit(); + /// /// Gets or sets the VM Agent full version. /// - [JsonProperty(PropertyName = "vmAgentVersion")] - public string VmAgentVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vmAgentVersion")] + public string VmAgentVersion {get; set; } /// /// Gets or sets the virtual machine extension handler instance view. /// - [JsonProperty(PropertyName = "extensionHandlers")] - public IList ExtensionHandlers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extensionHandlers")] + public System.Collections.Generic.IList ExtensionHandlers {get; set; } /// /// Gets or sets the resource status information. /// - [JsonProperty(PropertyName = "statuses")] - public IList Statuses { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "statuses")] + public System.Collections.Generic.IList Statuses {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineAssessPatchesResult.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineAssessPatchesResult.cs index 9bb2a7c3e50c..18e1ee45445d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineAssessPatchesResult.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineAssessPatchesResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineAssessPatchesResult { /// - /// Initializes a new instance of the VirtualMachineAssessPatchesResult - /// class. + /// Initializes a new instance of the VirtualMachineAssessPatchesResult class. /// public VirtualMachineAssessPatchesResult() { @@ -30,43 +21,51 @@ public VirtualMachineAssessPatchesResult() } /// - /// Initializes a new instance of the VirtualMachineAssessPatchesResult - /// class. + /// Initializes a new instance of the VirtualMachineAssessPatchesResult class. /// - /// The overall success or failure status of the - /// operation. It remains "InProgress" until the operation completes. - /// At that point it will become "Unknown", "Failed", "Succeeded", or - /// "CompletedWithWarnings.". Possible values include: 'Unknown', - /// 'InProgress', 'Failed', 'Succeeded', - /// 'CompletedWithWarnings' - /// The activity ID of the operation - /// that produced this result. It is used to correlate across CRP and - /// extension logs. - /// The overall reboot status of the VM. It - /// will be true when partially installed patches require a reboot to - /// complete installation but the reboot has not yet occurred. - /// The number of critical - /// or security patches that have been detected as available and not - /// yet installed. - /// The number of all available patches - /// excluding critical and security. - /// The UTC timestamp when the operation - /// began. - /// The list of patches that have been - /// detected as available for installation. - /// The errors that were encountered during - /// execution of the operation. The details array contains the list of - /// them. - public VirtualMachineAssessPatchesResult(string status = default(string), string assessmentActivityId = default(string), bool? rebootPending = default(bool?), int? criticalAndSecurityPatchCount = default(int?), int? otherPatchCount = default(int?), System.DateTime? startDateTime = default(System.DateTime?), IList availablePatches = default(IList), ApiError error = default(ApiError)) + + /// The overall success or failure status of the operation. It remains + /// "InProgress" until the operation completes. At that point it will become + /// "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." + /// Possible values include: 'Unknown', 'InProgress', 'Failed', 'Succeeded', + /// 'CompletedWithWarnings' + + /// The activity ID of the operation that produced this result. It is used to + /// correlate across CRP and extension logs. + /// + + /// The overall reboot status of the VM. It will be true when partially + /// installed patches require a reboot to complete installation but the reboot + /// has not yet occurred. + /// + + /// The number of critical or security patches that have been detected as + /// available and not yet installed. + /// + + /// The number of all available patches excluding critical and security. + /// + + /// The UTC timestamp when the operation began. + /// + + /// The list of patches that have been detected as available for installation. + /// + + /// The errors that were encountered during execution of the operation. The + /// details array contains the list of them. + /// + public VirtualMachineAssessPatchesResult(string status = default(string), string assessmentActivityId = default(string), bool? rebootPending = default(bool?), int? criticalAndSecurityPatchCount = default(int?), int? otherPatchCount = default(int?), System.DateTime? startDateTime = default(System.DateTime?), System.Collections.Generic.IList availablePatches = default(System.Collections.Generic.IList), ApiError error = default(ApiError)) + { - Status = status; - AssessmentActivityId = assessmentActivityId; - RebootPending = rebootPending; - CriticalAndSecurityPatchCount = criticalAndSecurityPatchCount; - OtherPatchCount = otherPatchCount; - StartDateTime = startDateTime; - AvailablePatches = availablePatches; - Error = error; + this.Status = status; + this.AssessmentActivityId = assessmentActivityId; + this.RebootPending = rebootPending; + this.CriticalAndSecurityPatchCount = criticalAndSecurityPatchCount; + this.OtherPatchCount = otherPatchCount; + this.StartDateTime = startDateTime; + this.AvailablePatches = availablePatches; + this.Error = error; CustomInit(); } @@ -75,64 +74,61 @@ public VirtualMachineAssessPatchesResult() /// partial void CustomInit(); + /// - /// Gets the overall success or failure status of the operation. It - /// remains "InProgress" until the operation completes. At that point - /// it will become "Unknown", "Failed", "Succeeded", or - /// "CompletedWithWarnings.". Possible values include: 'Unknown', - /// 'InProgress', 'Failed', 'Succeeded', 'CompletedWithWarnings' + /// Gets the overall success or failure status of the operation. It remains + /// "InProgress" until the operation completes. At that point it will become + /// "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." Possible values include: 'Unknown', 'InProgress', 'Failed', 'Succeeded', 'CompletedWithWarnings' /// - [JsonProperty(PropertyName = "status")] - public string Status { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; private set; } /// - /// Gets the activity ID of the operation that produced this result. It - /// is used to correlate across CRP and extension logs. + /// Gets the activity ID of the operation that produced this result. It is used + /// to correlate across CRP and extension logs. /// - [JsonProperty(PropertyName = "assessmentActivityId")] - public string AssessmentActivityId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "assessmentActivityId")] + public string AssessmentActivityId {get; private set; } /// - /// Gets the overall reboot status of the VM. It will be true when - /// partially installed patches require a reboot to complete - /// installation but the reboot has not yet occurred. + /// Gets the overall reboot status of the VM. It will be true when partially + /// installed patches require a reboot to complete installation but the reboot + /// has not yet occurred. /// - [JsonProperty(PropertyName = "rebootPending")] - public bool? RebootPending { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "rebootPending")] + public bool? RebootPending {get; private set; } /// - /// Gets the number of critical or security patches that have been - /// detected as available and not yet installed. + /// Gets the number of critical or security patches that have been detected as + /// available and not yet installed. /// - [JsonProperty(PropertyName = "criticalAndSecurityPatchCount")] - public int? CriticalAndSecurityPatchCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "criticalAndSecurityPatchCount")] + public int? CriticalAndSecurityPatchCount {get; private set; } /// - /// Gets the number of all available patches excluding critical and - /// security. + /// Gets the number of all available patches excluding critical and security. /// - [JsonProperty(PropertyName = "otherPatchCount")] - public int? OtherPatchCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "otherPatchCount")] + public int? OtherPatchCount {get; private set; } /// /// Gets the UTC timestamp when the operation began. /// - [JsonProperty(PropertyName = "startDateTime")] - public System.DateTime? StartDateTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startDateTime")] + public System.DateTime? StartDateTime {get; private set; } /// /// Gets the list of patches that have been detected as available for /// installation. /// - [JsonProperty(PropertyName = "availablePatches")] - public IList AvailablePatches { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "availablePatches")] + public System.Collections.Generic.IList AvailablePatches {get; private set; } /// - /// Gets the errors that were encountered during execution of the - /// operation. The details array contains the list of them. + /// Gets the errors that were encountered during execution of the operation. + /// The details array contains the list of them. /// - [JsonProperty(PropertyName = "error")] - public ApiError Error { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ApiError Error {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineCaptureParameters.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineCaptureParameters.cs index 4abdc0fbe1dd..10c0352a3831 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineCaptureParameters.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineCaptureParameters.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineCaptureParameters { /// - /// Initializes a new instance of the VirtualMachineCaptureParameters - /// class. + /// Initializes a new instance of the VirtualMachineCaptureParameters class. /// public VirtualMachineCaptureParameters() { @@ -29,20 +21,24 @@ public VirtualMachineCaptureParameters() } /// - /// Initializes a new instance of the VirtualMachineCaptureParameters - /// class. + /// Initializes a new instance of the VirtualMachineCaptureParameters class. /// - /// The captured virtual hard disk's name - /// prefix. - /// The destination container - /// name. - /// Specifies whether to overwrite the - /// destination virtual hard disk, in case of conflict. + + /// The captured virtual hard disk's name prefix. + /// + + /// The destination container name. + /// + + /// Specifies whether to overwrite the destination virtual hard disk, in case + /// of conflict. + /// public VirtualMachineCaptureParameters(string vhdPrefix, string destinationContainerName, bool overwriteVhds) + { - VhdPrefix = vhdPrefix; - DestinationContainerName = destinationContainerName; - OverwriteVhds = overwriteVhds; + this.VhdPrefix = vhdPrefix; + this.DestinationContainerName = destinationContainerName; + this.OverwriteVhds = overwriteVhds; CustomInit(); } @@ -51,41 +47,43 @@ public VirtualMachineCaptureParameters(string vhdPrefix, string destinationConta /// partial void CustomInit(); + /// - /// Gets or sets the captured virtual hard disk's name prefix. + /// Gets or sets the captured virtual hard disk's name prefix. /// - [JsonProperty(PropertyName = "vhdPrefix")] - public string VhdPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vhdPrefix")] + public string VhdPrefix {get; set; } /// /// Gets or sets the destination container name. /// - [JsonProperty(PropertyName = "destinationContainerName")] - public string DestinationContainerName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationContainerName")] + public string DestinationContainerName {get; set; } /// - /// Gets or sets specifies whether to overwrite the destination virtual - /// hard disk, in case of conflict. + /// Gets or sets specifies whether to overwrite the destination virtual hard + /// disk, in case of conflict. /// - [JsonProperty(PropertyName = "overwriteVhds")] - public bool OverwriteVhds { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "overwriteVhds")] + public bool OverwriteVhds {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (VhdPrefix == null) + if (this.VhdPrefix == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "VhdPrefix"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "VhdPrefix"); } - if (DestinationContainerName == null) + if (this.DestinationContainerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "DestinationContainerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DestinationContainerName"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineCaptureResult.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineCaptureResult.cs index 95398bbdf8ad..3fed26e6e601 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineCaptureResult.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineCaptureResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineCaptureResult : SubResource { /// - /// Initializes a new instance of the VirtualMachineCaptureResult - /// class. + /// Initializes a new instance of the VirtualMachineCaptureResult class. /// public VirtualMachineCaptureResult() { @@ -30,24 +21,31 @@ public VirtualMachineCaptureResult() } /// - /// Initializes a new instance of the VirtualMachineCaptureResult - /// class. + /// Initializes a new instance of the VirtualMachineCaptureResult class. /// - /// Resource Id - /// the schema of the captured virtual - /// machine - /// the version of the content - /// parameters of the captured virtual - /// machine - /// a list of resource items of the captured - /// virtual machine - public VirtualMachineCaptureResult(string id = default(string), string schema = default(string), string contentVersion = default(string), object parameters = default(object), IList resources = default(IList)) - : base(id) + + /// Resource Id + /// + + /// the schema of the captured virtual machine + /// + + /// the version of the content + /// + + /// parameters of the captured virtual machine + /// + + /// a list of resource items of the captured virtual machine + /// + public VirtualMachineCaptureResult(string id = default(string), string schema = default(string), string contentVersion = default(string), object parameters = default(object), System.Collections.Generic.IList resources = default(System.Collections.Generic.IList)) + + : base(id) { - Schema = schema; - ContentVersion = contentVersion; - Parameters = parameters; - Resources = resources; + this.Schema = schema; + this.ContentVersion = contentVersion; + this.Parameters = parameters; + this.Resources = resources; CustomInit(); } @@ -56,29 +54,29 @@ public VirtualMachineCaptureResult() /// partial void CustomInit(); + /// /// Gets the schema of the captured virtual machine /// - [JsonProperty(PropertyName = "$schema")] - public string Schema { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "$schema")] + public string Schema {get; private set; } /// /// Gets the version of the content /// - [JsonProperty(PropertyName = "contentVersion")] - public string ContentVersion { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "contentVersion")] + public string ContentVersion {get; private set; } /// /// Gets parameters of the captured virtual machine /// - [JsonProperty(PropertyName = "parameters")] - public object Parameters { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "parameters")] + public object Parameters {get; private set; } /// /// Gets a list of resource items of the captured virtual machine /// - [JsonProperty(PropertyName = "resources")] - public IList Resources { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "resources")] + public System.Collections.Generic.IList Resources {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineEvictionPolicyTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineEvictionPolicyTypes.cs index 94370101fd0c..8985fbd7a710 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineEvictionPolicyTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineEvictionPolicyTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for VirtualMachineEvictionPolicyTypes. /// + + public static class VirtualMachineEvictionPolicyTypes { public const string Deallocate = "Deallocate"; public const string Delete = "Delete"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtension.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtension.cs index c42b0ada374b..979a123d7d81 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtension.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtension.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Describes a Virtual Machine Extension. /// - [Rest.Serialization.JsonTransformation] - public partial class VirtualMachineExtension : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class VirtualMachineExtension : TrackedResource { /// /// Initializes a new instance of the VirtualMachineExtension class. @@ -34,62 +24,87 @@ public VirtualMachineExtension() /// /// Initializes a new instance of the VirtualMachineExtension class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// How the extension handler should be - /// forced to update even if the extension configuration has not - /// changed. - /// The name of the extension handler - /// publisher. - /// Specifies the type of the - /// extension; an example is "CustomScriptExtension". - /// Specifies the version of the - /// script handler. - /// Indicates whether the - /// extension should use a newer minor version if one is available at - /// deployment time. Once deployed, however, the extension will not - /// upgrade minor versions unless redeployed, even with this property - /// set to true. - /// Indicates whether the - /// extension should be automatically upgraded by the platform if there - /// is a newer version of the extension available. - /// Json formatted public settings for the - /// extension. - /// The extension can contain either - /// protectedSettings or protectedSettingsFromKeyVault or no protected - /// settings at all. - /// The provisioning state, which only - /// appears in the response. - /// The virtual machine extension instance - /// view. - /// Indicates whether failures stemming - /// from the extension will be suppressed (Operational failures such as - /// not connecting to the VM will not be suppressed regardless of this - /// value). The default is false. - /// The extensions - /// protected settings that are passed by reference, and consumed from - /// key vault - /// Collection of extension - /// names after which this extension needs to be provisioned. - public VirtualMachineExtension(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string forceUpdateTag = default(string), string publisher = default(string), string virtualMachineExtensionType = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object), string provisioningState = default(string), VirtualMachineExtensionInstanceView instanceView = default(VirtualMachineExtensionInstanceView), bool? suppressFailures = default(bool?), KeyVaultSecretReference protectedSettingsFromKeyVault = default(KeyVaultSecretReference), IList provisionAfterExtensions = default(IList)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// How the extension handler should be forced to update even if the extension + /// configuration has not changed. + /// + + /// The name of the extension handler publisher. + /// + + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// + + /// Specifies the version of the script handler. + /// + + /// Indicates whether the extension should use a newer minor version if one is + /// available at deployment time. Once deployed, however, the extension will + /// not upgrade minor versions unless redeployed, even with this property set + /// to true. + /// + + /// Indicates whether the extension should be automatically upgraded by the + /// platform if there is a newer version of the extension available. + /// + + /// Json formatted public settings for the extension. + /// + + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// The virtual machine extension instance view. + /// + + /// Indicates whether failures stemming from the extension will be suppressed + /// (Operational failures such as not connecting to the VM will not be + /// suppressed regardless of this value). The default is false. + /// + + /// The extensions protected settings that are passed by reference, and + /// consumed from key vault + /// + + /// Collection of extension names after which this extension needs to be + /// provisioned. + /// + public VirtualMachineExtension(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string forceUpdateTag = default(string), string publisher = default(string), string virtualMachineExtensionType = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object), string provisioningState = default(string), VirtualMachineExtensionInstanceView instanceView = default(VirtualMachineExtensionInstanceView), bool? suppressFailures = default(bool?), KeyVaultSecretReference protectedSettingsFromKeyVault = default(KeyVaultSecretReference), System.Collections.Generic.IList provisionAfterExtensions = default(System.Collections.Generic.IList)) + + : base(location, id, name, type, tags) { - ForceUpdateTag = forceUpdateTag; - Publisher = publisher; - VirtualMachineExtensionType = virtualMachineExtensionType; - TypeHandlerVersion = typeHandlerVersion; - AutoUpgradeMinorVersion = autoUpgradeMinorVersion; - EnableAutomaticUpgrade = enableAutomaticUpgrade; - Settings = settings; - ProtectedSettings = protectedSettings; - ProvisioningState = provisioningState; - InstanceView = instanceView; - SuppressFailures = suppressFailures; - ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; - ProvisionAfterExtensions = provisionAfterExtensions; + this.ForceUpdateTag = forceUpdateTag; + this.Publisher = publisher; + this.VirtualMachineExtensionType = virtualMachineExtensionType; + this.TypeHandlerVersion = typeHandlerVersion; + this.AutoUpgradeMinorVersion = autoUpgradeMinorVersion; + this.EnableAutomaticUpgrade = enableAutomaticUpgrade; + this.Settings = settings; + this.ProtectedSettings = protectedSettings; + this.ProvisioningState = provisioningState; + this.InstanceView = instanceView; + this.SuppressFailures = suppressFailures; + this.ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + this.ProvisionAfterExtensions = provisionAfterExtensions; CustomInit(); } @@ -98,110 +113,118 @@ public VirtualMachineExtension() /// partial void CustomInit(); + /// - /// Gets or sets how the extension handler should be forced to update - /// even if the extension configuration has not changed. + /// Gets or sets how the extension handler should be forced to update even if + /// the extension configuration has not changed. /// - [JsonProperty(PropertyName = "properties.forceUpdateTag")] - public string ForceUpdateTag { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.forceUpdateTag")] + public string ForceUpdateTag {get; set; } /// /// Gets or sets the name of the extension handler publisher. /// - [JsonProperty(PropertyName = "properties.publisher")] - public string Publisher { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publisher")] + public string Publisher {get; set; } /// /// Gets or sets specifies the type of the extension; an example is - /// "CustomScriptExtension". + /// "CustomScriptExtension". /// - [JsonProperty(PropertyName = "properties.type")] - public string VirtualMachineExtensionType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.type")] + public string VirtualMachineExtensionType {get; set; } /// /// Gets or sets specifies the version of the script handler. /// - [JsonProperty(PropertyName = "properties.typeHandlerVersion")] - public string TypeHandlerVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.typeHandlerVersion")] + public string TypeHandlerVersion {get; set; } /// - /// Gets or sets indicates whether the extension should use a newer - /// minor version if one is available at deployment time. Once - /// deployed, however, the extension will not upgrade minor versions - /// unless redeployed, even with this property set to true. + /// Gets or sets indicates whether the extension should use a newer minor + /// version if one is available at deployment time. Once deployed, however, the + /// extension will not upgrade minor versions unless redeployed, even with this + /// property set to true. /// - [JsonProperty(PropertyName = "properties.autoUpgradeMinorVersion")] - public bool? AutoUpgradeMinorVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoUpgradeMinorVersion")] + public bool? AutoUpgradeMinorVersion {get; set; } /// - /// Gets or sets indicates whether the extension should be - /// automatically upgraded by the platform if there is a newer version - /// of the extension available. + /// Gets or sets indicates whether the extension should be automatically + /// upgraded by the platform if there is a newer version of the extension + /// available. /// - [JsonProperty(PropertyName = "properties.enableAutomaticUpgrade")] - public bool? EnableAutomaticUpgrade { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableAutomaticUpgrade")] + public bool? EnableAutomaticUpgrade {get; set; } /// /// Gets or sets json formatted public settings for the extension. /// - [JsonProperty(PropertyName = "properties.settings")] - public object Settings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.settings")] + public object Settings {get; set; } /// /// Gets or sets the extension can contain either protectedSettings or /// protectedSettingsFromKeyVault or no protected settings at all. /// - [JsonProperty(PropertyName = "properties.protectedSettings")] - public object ProtectedSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protectedSettings")] + public object ProtectedSettings {get; set; } /// /// Gets the provisioning state, which only appears in the response. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Gets or sets the virtual machine extension instance view. /// - [JsonProperty(PropertyName = "properties.instanceView")] - public VirtualMachineExtensionInstanceView InstanceView { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.instanceView")] + public VirtualMachineExtensionInstanceView InstanceView {get; set; } /// - /// Gets or sets indicates whether failures stemming from the extension - /// will be suppressed (Operational failures such as not connecting to - /// the VM will not be suppressed regardless of this value). The - /// default is false. + /// Gets or sets indicates whether failures stemming from the extension will be + /// suppressed (Operational failures such as not connecting to the VM will not + /// be suppressed regardless of this value). The default is false. /// - [JsonProperty(PropertyName = "properties.suppressFailures")] - public bool? SuppressFailures { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.suppressFailures")] + public bool? SuppressFailures {get; set; } /// /// Gets or sets the extensions protected settings that are passed by /// reference, and consumed from key vault /// - [JsonProperty(PropertyName = "properties.protectedSettingsFromKeyVault")] - public KeyVaultSecretReference ProtectedSettingsFromKeyVault { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protectedSettingsFromKeyVault")] + public KeyVaultSecretReference ProtectedSettingsFromKeyVault {get; set; } /// - /// Gets or sets collection of extension names after which this - /// extension needs to be provisioned. + /// Gets or sets collection of extension names after which this extension needs + /// to be provisioned. /// - [JsonProperty(PropertyName = "properties.provisionAfterExtensions")] - public IList ProvisionAfterExtensions { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisionAfterExtensions")] + public System.Collections.Generic.IList ProvisionAfterExtensions {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (ProtectedSettingsFromKeyVault != null) + + + + + + + + + if (this.ProtectedSettingsFromKeyVault != null) { - ProtectedSettingsFromKeyVault.Validate(); + this.ProtectedSettingsFromKeyVault.Validate(); } + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionHandlerInstanceView.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionHandlerInstanceView.cs index ba3f55442e06..ce9fcdbd3e9f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionHandlerInstanceView.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionHandlerInstanceView.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineExtensionHandlerInstanceView { /// - /// Initializes a new instance of the - /// VirtualMachineExtensionHandlerInstanceView class. + /// Initializes a new instance of the VirtualMachineExtensionHandlerInstanceView class. /// public VirtualMachineExtensionHandlerInstanceView() { @@ -28,19 +21,23 @@ public VirtualMachineExtensionHandlerInstanceView() } /// - /// Initializes a new instance of the - /// VirtualMachineExtensionHandlerInstanceView class. + /// Initializes a new instance of the VirtualMachineExtensionHandlerInstanceView class. /// - /// Specifies the type of the extension; an example - /// is "CustomScriptExtension". - /// Specifies the version of the - /// script handler. - /// The extension handler status. + + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// + + /// Specifies the version of the script handler. + /// + + /// The extension handler status. + /// public VirtualMachineExtensionHandlerInstanceView(string type = default(string), string typeHandlerVersion = default(string), InstanceViewStatus status = default(InstanceViewStatus)) + { - Type = type; - TypeHandlerVersion = typeHandlerVersion; - Status = status; + this.Type = type; + this.TypeHandlerVersion = typeHandlerVersion; + this.Status = status; CustomInit(); } @@ -49,24 +46,24 @@ public VirtualMachineExtensionHandlerInstanceView() /// partial void CustomInit(); + /// /// Gets or sets specifies the type of the extension; an example is - /// "CustomScriptExtension". + /// "CustomScriptExtension". /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets specifies the version of the script handler. /// - [JsonProperty(PropertyName = "typeHandlerVersion")] - public string TypeHandlerVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "typeHandlerVersion")] + public string TypeHandlerVersion {get; set; } /// /// Gets or sets the extension handler status. /// - [JsonProperty(PropertyName = "status")] - public InstanceViewStatus Status { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public InstanceViewStatus Status {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionImage.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionImage.cs index a402046384be..8532b1fbfc90 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionImage.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionImage.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Describes a Virtual Machine Extension Image. /// - [Rest.Serialization.JsonTransformation] - public partial class VirtualMachineExtensionImage : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class VirtualMachineExtensionImage : TrackedResource { /// - /// Initializes a new instance of the VirtualMachineExtensionImage - /// class. + /// Initializes a new instance of the VirtualMachineExtensionImage class. /// public VirtualMachineExtensionImage() { @@ -33,36 +22,51 @@ public VirtualMachineExtensionImage() } /// - /// Initializes a new instance of the VirtualMachineExtensionImage - /// class. + /// Initializes a new instance of the VirtualMachineExtensionImage class. /// - /// Resource location - /// The operating system this extension - /// supports. - /// The type of role (IaaS or PaaS) this - /// extension supports. - /// The schema defined by publisher, where - /// extension consumers should provide settings in a matching - /// schema. - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// Whether the extension can be used - /// on xRP VMScaleSets. By default existing extensions are usable on - /// scalesets, but there might be cases where a publisher wants to - /// explicitly indicate the extension is only enabled for CRP VMs but - /// not VMSS. - /// Whether the handler can - /// support multiple extensions. - public VirtualMachineExtensionImage(string location, string operatingSystem, string computeRole, string handlerSchema, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), bool? vmScaleSetEnabled = default(bool?), bool? supportsMultipleExtensions = default(bool?)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// The operating system this extension supports. + /// + + /// The type of role (IaaS or PaaS) this extension supports. + /// + + /// The schema defined by publisher, where extension consumers should provide + /// settings in a matching schema. + /// + + /// Whether the extension can be used on xRP VMScaleSets. By default existing + /// extensions are usable on scalesets, but there might be cases where a + /// publisher wants to explicitly indicate the extension is only enabled for + /// CRP VMs but not VMSS. + /// + + /// Whether the handler can support multiple extensions. + /// + public VirtualMachineExtensionImage(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string operatingSystem = default(string), string computeRole = default(string), string handlerSchema = default(string), bool? vmScaleSetEnabled = default(bool?), bool? supportsMultipleExtensions = default(bool?)) + + : base(location, id, name, type, tags) { - OperatingSystem = operatingSystem; - ComputeRole = computeRole; - HandlerSchema = handlerSchema; - VmScaleSetEnabled = vmScaleSetEnabled; - SupportsMultipleExtensions = supportsMultipleExtensions; + this.OperatingSystem = operatingSystem; + this.ComputeRole = computeRole; + this.HandlerSchema = handlerSchema; + this.VMScaleSetEnabled = vmScaleSetEnabled; + this.SupportsMultipleExtensions = supportsMultipleExtensions; CustomInit(); } @@ -71,62 +75,52 @@ public VirtualMachineExtensionImage() /// partial void CustomInit(); + /// /// Gets or sets the operating system this extension supports. /// - [JsonProperty(PropertyName = "properties.operatingSystem")] - public string OperatingSystem { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.operatingSystem")] + public string OperatingSystem {get; set; } /// - /// Gets or sets the type of role (IaaS or PaaS) this extension - /// supports. + /// Gets or sets the type of role (IaaS or PaaS) this extension supports. /// - [JsonProperty(PropertyName = "properties.computeRole")] - public string ComputeRole { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.computeRole")] + public string ComputeRole {get; set; } /// - /// Gets or sets the schema defined by publisher, where extension - /// consumers should provide settings in a matching schema. + /// Gets or sets the schema defined by publisher, where extension consumers + /// should provide settings in a matching schema. /// - [JsonProperty(PropertyName = "properties.handlerSchema")] - public string HandlerSchema { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.handlerSchema")] + public string HandlerSchema {get; set; } /// - /// Gets or sets whether the extension can be used on xRP VMScaleSets. - /// By default existing extensions are usable on scalesets, but there - /// might be cases where a publisher wants to explicitly indicate the - /// extension is only enabled for CRP VMs but not VMSS. + /// Gets or sets whether the extension can be used on xRP VMScaleSets. By + /// default existing extensions are usable on scalesets, but there might be + /// cases where a publisher wants to explicitly indicate the extension is only + /// enabled for CRP VMs but not VMSS. /// - [JsonProperty(PropertyName = "properties.vmScaleSetEnabled")] - public bool? VmScaleSetEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vmScaleSetEnabled")] + public bool? VMScaleSetEnabled {get; set; } /// /// Gets or sets whether the handler can support multiple extensions. /// - [JsonProperty(PropertyName = "properties.supportsMultipleExtensions")] - public bool? SupportsMultipleExtensions { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.supportsMultipleExtensions")] + public bool? SupportsMultipleExtensions {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (OperatingSystem == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "OperatingSystem"); - } - if (ComputeRole == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ComputeRole"); - } - if (HandlerSchema == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "HandlerSchema"); - } + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionImageProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionImageProperties.cs new file mode 100644 index 000000000000..533a758c7e28 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionImageProperties.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a Virtual Machine Extension Image. + /// + public partial class VirtualMachineExtensionImageProperties + { + /// + /// Initializes a new instance of the VirtualMachineExtensionImageProperties class. + /// + public VirtualMachineExtensionImageProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineExtensionImageProperties class. + /// + + /// The operating system this extension supports. + /// + + /// The type of role (IaaS or PaaS) this extension supports. + /// + + /// The schema defined by publisher, where extension consumers should provide + /// settings in a matching schema. + /// + + /// Whether the extension can be used on xRP VMScaleSets. By default existing + /// extensions are usable on scalesets, but there might be cases where a + /// publisher wants to explicitly indicate the extension is only enabled for + /// CRP VMs but not VMSS. + /// + + /// Whether the handler can support multiple extensions. + /// + public VirtualMachineExtensionImageProperties(string operatingSystem, string computeRole, string handlerSchema, bool? vmScaleSetEnabled = default(bool?), bool? supportsMultipleExtensions = default(bool?)) + + { + this.OperatingSystem = operatingSystem; + this.ComputeRole = computeRole; + this.HandlerSchema = handlerSchema; + this.VMScaleSetEnabled = vmScaleSetEnabled; + this.SupportsMultipleExtensions = supportsMultipleExtensions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the operating system this extension supports. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "operatingSystem")] + public string OperatingSystem {get; set; } + + /// + /// Gets or sets the type of role (IaaS or PaaS) this extension supports. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "computeRole")] + public string ComputeRole {get; set; } + + /// + /// Gets or sets the schema defined by publisher, where extension consumers + /// should provide settings in a matching schema. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "handlerSchema")] + public string HandlerSchema {get; set; } + + /// + /// Gets or sets whether the extension can be used on xRP VMScaleSets. By + /// default existing extensions are usable on scalesets, but there might be + /// cases where a publisher wants to explicitly indicate the extension is only + /// enabled for CRP VMs but not VMSS. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vmScaleSetEnabled")] + public bool? VMScaleSetEnabled {get; set; } + + /// + /// Gets or sets whether the handler can support multiple extensions. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "supportsMultipleExtensions")] + public bool? SupportsMultipleExtensions {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.OperatingSystem == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "OperatingSystem"); + } + if (this.ComputeRole == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ComputeRole"); + } + if (this.HandlerSchema == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "HandlerSchema"); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionInstanceView.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionInstanceView.cs index 2104b94125d7..f22fe8683ed8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionInstanceView.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionInstanceView.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineExtensionInstanceView { /// - /// Initializes a new instance of the - /// VirtualMachineExtensionInstanceView class. + /// Initializes a new instance of the VirtualMachineExtensionInstanceView class. /// public VirtualMachineExtensionInstanceView() { @@ -30,23 +21,31 @@ public VirtualMachineExtensionInstanceView() } /// - /// Initializes a new instance of the - /// VirtualMachineExtensionInstanceView class. + /// Initializes a new instance of the VirtualMachineExtensionInstanceView class. /// - /// The virtual machine extension name. - /// Specifies the type of the extension; an example - /// is "CustomScriptExtension". - /// Specifies the version of the - /// script handler. - /// The resource status information. - /// The resource status information. - public VirtualMachineExtensionInstanceView(string name = default(string), string type = default(string), string typeHandlerVersion = default(string), IList substatuses = default(IList), IList statuses = default(IList)) + + /// The virtual machine extension name. + /// + + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// + + /// Specifies the version of the script handler. + /// + + /// The resource status information. + /// + + /// The resource status information. + /// + public VirtualMachineExtensionInstanceView(string name = default(string), string type = default(string), string typeHandlerVersion = default(string), System.Collections.Generic.IList substatuses = default(System.Collections.Generic.IList), System.Collections.Generic.IList statuses = default(System.Collections.Generic.IList)) + { - Name = name; - Type = type; - TypeHandlerVersion = typeHandlerVersion; - Substatuses = substatuses; - Statuses = statuses; + this.Name = name; + this.Type = type; + this.TypeHandlerVersion = typeHandlerVersion; + this.Substatuses = substatuses; + this.Statuses = statuses; CustomInit(); } @@ -55,36 +54,36 @@ public VirtualMachineExtensionInstanceView() /// partial void CustomInit(); + /// /// Gets or sets the virtual machine extension name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets specifies the type of the extension; an example is - /// "CustomScriptExtension". + /// "CustomScriptExtension". /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets specifies the version of the script handler. /// - [JsonProperty(PropertyName = "typeHandlerVersion")] - public string TypeHandlerVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "typeHandlerVersion")] + public string TypeHandlerVersion {get; set; } /// /// Gets or sets the resource status information. /// - [JsonProperty(PropertyName = "substatuses")] - public IList Substatuses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "substatuses")] + public System.Collections.Generic.IList Substatuses {get; set; } /// /// Gets or sets the resource status information. /// - [JsonProperty(PropertyName = "statuses")] - public IList Statuses { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "statuses")] + public System.Collections.Generic.IList Statuses {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionProperties.cs new file mode 100644 index 000000000000..5e2779566a63 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionProperties.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a Virtual Machine Extension. + /// + public partial class VirtualMachineExtensionProperties + { + /// + /// Initializes a new instance of the VirtualMachineExtensionProperties class. + /// + public VirtualMachineExtensionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineExtensionProperties class. + /// + + /// How the extension handler should be forced to update even if the extension + /// configuration has not changed. + /// + + /// The name of the extension handler publisher. + /// + + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// + + /// Specifies the version of the script handler. + /// + + /// Indicates whether the extension should use a newer minor version if one is + /// available at deployment time. Once deployed, however, the extension will + /// not upgrade minor versions unless redeployed, even with this property set + /// to true. + /// + + /// Indicates whether the extension should be automatically upgraded by the + /// platform if there is a newer version of the extension available. + /// + + /// Json formatted public settings for the extension. + /// + + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// The virtual machine extension instance view. + /// + + /// Indicates whether failures stemming from the extension will be suppressed + /// (Operational failures such as not connecting to the VM will not be + /// suppressed regardless of this value). The default is false. + /// + + /// The extensions protected settings that are passed by reference, and + /// consumed from key vault + /// + + /// Collection of extension names after which this extension needs to be + /// provisioned. + /// + public VirtualMachineExtensionProperties(string forceUpdateTag = default(string), string publisher = default(string), string type = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object), string provisioningState = default(string), VirtualMachineExtensionInstanceView instanceView = default(VirtualMachineExtensionInstanceView), bool? suppressFailures = default(bool?), KeyVaultSecretReference protectedSettingsFromKeyVault = default(KeyVaultSecretReference), System.Collections.Generic.IList provisionAfterExtensions = default(System.Collections.Generic.IList)) + + { + this.ForceUpdateTag = forceUpdateTag; + this.Publisher = publisher; + this.Type = type; + this.TypeHandlerVersion = typeHandlerVersion; + this.AutoUpgradeMinorVersion = autoUpgradeMinorVersion; + this.EnableAutomaticUpgrade = enableAutomaticUpgrade; + this.Settings = settings; + this.ProtectedSettings = protectedSettings; + this.ProvisioningState = provisioningState; + this.InstanceView = instanceView; + this.SuppressFailures = suppressFailures; + this.ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + this.ProvisionAfterExtensions = provisionAfterExtensions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets how the extension handler should be forced to update even if + /// the extension configuration has not changed. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "forceUpdateTag")] + public string ForceUpdateTag {get; set; } + + /// + /// Gets or sets the name of the extension handler publisher. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publisher")] + public string Publisher {get; set; } + + /// + /// Gets or sets specifies the type of the extension; an example is + /// "CustomScriptExtension". + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } + + /// + /// Gets or sets specifies the version of the script handler. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "typeHandlerVersion")] + public string TypeHandlerVersion {get; set; } + + /// + /// Gets or sets indicates whether the extension should use a newer minor + /// version if one is available at deployment time. Once deployed, however, the + /// extension will not upgrade minor versions unless redeployed, even with this + /// property set to true. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "autoUpgradeMinorVersion")] + public bool? AutoUpgradeMinorVersion {get; set; } + + /// + /// Gets or sets indicates whether the extension should be automatically + /// upgraded by the platform if there is a newer version of the extension + /// available. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableAutomaticUpgrade")] + public bool? EnableAutomaticUpgrade {get; set; } + + /// + /// Gets or sets json formatted public settings for the extension. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "settings")] + public object Settings {get; set; } + + /// + /// Gets or sets the extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protectedSettings")] + public object ProtectedSettings {get; set; } + + /// + /// Gets the provisioning state, which only appears in the response. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets the virtual machine extension instance view. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "instanceView")] + public VirtualMachineExtensionInstanceView InstanceView {get; set; } + + /// + /// Gets or sets indicates whether failures stemming from the extension will be + /// suppressed (Operational failures such as not connecting to the VM will not + /// be suppressed regardless of this value). The default is false. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "suppressFailures")] + public bool? SuppressFailures {get; set; } + + /// + /// Gets or sets the extensions protected settings that are passed by + /// reference, and consumed from key vault + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protectedSettingsFromKeyVault")] + public KeyVaultSecretReference ProtectedSettingsFromKeyVault {get; set; } + + /// + /// Gets or sets collection of extension names after which this extension needs + /// to be provisioned. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisionAfterExtensions")] + public System.Collections.Generic.IList ProvisionAfterExtensions {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + + + + + if (this.ProtectedSettingsFromKeyVault != null) + { + this.ProtectedSettingsFromKeyVault.Validate(); + } + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionUpdate.cs index 64a288bbcffc..3509850fc987 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionUpdate.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Describes a Virtual Machine Extension. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachineExtensionUpdate : UpdateResource { /// - /// Initializes a new instance of the VirtualMachineExtensionUpdate - /// class. + /// Initializes a new instance of the VirtualMachineExtensionUpdate class. /// public VirtualMachineExtensionUpdate() { @@ -33,52 +22,64 @@ public VirtualMachineExtensionUpdate() } /// - /// Initializes a new instance of the VirtualMachineExtensionUpdate - /// class. + /// Initializes a new instance of the VirtualMachineExtensionUpdate class. /// - /// Resource tags - /// How the extension handler should be - /// forced to update even if the extension configuration has not - /// changed. - /// The name of the extension handler - /// publisher. - /// Specifies the type of the extension; an example - /// is "CustomScriptExtension". - /// Specifies the version of the - /// script handler. - /// Indicates whether the - /// extension should use a newer minor version if one is available at - /// deployment time. Once deployed, however, the extension will not - /// upgrade minor versions unless redeployed, even with this property - /// set to true. - /// Indicates whether the - /// extension should be automatically upgraded by the platform if there - /// is a newer version of the extension available. - /// Json formatted public settings for the - /// extension. - /// The extension can contain either - /// protectedSettings or protectedSettingsFromKeyVault or no protected - /// settings at all. - /// Indicates whether failures stemming - /// from the extension will be suppressed (Operational failures such as - /// not connecting to the VM will not be suppressed regardless of this - /// value). The default is false. - /// The extensions - /// protected settings that are passed by reference, and consumed from - /// key vault - public VirtualMachineExtensionUpdate(IDictionary tags = default(IDictionary), string forceUpdateTag = default(string), string publisher = default(string), string type = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object), bool? suppressFailures = default(bool?), KeyVaultSecretReference protectedSettingsFromKeyVault = default(KeyVaultSecretReference)) - : base(tags) + + /// Resource tags + /// + + /// How the extension handler should be forced to update even if the extension + /// configuration has not changed. + /// + + /// The name of the extension handler publisher. + /// + + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// + + /// Specifies the version of the script handler. + /// + + /// Indicates whether the extension should use a newer minor version if one is + /// available at deployment time. Once deployed, however, the extension will + /// not upgrade minor versions unless redeployed, even with this property set + /// to true. + /// + + /// Indicates whether the extension should be automatically upgraded by the + /// platform if there is a newer version of the extension available. + /// + + /// Json formatted public settings for the extension. + /// + + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + + /// Indicates whether failures stemming from the extension will be suppressed + /// (Operational failures such as not connecting to the VM will not be + /// suppressed regardless of this value). The default is false. + /// + + /// The extensions protected settings that are passed by reference, and + /// consumed from key vault + /// + public VirtualMachineExtensionUpdate(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string forceUpdateTag = default(string), string publisher = default(string), string type = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object), bool? suppressFailures = default(bool?), KeyVaultSecretReference protectedSettingsFromKeyVault = default(KeyVaultSecretReference)) + + : base(tags) { - ForceUpdateTag = forceUpdateTag; - Publisher = publisher; - Type = type; - TypeHandlerVersion = typeHandlerVersion; - AutoUpgradeMinorVersion = autoUpgradeMinorVersion; - EnableAutomaticUpgrade = enableAutomaticUpgrade; - Settings = settings; - ProtectedSettings = protectedSettings; - SuppressFailures = suppressFailures; - ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + this.ForceUpdateTag = forceUpdateTag; + this.Publisher = publisher; + this.Type = type; + this.TypeHandlerVersion = typeHandlerVersion; + this.AutoUpgradeMinorVersion = autoUpgradeMinorVersion; + this.EnableAutomaticUpgrade = enableAutomaticUpgrade; + this.Settings = settings; + this.ProtectedSettings = protectedSettings; + this.SuppressFailures = suppressFailures; + this.ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; CustomInit(); } @@ -87,90 +88,95 @@ public VirtualMachineExtensionUpdate() /// partial void CustomInit(); + /// - /// Gets or sets how the extension handler should be forced to update - /// even if the extension configuration has not changed. + /// Gets or sets how the extension handler should be forced to update even if + /// the extension configuration has not changed. /// - [JsonProperty(PropertyName = "properties.forceUpdateTag")] - public string ForceUpdateTag { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.forceUpdateTag")] + public string ForceUpdateTag {get; set; } /// /// Gets or sets the name of the extension handler publisher. /// - [JsonProperty(PropertyName = "properties.publisher")] - public string Publisher { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publisher")] + public string Publisher {get; set; } /// /// Gets or sets specifies the type of the extension; an example is - /// "CustomScriptExtension". + /// "CustomScriptExtension". /// - [JsonProperty(PropertyName = "properties.type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.type")] + public string Type {get; set; } /// /// Gets or sets specifies the version of the script handler. /// - [JsonProperty(PropertyName = "properties.typeHandlerVersion")] - public string TypeHandlerVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.typeHandlerVersion")] + public string TypeHandlerVersion {get; set; } /// - /// Gets or sets indicates whether the extension should use a newer - /// minor version if one is available at deployment time. Once - /// deployed, however, the extension will not upgrade minor versions - /// unless redeployed, even with this property set to true. + /// Gets or sets indicates whether the extension should use a newer minor + /// version if one is available at deployment time. Once deployed, however, the + /// extension will not upgrade minor versions unless redeployed, even with this + /// property set to true. /// - [JsonProperty(PropertyName = "properties.autoUpgradeMinorVersion")] - public bool? AutoUpgradeMinorVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoUpgradeMinorVersion")] + public bool? AutoUpgradeMinorVersion {get; set; } /// - /// Gets or sets indicates whether the extension should be - /// automatically upgraded by the platform if there is a newer version - /// of the extension available. + /// Gets or sets indicates whether the extension should be automatically + /// upgraded by the platform if there is a newer version of the extension + /// available. /// - [JsonProperty(PropertyName = "properties.enableAutomaticUpgrade")] - public bool? EnableAutomaticUpgrade { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableAutomaticUpgrade")] + public bool? EnableAutomaticUpgrade {get; set; } /// /// Gets or sets json formatted public settings for the extension. /// - [JsonProperty(PropertyName = "properties.settings")] - public object Settings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.settings")] + public object Settings {get; set; } /// /// Gets or sets the extension can contain either protectedSettings or /// protectedSettingsFromKeyVault or no protected settings at all. /// - [JsonProperty(PropertyName = "properties.protectedSettings")] - public object ProtectedSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protectedSettings")] + public object ProtectedSettings {get; set; } /// - /// Gets or sets indicates whether failures stemming from the extension - /// will be suppressed (Operational failures such as not connecting to - /// the VM will not be suppressed regardless of this value). The - /// default is false. + /// Gets or sets indicates whether failures stemming from the extension will be + /// suppressed (Operational failures such as not connecting to the VM will not + /// be suppressed regardless of this value). The default is false. /// - [JsonProperty(PropertyName = "properties.suppressFailures")] - public bool? SuppressFailures { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.suppressFailures")] + public bool? SuppressFailures {get; set; } /// /// Gets or sets the extensions protected settings that are passed by /// reference, and consumed from key vault /// - [JsonProperty(PropertyName = "properties.protectedSettingsFromKeyVault")] - public KeyVaultSecretReference ProtectedSettingsFromKeyVault { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protectedSettingsFromKeyVault")] + public KeyVaultSecretReference ProtectedSettingsFromKeyVault {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ProtectedSettingsFromKeyVault != null) + + + + + + + if (this.ProtectedSettingsFromKeyVault != null) { - ProtectedSettingsFromKeyVault.Validate(); + this.ProtectedSettingsFromKeyVault.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionUpdateProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionUpdateProperties.cs new file mode 100644 index 000000000000..d88798977b1b --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionUpdateProperties.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a Virtual Machine Extension. + /// + public partial class VirtualMachineExtensionUpdateProperties + { + /// + /// Initializes a new instance of the VirtualMachineExtensionUpdateProperties class. + /// + public VirtualMachineExtensionUpdateProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineExtensionUpdateProperties class. + /// + + /// How the extension handler should be forced to update even if the extension + /// configuration has not changed. + /// + + /// The name of the extension handler publisher. + /// + + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// + + /// Specifies the version of the script handler. + /// + + /// Indicates whether the extension should use a newer minor version if one is + /// available at deployment time. Once deployed, however, the extension will + /// not upgrade minor versions unless redeployed, even with this property set + /// to true. + /// + + /// Indicates whether the extension should be automatically upgraded by the + /// platform if there is a newer version of the extension available. + /// + + /// Json formatted public settings for the extension. + /// + + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + + /// Indicates whether failures stemming from the extension will be suppressed + /// (Operational failures such as not connecting to the VM will not be + /// suppressed regardless of this value). The default is false. + /// + + /// The extensions protected settings that are passed by reference, and + /// consumed from key vault + /// + public VirtualMachineExtensionUpdateProperties(string forceUpdateTag = default(string), string publisher = default(string), string type = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object), bool? suppressFailures = default(bool?), KeyVaultSecretReference protectedSettingsFromKeyVault = default(KeyVaultSecretReference)) + + { + this.ForceUpdateTag = forceUpdateTag; + this.Publisher = publisher; + this.Type = type; + this.TypeHandlerVersion = typeHandlerVersion; + this.AutoUpgradeMinorVersion = autoUpgradeMinorVersion; + this.EnableAutomaticUpgrade = enableAutomaticUpgrade; + this.Settings = settings; + this.ProtectedSettings = protectedSettings; + this.SuppressFailures = suppressFailures; + this.ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets how the extension handler should be forced to update even if + /// the extension configuration has not changed. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "forceUpdateTag")] + public string ForceUpdateTag {get; set; } + + /// + /// Gets or sets the name of the extension handler publisher. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publisher")] + public string Publisher {get; set; } + + /// + /// Gets or sets specifies the type of the extension; an example is + /// "CustomScriptExtension". + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } + + /// + /// Gets or sets specifies the version of the script handler. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "typeHandlerVersion")] + public string TypeHandlerVersion {get; set; } + + /// + /// Gets or sets indicates whether the extension should use a newer minor + /// version if one is available at deployment time. Once deployed, however, the + /// extension will not upgrade minor versions unless redeployed, even with this + /// property set to true. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "autoUpgradeMinorVersion")] + public bool? AutoUpgradeMinorVersion {get; set; } + + /// + /// Gets or sets indicates whether the extension should be automatically + /// upgraded by the platform if there is a newer version of the extension + /// available. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableAutomaticUpgrade")] + public bool? EnableAutomaticUpgrade {get; set; } + + /// + /// Gets or sets json formatted public settings for the extension. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "settings")] + public object Settings {get; set; } + + /// + /// Gets or sets the extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protectedSettings")] + public object ProtectedSettings {get; set; } + + /// + /// Gets or sets indicates whether failures stemming from the extension will be + /// suppressed (Operational failures such as not connecting to the VM will not + /// be suppressed regardless of this value). The default is false. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "suppressFailures")] + public bool? SuppressFailures {get; set; } + + /// + /// Gets or sets the extensions protected settings that are passed by + /// reference, and consumed from key vault + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protectedSettingsFromKeyVault")] + public KeyVaultSecretReference ProtectedSettingsFromKeyVault {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + + + if (this.ProtectedSettingsFromKeyVault != null) + { + this.ProtectedSettingsFromKeyVault.Validate(); + } + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionsCreateOrUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionsCreateOrUpdateHeaders.cs index 020b805a7884..27572724c3ba 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionsCreateOrUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionsCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class VirtualMachineExtensionsCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// VirtualMachineExtensionsCreateOrUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineExtensionsCreateOrUpdateHeaders class. /// public VirtualMachineExtensionsCreateOrUpdateHeaders() { @@ -28,18 +18,19 @@ public VirtualMachineExtensionsCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// VirtualMachineExtensionsCreateOrUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineExtensionsCreateOrUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachineExtensionsCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachineExtensionsCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionsListResult.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionsListResult.cs index b499926d72ac..d352fac46560 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionsListResult.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionsListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineExtensionsListResult { /// - /// Initializes a new instance of the - /// VirtualMachineExtensionsListResult class. + /// Initializes a new instance of the VirtualMachineExtensionsListResult class. /// public VirtualMachineExtensionsListResult() { @@ -30,13 +21,15 @@ public VirtualMachineExtensionsListResult() } /// - /// Initializes a new instance of the - /// VirtualMachineExtensionsListResult class. + /// Initializes a new instance of the VirtualMachineExtensionsListResult class. /// - /// The list of extensions - public VirtualMachineExtensionsListResult(IList value = default(IList)) + + /// The list of extensions + /// + public VirtualMachineExtensionsListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -45,11 +38,11 @@ public VirtualMachineExtensionsListResult() /// partial void CustomInit(); + /// /// Gets or sets the list of extensions /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionsUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionsUpdateHeaders.cs index 2bc309ca8360..41196f31b735 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionsUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineExtensionsUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Update operation. - /// public partial class VirtualMachineExtensionsUpdateHeaders { /// - /// Initializes a new instance of the - /// VirtualMachineExtensionsUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineExtensionsUpdateHeaders class. /// public VirtualMachineExtensionsUpdateHeaders() { @@ -28,18 +18,19 @@ public VirtualMachineExtensionsUpdateHeaders() } /// - /// Initializes a new instance of the - /// VirtualMachineExtensionsUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineExtensionsUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachineExtensionsUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachineExtensionsUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineHealthStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineHealthStatus.cs index 76ab1b356e58..4aa2c81319b4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineHealthStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineHealthStatus.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public VirtualMachineHealthStatus() /// /// Initializes a new instance of the VirtualMachineHealthStatus class. /// - /// The health status information for the - /// VM. + + /// The health status information for the VM. + /// public VirtualMachineHealthStatus(InstanceViewStatus status = default(InstanceViewStatus)) + { - Status = status; + this.Status = status; CustomInit(); } @@ -42,11 +38,11 @@ public VirtualMachineHealthStatus() /// partial void CustomInit(); + /// /// Gets the health status information for the VM. /// - [JsonProperty(PropertyName = "status")] - public InstanceViewStatus Status { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public InstanceViewStatus Status {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineIdentity.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineIdentity.cs index 80061786b2ae..6cd5b46059a3 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineIdentity.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineIdentity.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,28 +23,33 @@ public VirtualMachineIdentity() /// /// Initializes a new instance of the VirtualMachineIdentity class. /// - /// The principal id of virtual machine - /// identity. This property will only be provided for a system assigned - /// identity. - /// The tenant id associated with the virtual - /// machine. This property will only be provided for a system assigned - /// identity. - /// The type of identity used for the virtual - /// machine. The type 'SystemAssigned, UserAssigned' includes both an - /// implicitly created identity and a set of user assigned identities. - /// The type 'None' will remove any identities from the virtual - /// machine. Possible values include: 'SystemAssigned', 'UserAssigned', - /// 'SystemAssigned, UserAssigned', 'None' - /// The list of user identities - /// associated with the Virtual Machine. The user identity dictionary - /// key references will be ARM resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - public VirtualMachineIdentity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?), IDictionary userAssignedIdentities = default(IDictionary)) + + /// The principal id of virtual machine identity. This property will only be + /// provided for a system assigned identity. + /// + + /// The tenant id associated with the virtual machine. This property will only + /// be provided for a system assigned identity. + /// + + /// The type of identity used for the virtual machine. The type + /// 'SystemAssigned, UserAssigned' includes both an implicitly created identity + /// and a set of user assigned identities. The type 'None' will remove any + /// identities from the virtual machine. + /// Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + /// UserAssigned', 'None' + + /// The list of user identities associated with the Virtual Machine. The user + /// identity dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + public VirtualMachineIdentity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?), System.Collections.Generic.IDictionary userAssignedIdentities = default(System.Collections.Generic.IDictionary)) + { - PrincipalId = principalId; - TenantId = tenantId; - Type = type; - UserAssignedIdentities = userAssignedIdentities; + this.PrincipalId = principalId; + this.TenantId = tenantId; + this.Type = type; + this.UserAssignedIdentities = userAssignedIdentities; CustomInit(); } @@ -61,39 +58,37 @@ public VirtualMachineIdentity() /// partial void CustomInit(); + /// - /// Gets the principal id of virtual machine identity. This property - /// will only be provided for a system assigned identity. + /// Gets the principal id of virtual machine identity. This property will only + /// be provided for a system assigned identity. /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; private set; } /// - /// Gets the tenant id associated with the virtual machine. This - /// property will only be provided for a system assigned identity. + /// Gets the tenant id associated with the virtual machine. This property will + /// only be provided for a system assigned identity. /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; private set; } /// - /// Gets or sets the type of identity used for the virtual machine. The - /// type 'SystemAssigned, UserAssigned' includes both an implicitly - /// created identity and a set of user assigned identities. The type - /// 'None' will remove any identities from the virtual machine. - /// Possible values include: 'SystemAssigned', 'UserAssigned', - /// 'SystemAssigned, UserAssigned', 'None' + /// Gets or sets the type of identity used for the virtual machine. The type + /// 'SystemAssigned, UserAssigned' includes both an implicitly created identity + /// and a set of user assigned identities. The type 'None' will remove any + /// identities from the virtual machine. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' /// - [JsonProperty(PropertyName = "type")] - public ResourceIdentityType? Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public ResourceIdentityType? Type {get; set; } /// - /// Gets or sets the list of user identities associated with the - /// Virtual Machine. The user identity dictionary key references will - /// be ARM resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// Gets or sets the list of user identities associated with the Virtual + /// Machine. The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. /// - [JsonProperty(PropertyName = "userAssignedIdentities")] - public IDictionary UserAssignedIdentities { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "userAssignedIdentities")] + public System.Collections.Generic.IDictionary UserAssignedIdentities {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineImage.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineImage.cs index 9920329fd922..6579eebc525a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineImage.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineImage.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Describes a Virtual Machine Image. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachineImage : VirtualMachineImageResource { /// @@ -34,44 +24,65 @@ public VirtualMachineImage() /// /// Initializes a new instance of the VirtualMachineImage class. /// - /// The name of the resource. - /// The supported Azure location of the - /// resource. - /// Resource Id - /// Specifies the tags that are assigned to the - /// virtual machine. For more information about using tags, see [Using - /// tags to organize your Azure - /// resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). - /// The extended location of the Virtual - /// Machine. - /// Used for establishing the purchase context of - /// any 3rd Party artifact through MarketPlace. - /// Contains the os disk image - /// information. - /// The list of data disk images - /// information. - /// Describes automatic OS - /// upgrade properties on the image. - /// Specifies the HyperVGeneration Type. - /// Possible values include: 'V1', 'V2' - /// Specifies disallowed configuration for the - /// VirtualMachine created from the image - /// Specifies the Architecture Type. - /// Possible values include: 'x64', 'Arm64' - /// Describes image deprecation - /// status properties on the image. - public VirtualMachineImage(string name, string location, string id = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), PurchasePlan plan = default(PurchasePlan), OSDiskImage osDiskImage = default(OSDiskImage), IList dataDiskImages = default(IList), AutomaticOSUpgradeProperties automaticOSUpgradeProperties = default(AutomaticOSUpgradeProperties), string hyperVGeneration = default(string), DisallowedConfiguration disallowed = default(DisallowedConfiguration), IList features = default(IList), string architecture = default(string), ImageDeprecationStatus imageDeprecationStatus = default(ImageDeprecationStatus)) - : base(name, location, id, tags, extendedLocation) + + /// Resource Id + /// + + /// The name of the resource. + /// + + /// The supported Azure location of the resource. + /// + + /// Specifies the tags that are assigned to the virtual machine. For more + /// information about using tags, see [Using tags to organize your Azure + /// resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + /// + + /// The extended location of the Virtual Machine. + /// + + /// Used for establishing the purchase context of any 3rd Party artifact + /// through MarketPlace. + /// + + /// Contains the os disk image information. + /// + + /// The list of data disk images information. + /// + + /// Describes automatic OS upgrade properties on the image. + /// + + /// Specifies the HyperVGeneration Type + /// Possible values include: 'V1', 'V2' + + /// Specifies disallowed configuration for the VirtualMachine created from the + /// image + /// + + /// + /// + + /// Specifies the Architecture Type + /// Possible values include: 'x64', 'Arm64' + + /// Describes image deprecation status properties on the image. + /// + public VirtualMachineImage(string name, string location, string id = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), PurchasePlan plan = default(PurchasePlan), OSDiskImage osDiskImage = default(OSDiskImage), System.Collections.Generic.IList dataDiskImages = default(System.Collections.Generic.IList), AutomaticOSUpgradeProperties automaticOSUpgradeProperties = default(AutomaticOSUpgradeProperties), string hyperVGeneration = default(string), DisallowedConfiguration disallowed = default(DisallowedConfiguration), System.Collections.Generic.IList features = default(System.Collections.Generic.IList), string architecture = default(string), ImageDeprecationStatus imageDeprecationStatus = default(ImageDeprecationStatus)) + + : base(name, location, id, tags, extendedLocation) { - Plan = plan; - OsDiskImage = osDiskImage; - DataDiskImages = dataDiskImages; - AutomaticOSUpgradeProperties = automaticOSUpgradeProperties; - HyperVGeneration = hyperVGeneration; - Disallowed = disallowed; - Features = features; - Architecture = architecture; - ImageDeprecationStatus = imageDeprecationStatus; + this.Plan = plan; + this.OsDiskImage = osDiskImage; + this.DataDiskImages = dataDiskImages; + this.AutomaticOSUpgradeProperties = automaticOSUpgradeProperties; + this.HyperVGeneration = hyperVGeneration; + this.Disallowed = disallowed; + this.Features = features; + this.Architecture = architecture; + this.ImageDeprecationStatus = imageDeprecationStatus; CustomInit(); } @@ -80,86 +91,89 @@ public VirtualMachineImage() /// partial void CustomInit(); + /// - /// Gets or sets used for establishing the purchase context of any 3rd - /// Party artifact through MarketPlace. + /// Gets or sets used for establishing the purchase context of any 3rd Party + /// artifact through MarketPlace. /// - [JsonProperty(PropertyName = "properties.plan")] - public PurchasePlan Plan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.plan")] + public PurchasePlan Plan {get; set; } /// /// Gets or sets contains the os disk image information. /// - [JsonProperty(PropertyName = "properties.osDiskImage")] - public OSDiskImage OsDiskImage { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osDiskImage")] + public OSDiskImage OsDiskImage {get; set; } /// /// Gets or sets the list of data disk images information. /// - [JsonProperty(PropertyName = "properties.dataDiskImages")] - public IList DataDiskImages { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dataDiskImages")] + public System.Collections.Generic.IList DataDiskImages {get; set; } /// - /// Gets or sets describes automatic OS upgrade properties on the - /// image. + /// Gets or sets describes automatic OS upgrade properties on the image. /// - [JsonProperty(PropertyName = "properties.automaticOSUpgradeProperties")] - public AutomaticOSUpgradeProperties AutomaticOSUpgradeProperties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.automaticOSUpgradeProperties")] + public AutomaticOSUpgradeProperties AutomaticOSUpgradeProperties {get; set; } /// - /// Gets or sets specifies the HyperVGeneration Type. Possible values - /// include: 'V1', 'V2' + /// Gets or sets specifies the HyperVGeneration Type Possible values include: 'V1', 'V2' /// - [JsonProperty(PropertyName = "properties.hyperVGeneration")] - public string HyperVGeneration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hyperVGeneration")] + public string HyperVGeneration {get; set; } /// - /// Gets or sets specifies disallowed configuration for the - /// VirtualMachine created from the image + /// Gets or sets specifies disallowed configuration for the VirtualMachine + /// created from the image /// - [JsonProperty(PropertyName = "properties.disallowed")] - public DisallowedConfiguration Disallowed { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disallowed")] + public DisallowedConfiguration Disallowed {get; set; } /// + /// Gets or sets /// - [JsonProperty(PropertyName = "properties.features")] - public IList Features { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.features")] + public System.Collections.Generic.IList Features {get; set; } /// - /// Gets or sets specifies the Architecture Type. Possible values - /// include: 'x64', 'Arm64' + /// Gets or sets specifies the Architecture Type Possible values include: 'x64', 'Arm64' /// - [JsonProperty(PropertyName = "properties.architecture")] - public string Architecture { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.architecture")] + public string Architecture {get; set; } /// - /// Gets or sets describes image deprecation status properties on the - /// image. + /// Gets or sets describes image deprecation status properties on the image. /// - [JsonProperty(PropertyName = "properties.imageDeprecationStatus")] - public ImageDeprecationStatus ImageDeprecationStatus { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.imageDeprecationStatus")] + public ImageDeprecationStatus ImageDeprecationStatus {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (Plan != null) + if (this.Plan != null) { - Plan.Validate(); + this.Plan.Validate(); } - if (OsDiskImage != null) + if (this.OsDiskImage != null) { - OsDiskImage.Validate(); + this.OsDiskImage.Validate(); } - if (AutomaticOSUpgradeProperties != null) + + if (this.AutomaticOSUpgradeProperties != null) { - AutomaticOSUpgradeProperties.Validate(); + this.AutomaticOSUpgradeProperties.Validate(); } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineImageFeature.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineImageFeature.cs index 5b38dfe6711a..798ddf344afd 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineImageFeature.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineImageFeature.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public VirtualMachineImageFeature() /// /// Initializes a new instance of the VirtualMachineImageFeature class. /// - /// The name of the feature. - /// The corresponding value for the - /// feature. + + /// The name of the feature. + /// + + /// The corresponding value for the feature. + /// public VirtualMachineImageFeature(string name = default(string), string value = default(string)) + { - Name = name; - Value = value; + this.Name = name; + this.Value = value; CustomInit(); } @@ -44,17 +42,17 @@ public VirtualMachineImageFeature() /// partial void CustomInit(); + /// /// Gets or sets the name of the feature. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the corresponding value for the feature. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineImageProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineImageProperties.cs new file mode 100644 index 000000000000..69622b2beb7f --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineImageProperties.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a Virtual Machine Image. + /// + public partial class VirtualMachineImageProperties + { + /// + /// Initializes a new instance of the VirtualMachineImageProperties class. + /// + public VirtualMachineImageProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineImageProperties class. + /// + + /// Used for establishing the purchase context of any 3rd Party artifact + /// through MarketPlace. + /// + + /// Contains the os disk image information. + /// + + /// The list of data disk images information. + /// + + /// Describes automatic OS upgrade properties on the image. + /// + + /// Specifies the HyperVGeneration Type + /// Possible values include: 'V1', 'V2' + + /// Specifies disallowed configuration for the VirtualMachine created from the + /// image + /// + + /// + /// + + /// Specifies the Architecture Type + /// Possible values include: 'x64', 'Arm64' + + /// Describes image deprecation status properties on the image. + /// + public VirtualMachineImageProperties(PurchasePlan plan = default(PurchasePlan), OSDiskImage osDiskImage = default(OSDiskImage), System.Collections.Generic.IList dataDiskImages = default(System.Collections.Generic.IList), AutomaticOSUpgradeProperties automaticOSUpgradeProperties = default(AutomaticOSUpgradeProperties), string hyperVGeneration = default(string), DisallowedConfiguration disallowed = default(DisallowedConfiguration), System.Collections.Generic.IList features = default(System.Collections.Generic.IList), string architecture = default(string), ImageDeprecationStatus imageDeprecationStatus = default(ImageDeprecationStatus)) + + { + this.Plan = plan; + this.OsDiskImage = osDiskImage; + this.DataDiskImages = dataDiskImages; + this.AutomaticOSUpgradeProperties = automaticOSUpgradeProperties; + this.HyperVGeneration = hyperVGeneration; + this.Disallowed = disallowed; + this.Features = features; + this.Architecture = architecture; + this.ImageDeprecationStatus = imageDeprecationStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets used for establishing the purchase context of any 3rd Party + /// artifact through MarketPlace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "plan")] + public PurchasePlan Plan {get; set; } + + /// + /// Gets or sets contains the os disk image information. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osDiskImage")] + public OSDiskImage OsDiskImage {get; set; } + + /// + /// Gets or sets the list of data disk images information. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDiskImages")] + public System.Collections.Generic.IList DataDiskImages {get; set; } + + /// + /// Gets or sets describes automatic OS upgrade properties on the image. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "automaticOSUpgradeProperties")] + public AutomaticOSUpgradeProperties AutomaticOSUpgradeProperties {get; set; } + + /// + /// Gets or sets specifies the HyperVGeneration Type Possible values include: 'V1', 'V2' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hyperVGeneration")] + public string HyperVGeneration {get; set; } + + /// + /// Gets or sets specifies disallowed configuration for the VirtualMachine + /// created from the image + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disallowed")] + public DisallowedConfiguration Disallowed {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "features")] + public System.Collections.Generic.IList Features {get; set; } + + /// + /// Gets or sets specifies the Architecture Type Possible values include: 'x64', 'Arm64' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "architecture")] + public string Architecture {get; set; } + + /// + /// Gets or sets describes image deprecation status properties on the image. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "imageDeprecationStatus")] + public ImageDeprecationStatus ImageDeprecationStatus {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Plan != null) + { + this.Plan.Validate(); + } + if (this.OsDiskImage != null) + { + this.OsDiskImage.Validate(); + } + + if (this.AutomaticOSUpgradeProperties != null) + { + this.AutomaticOSUpgradeProperties.Validate(); + } + + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineImageResource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineImageResource.cs index f7adc3819051..7bb317e10944 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineImageResource.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineImageResource.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineImageResource : SubResource { /// - /// Initializes a new instance of the VirtualMachineImageResource - /// class. + /// Initializes a new instance of the VirtualMachineImageResource class. /// public VirtualMachineImageResource() { @@ -31,26 +21,33 @@ public VirtualMachineImageResource() } /// - /// Initializes a new instance of the VirtualMachineImageResource - /// class. + /// Initializes a new instance of the VirtualMachineImageResource class. /// - /// The name of the resource. - /// The supported Azure location of the - /// resource. - /// Resource Id - /// Specifies the tags that are assigned to the - /// virtual machine. For more information about using tags, see [Using - /// tags to organize your Azure - /// resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). - /// The extended location of the Virtual - /// Machine. - public VirtualMachineImageResource(string name, string location, string id = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation)) - : base(id) + + /// Resource Id + /// + + /// The name of the resource. + /// + + /// The supported Azure location of the resource. + /// + + /// Specifies the tags that are assigned to the virtual machine. For more + /// information about using tags, see [Using tags to organize your Azure + /// resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + /// + + /// The extended location of the Virtual Machine. + /// + public VirtualMachineImageResource(string name, string location, string id = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation)) + + : base(id) { - Name = name; - Location = location; - Tags = tags; - ExtendedLocation = extendedLocation; + this.Name = name; + this.Location = location; + this.Tags = tags; + this.ExtendedLocation = extendedLocation; CustomInit(); } @@ -59,49 +56,53 @@ public VirtualMachineImageResource() /// partial void CustomInit(); + /// /// Gets or sets the name of the resource. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the supported Azure location of the resource. /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// - /// Gets or sets specifies the tags that are assigned to the virtual - /// machine. For more information about using tags, see [Using tags to - /// organize your Azure + /// Gets or sets specifies the tags that are assigned to the virtual machine. + /// For more information about using tags, see [Using tags to organize your + /// Azure /// resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// /// Gets or sets the extended location of the Virtual Machine. /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (Location == null) + if (this.Location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineInstallPatchesParameters.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineInstallPatchesParameters.cs index a2fea3379579..ea48eb5b586b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineInstallPatchesParameters.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineInstallPatchesParameters.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineInstallPatchesParameters { /// - /// Initializes a new instance of the - /// VirtualMachineInstallPatchesParameters class. + /// Initializes a new instance of the VirtualMachineInstallPatchesParameters class. /// public VirtualMachineInstallPatchesParameters() { @@ -29,25 +21,29 @@ public VirtualMachineInstallPatchesParameters() } /// - /// Initializes a new instance of the - /// VirtualMachineInstallPatchesParameters class. + /// Initializes a new instance of the VirtualMachineInstallPatchesParameters class. /// - /// Defines when it is acceptable to reboot - /// a VM during a software update operation. Possible values include: - /// 'IfRequired', 'Never', 'Always' - /// Specifies the maximum amount of time - /// that the operation will run. It must be an ISO 8601-compliant - /// duration string such as PT4H (4 hours) - /// Input for InstallPatches on a - /// Windows VM, as directly received by the API - /// Input for InstallPatches on a Linux - /// VM, as directly received by the API + + /// Specifies the maximum amount of time that the operation will run. It must + /// be an ISO 8601-compliant duration string such as PT4H (4 hours) + /// + + /// Defines when it is acceptable to reboot a VM during a software update + /// operation. + /// Possible values include: 'IfRequired', 'Never', 'Always' + + /// Input for InstallPatches on a Windows VM, as directly received by the API + /// + + /// Input for InstallPatches on a Linux VM, as directly received by the API + /// public VirtualMachineInstallPatchesParameters(string rebootSetting, System.TimeSpan? maximumDuration = default(System.TimeSpan?), WindowsParameters windowsParameters = default(WindowsParameters), LinuxParameters linuxParameters = default(LinuxParameters)) + { - MaximumDuration = maximumDuration; - RebootSetting = rebootSetting; - WindowsParameters = windowsParameters; - LinuxParameters = linuxParameters; + this.MaximumDuration = maximumDuration; + this.RebootSetting = rebootSetting; + this.WindowsParameters = windowsParameters; + this.LinuxParameters = linuxParameters; CustomInit(); } @@ -56,48 +52,50 @@ public VirtualMachineInstallPatchesParameters() /// partial void CustomInit(); + /// - /// Gets or sets specifies the maximum amount of time that the - /// operation will run. It must be an ISO 8601-compliant duration - /// string such as PT4H (4 hours) + /// Gets or sets specifies the maximum amount of time that the operation will + /// run. It must be an ISO 8601-compliant duration string such as PT4H (4 + /// hours) /// - [JsonProperty(PropertyName = "maximumDuration")] - public System.TimeSpan? MaximumDuration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maximumDuration")] + public System.TimeSpan? MaximumDuration {get; set; } /// - /// Gets or sets defines when it is acceptable to reboot a VM during a - /// software update operation. Possible values include: 'IfRequired', - /// 'Never', 'Always' + /// Gets or sets defines when it is acceptable to reboot a VM during a software + /// update operation. Possible values include: 'IfRequired', 'Never', 'Always' /// - [JsonProperty(PropertyName = "rebootSetting")] - public string RebootSetting { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "rebootSetting")] + public string RebootSetting {get; set; } /// - /// Gets or sets input for InstallPatches on a Windows VM, as directly - /// received by the API + /// Gets or sets input for InstallPatches on a Windows VM, as directly received + /// by the API /// - [JsonProperty(PropertyName = "windowsParameters")] - public WindowsParameters WindowsParameters { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "windowsParameters")] + public WindowsParameters WindowsParameters {get; set; } /// - /// Gets or sets input for InstallPatches on a Linux VM, as directly - /// received by the API + /// Gets or sets input for InstallPatches on a Linux VM, as directly received + /// by the API /// - [JsonProperty(PropertyName = "linuxParameters")] - public LinuxParameters LinuxParameters { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "linuxParameters")] + public LinuxParameters LinuxParameters {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RebootSetting == null) + if (this.RebootSetting == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RebootSetting"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RebootSetting"); } + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineInstallPatchesResult.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineInstallPatchesResult.cs index 53d2c65fe027..343d9f7df540 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineInstallPatchesResult.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineInstallPatchesResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineInstallPatchesResult { /// - /// Initializes a new instance of the - /// VirtualMachineInstallPatchesResult class. + /// Initializes a new instance of the VirtualMachineInstallPatchesResult class. /// public VirtualMachineInstallPatchesResult() { @@ -30,57 +21,71 @@ public VirtualMachineInstallPatchesResult() } /// - /// Initializes a new instance of the - /// VirtualMachineInstallPatchesResult class. + /// Initializes a new instance of the VirtualMachineInstallPatchesResult class. /// - /// The overall success or failure status of the - /// operation. It remains "InProgress" until the operation completes. - /// At that point it will become "Failed", "Succeeded", "Unknown" or - /// "CompletedWithWarnings.". Possible values include: 'Unknown', - /// 'InProgress', 'Failed', 'Succeeded', - /// 'CompletedWithWarnings' - /// The activity ID of the - /// operation that produced this result. It is used to correlate across - /// CRP and extension logs. - /// The reboot state of the VM following - /// completion of the operation. Possible values include: 'Unknown', - /// 'NotNeeded', 'Required', 'Started', 'Failed', 'Completed' - /// Whether the operation ran - /// out of time before it completed all its intended actions. - /// The number of patches that were - /// not installed due to the user blocking their installation. - /// The number of patches that were - /// detected as available for install, but did not meet the operation's - /// criteria. - /// The number of patches that were - /// identified as meeting the installation criteria, but were not able - /// to be installed. Typically this happens when - /// maintenanceWindowExceeded == true. - /// The number of patches - /// successfully installed. - /// The number of patches that could not - /// be installed due to some issue. See errors for details. - /// The patches that were installed during the - /// operation. - /// The UTC timestamp when the operation - /// began. - /// The errors that were encountered during - /// execution of the operation. The details array contains the list of - /// them. - public VirtualMachineInstallPatchesResult(string status = default(string), string installationActivityId = default(string), string rebootStatus = default(string), bool? maintenanceWindowExceeded = default(bool?), int? excludedPatchCount = default(int?), int? notSelectedPatchCount = default(int?), int? pendingPatchCount = default(int?), int? installedPatchCount = default(int?), int? failedPatchCount = default(int?), IList patches = default(IList), System.DateTime? startDateTime = default(System.DateTime?), ApiError error = default(ApiError)) + + /// The overall success or failure status of the operation. It remains + /// "InProgress" until the operation completes. At that point it will become + /// "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings." + /// Possible values include: 'Unknown', 'InProgress', 'Failed', 'Succeeded', + /// 'CompletedWithWarnings' + + /// The activity ID of the operation that produced this result. It is used to + /// correlate across CRP and extension logs. + /// + + /// The reboot state of the VM following completion of the operation. + /// Possible values include: 'Unknown', 'NotNeeded', 'Required', 'Started', + /// 'Failed', 'Completed' + + /// Whether the operation ran out of time before it completed all its intended + /// actions. + /// + + /// The number of patches that were not installed due to the user blocking + /// their installation. + /// + + /// The number of patches that were detected as available for install, but did + /// not meet the operation's criteria. + /// + + /// The number of patches that were identified as meeting the installation + /// criteria, but were not able to be installed. Typically this happens when + /// maintenanceWindowExceeded == true. + /// + + /// The number of patches successfully installed. + /// + + /// The number of patches that could not be installed due to some issue. See + /// errors for details. + /// + + /// The patches that were installed during the operation. + /// + + /// The UTC timestamp when the operation began. + /// + + /// The errors that were encountered during execution of the operation. The + /// details array contains the list of them. + /// + public VirtualMachineInstallPatchesResult(string status = default(string), string installationActivityId = default(string), string rebootStatus = default(string), bool? maintenanceWindowExceeded = default(bool?), int? excludedPatchCount = default(int?), int? notSelectedPatchCount = default(int?), int? pendingPatchCount = default(int?), int? installedPatchCount = default(int?), int? failedPatchCount = default(int?), System.Collections.Generic.IList patches = default(System.Collections.Generic.IList), System.DateTime? startDateTime = default(System.DateTime?), ApiError error = default(ApiError)) + { - Status = status; - InstallationActivityId = installationActivityId; - RebootStatus = rebootStatus; - MaintenanceWindowExceeded = maintenanceWindowExceeded; - ExcludedPatchCount = excludedPatchCount; - NotSelectedPatchCount = notSelectedPatchCount; - PendingPatchCount = pendingPatchCount; - InstalledPatchCount = installedPatchCount; - FailedPatchCount = failedPatchCount; - Patches = patches; - StartDateTime = startDateTime; - Error = error; + this.Status = status; + this.InstallationActivityId = installationActivityId; + this.RebootStatus = rebootStatus; + this.MaintenanceWindowExceeded = maintenanceWindowExceeded; + this.ExcludedPatchCount = excludedPatchCount; + this.NotSelectedPatchCount = notSelectedPatchCount; + this.PendingPatchCount = pendingPatchCount; + this.InstalledPatchCount = installedPatchCount; + this.FailedPatchCount = failedPatchCount; + this.Patches = patches; + this.StartDateTime = startDateTime; + this.Error = error; CustomInit(); } @@ -89,91 +94,87 @@ public VirtualMachineInstallPatchesResult() /// partial void CustomInit(); + /// - /// Gets the overall success or failure status of the operation. It - /// remains "InProgress" until the operation completes. At that point - /// it will become "Failed", "Succeeded", "Unknown" or - /// "CompletedWithWarnings.". Possible values include: 'Unknown', - /// 'InProgress', 'Failed', 'Succeeded', 'CompletedWithWarnings' + /// Gets the overall success or failure status of the operation. It remains + /// "InProgress" until the operation completes. At that point it will become + /// "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings." Possible values include: 'Unknown', 'InProgress', 'Failed', 'Succeeded', 'CompletedWithWarnings' /// - [JsonProperty(PropertyName = "status")] - public string Status { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; private set; } /// - /// Gets the activity ID of the operation that produced this result. It - /// is used to correlate across CRP and extension logs. + /// Gets the activity ID of the operation that produced this result. It is used + /// to correlate across CRP and extension logs. /// - [JsonProperty(PropertyName = "installationActivityId")] - public string InstallationActivityId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "installationActivityId")] + public string InstallationActivityId {get; private set; } /// - /// Gets the reboot state of the VM following completion of the - /// operation. Possible values include: 'Unknown', 'NotNeeded', - /// 'Required', 'Started', 'Failed', 'Completed' + /// Gets the reboot state of the VM following completion of the operation. Possible values include: 'Unknown', 'NotNeeded', 'Required', 'Started', 'Failed', 'Completed' /// - [JsonProperty(PropertyName = "rebootStatus")] - public string RebootStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "rebootStatus")] + public string RebootStatus {get; private set; } /// - /// Gets whether the operation ran out of time before it completed all - /// its intended actions. + /// Gets whether the operation ran out of time before it completed all its + /// intended actions. /// - [JsonProperty(PropertyName = "maintenanceWindowExceeded")] - public bool? MaintenanceWindowExceeded { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maintenanceWindowExceeded")] + public bool? MaintenanceWindowExceeded {get; private set; } /// - /// Gets the number of patches that were not installed due to the user - /// blocking their installation. + /// Gets the number of patches that were not installed due to the user blocking + /// their installation. /// - [JsonProperty(PropertyName = "excludedPatchCount")] - public int? ExcludedPatchCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "excludedPatchCount")] + public int? ExcludedPatchCount {get; private set; } /// - /// Gets the number of patches that were detected as available for - /// install, but did not meet the operation's criteria. + /// Gets the number of patches that were detected as available for install, but + /// did not meet the operation's criteria. /// - [JsonProperty(PropertyName = "notSelectedPatchCount")] - public int? NotSelectedPatchCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "notSelectedPatchCount")] + public int? NotSelectedPatchCount {get; private set; } /// - /// Gets the number of patches that were identified as meeting the - /// installation criteria, but were not able to be installed. Typically - /// this happens when maintenanceWindowExceeded == true. + /// Gets the number of patches that were identified as meeting the installation + /// criteria, but were not able to be installed. Typically this happens when + /// maintenanceWindowExceeded == true. /// - [JsonProperty(PropertyName = "pendingPatchCount")] - public int? PendingPatchCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "pendingPatchCount")] + public int? PendingPatchCount {get; private set; } /// /// Gets the number of patches successfully installed. /// - [JsonProperty(PropertyName = "installedPatchCount")] - public int? InstalledPatchCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "installedPatchCount")] + public int? InstalledPatchCount {get; private set; } /// - /// Gets the number of patches that could not be installed due to some - /// issue. See errors for details. + /// Gets the number of patches that could not be installed due to some issue. + /// See errors for details. /// - [JsonProperty(PropertyName = "failedPatchCount")] - public int? FailedPatchCount { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "failedPatchCount")] + public int? FailedPatchCount {get; private set; } /// /// Gets the patches that were installed during the operation. /// - [JsonProperty(PropertyName = "patches")] - public IList Patches { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "patches")] + public System.Collections.Generic.IList Patches {get; private set; } /// /// Gets the UTC timestamp when the operation began. /// - [JsonProperty(PropertyName = "startDateTime")] - public System.DateTime? StartDateTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startDateTime")] + public System.DateTime? StartDateTime {get; private set; } /// - /// Gets the errors that were encountered during execution of the - /// operation. The details array contains the list of them. + /// Gets the errors that were encountered during execution of the operation. + /// The details array contains the list of them. /// - [JsonProperty(PropertyName = "error")] - public ApiError Error { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ApiError Error {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineInstanceView.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineInstanceView.cs index 55d6139ca22b..faf930f56d44 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineInstanceView.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineInstanceView.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,62 +23,84 @@ public VirtualMachineInstanceView() /// /// Initializes a new instance of the VirtualMachineInstanceView class. /// - /// Specifies the update domain of - /// the virtual machine. - /// Specifies the fault domain of the - /// virtual machine. - /// The computer name assigned to the - /// virtual machine. - /// The Operating System running on the virtual - /// machine. - /// The version of Operating System running on - /// the virtual machine. - /// Specifies the HyperVGeneration Type - /// associated with a resource. Possible values include: 'V1', - /// 'V2' - /// The Remote desktop certificate - /// thumbprint. - /// The VM Agent running on the virtual - /// machine. - /// The Maintenance Operation - /// status on the virtual machine. - /// The virtual machine disk information. - /// The extensions information. - /// The health status for the VM. - /// Boot Diagnostics is a debugging - /// feature which allows you to view Console Output and Screenshot to - /// diagnose VM status. You can easily view the output of your console - /// log. Azure also enables you to see a screenshot of the VM from the - /// hypervisor. - /// 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. Minimum api-version: - /// 2020-06-01. - /// The resource status information. - /// [Preview Feature] The status of virtual - /// machine patch operations. - /// [Preview Feature] Specifies whether - /// the VM is currently in or out of the Standby Pool. - public VirtualMachineInstanceView(int? platformUpdateDomain = default(int?), int? platformFaultDomain = default(int?), string computerName = default(string), string osName = default(string), string osVersion = default(string), string hyperVGeneration = default(string), string rdpThumbPrint = default(string), VirtualMachineAgentInstanceView vmAgent = default(VirtualMachineAgentInstanceView), MaintenanceRedeployStatus maintenanceRedeployStatus = default(MaintenanceRedeployStatus), IList disks = default(IList), IList extensions = default(IList), VirtualMachineHealthStatus vmHealth = default(VirtualMachineHealthStatus), BootDiagnosticsInstanceView bootDiagnostics = default(BootDiagnosticsInstanceView), string assignedHost = default(string), IList statuses = default(IList), VirtualMachinePatchStatus patchStatus = default(VirtualMachinePatchStatus), bool? isVMInStandbyPool = default(bool?)) + + /// Specifies the update domain of the virtual machine. + /// + + /// Specifies the fault domain of the virtual machine. + /// + + /// The computer name assigned to the virtual machine. + /// + + /// The Operating System running on the virtual machine. + /// + + /// The version of Operating System running on the virtual machine. + /// + + /// Specifies the HyperVGeneration Type associated with a resource + /// Possible values include: 'V1', 'V2' + + /// The Remote desktop certificate thumbprint. + /// + + /// The VM Agent running on the virtual machine. + /// + + /// The Maintenance Operation status on the virtual machine. + /// + + /// The virtual machine disk information. + /// + + /// The extensions information. + /// + + /// The health status for the VM. + /// + + /// Boot Diagnostics is a debugging feature which allows you to view Console + /// Output and Screenshot to diagnose VM status. You can easily view the output + /// of your console log. Azure also enables you to see a screenshot of the VM + /// from the hypervisor. + /// + + /// 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. Minimum api-version: 2020-06-01. + /// + + /// The resource status information. + /// + + /// [Preview Feature] The status of virtual machine patch operations. + /// + + /// [Preview Feature] Specifies whether the VM is currently in or out of the + /// Standby Pool. + /// + public VirtualMachineInstanceView(int? platformUpdateDomain = default(int?), int? platformFaultDomain = default(int?), string computerName = default(string), string osName = default(string), string osVersion = default(string), string hyperVGeneration = default(string), string rdpThumbPrint = default(string), VirtualMachineAgentInstanceView vmAgent = default(VirtualMachineAgentInstanceView), MaintenanceRedeployStatus maintenanceRedeployStatus = default(MaintenanceRedeployStatus), System.Collections.Generic.IList disks = default(System.Collections.Generic.IList), System.Collections.Generic.IList extensions = default(System.Collections.Generic.IList), VirtualMachineHealthStatus vmHealth = default(VirtualMachineHealthStatus), BootDiagnosticsInstanceView bootDiagnostics = default(BootDiagnosticsInstanceView), string assignedHost = default(string), System.Collections.Generic.IList statuses = default(System.Collections.Generic.IList), VirtualMachinePatchStatus patchStatus = default(VirtualMachinePatchStatus), bool? isVMInStandbyPool = default(bool?)) + { - 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; - IsVMInStandbyPool = isVMInStandbyPool; + this.PlatformUpdateDomain = platformUpdateDomain; + this.PlatformFaultDomain = platformFaultDomain; + this.ComputerName = computerName; + this.OsName = osName; + this.OsVersion = osVersion; + this.HyperVGeneration = hyperVGeneration; + this.RdpThumbPrint = rdpThumbPrint; + this.VmAgent = vmAgent; + this.MaintenanceRedeployStatus = maintenanceRedeployStatus; + this.Disks = disks; + this.Extensions = extensions; + this.VmHealth = vmHealth; + this.BootDiagnostics = bootDiagnostics; + this.AssignedHost = assignedHost; + this.Statuses = statuses; + this.PatchStatus = patchStatus; + this.IsVMInStandbyPool = isVMInStandbyPool; CustomInit(); } @@ -95,118 +109,116 @@ public VirtualMachineInstanceView() /// partial void CustomInit(); + /// /// Gets or sets specifies the update domain of the virtual machine. /// - [JsonProperty(PropertyName = "platformUpdateDomain")] - public int? PlatformUpdateDomain { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "platformUpdateDomain")] + public int? PlatformUpdateDomain {get; set; } /// /// Gets or sets specifies the fault domain of the virtual machine. /// - [JsonProperty(PropertyName = "platformFaultDomain")] - public int? PlatformFaultDomain { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "platformFaultDomain")] + public int? PlatformFaultDomain {get; set; } /// /// Gets or sets the computer name assigned to the virtual machine. /// - [JsonProperty(PropertyName = "computerName")] - public string ComputerName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "computerName")] + public string ComputerName {get; set; } /// /// Gets or sets the Operating System running on the virtual machine. /// - [JsonProperty(PropertyName = "osName")] - public string OsName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osName")] + public string OsName {get; set; } /// /// Gets or sets the version of Operating System running on the virtual /// machine. /// - [JsonProperty(PropertyName = "osVersion")] - public string OsVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osVersion")] + public string OsVersion {get; set; } /// - /// Gets or sets specifies the HyperVGeneration Type associated with a - /// resource. Possible values include: 'V1', 'V2' + /// Gets or sets specifies the HyperVGeneration Type associated with a resource Possible values include: 'V1', 'V2' /// - [JsonProperty(PropertyName = "hyperVGeneration")] - public string HyperVGeneration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "hyperVGeneration")] + public string HyperVGeneration {get; set; } /// /// Gets or sets the Remote desktop certificate thumbprint. /// - [JsonProperty(PropertyName = "rdpThumbPrint")] - public string RdpThumbPrint { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "rdpThumbPrint")] + public string RdpThumbPrint {get; set; } /// /// Gets or sets the VM Agent running on the virtual machine. /// - [JsonProperty(PropertyName = "vmAgent")] - public VirtualMachineAgentInstanceView VmAgent { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vmAgent")] + public VirtualMachineAgentInstanceView VmAgent {get; set; } /// - /// Gets or sets the Maintenance Operation status on the virtual - /// machine. + /// Gets or sets the Maintenance Operation status on the virtual machine. /// - [JsonProperty(PropertyName = "maintenanceRedeployStatus")] - public MaintenanceRedeployStatus MaintenanceRedeployStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maintenanceRedeployStatus")] + public MaintenanceRedeployStatus MaintenanceRedeployStatus {get; set; } /// /// Gets or sets the virtual machine disk information. /// - [JsonProperty(PropertyName = "disks")] - public IList Disks { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "disks")] + public System.Collections.Generic.IList Disks {get; set; } /// /// Gets or sets the extensions information. /// - [JsonProperty(PropertyName = "extensions")] - public IList Extensions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extensions")] + public System.Collections.Generic.IList Extensions {get; set; } /// /// Gets the health status for the VM. /// - [JsonProperty(PropertyName = "vmHealth")] - public VirtualMachineHealthStatus VmHealth { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vmHealth")] + public VirtualMachineHealthStatus VmHealth {get; private set; } /// - /// Gets or sets boot Diagnostics is a debugging feature which allows - /// you to view Console Output and Screenshot to diagnose VM status. - /// You can easily view the output of your console log. Azure also - /// enables you to see a screenshot of the VM from the hypervisor. + /// Gets or sets boot Diagnostics is a debugging feature which allows you to + /// view Console Output and Screenshot to diagnose VM status. You can easily + /// view the output of your console log. Azure also enables you to see a + /// screenshot of the VM from the hypervisor. /// - [JsonProperty(PropertyName = "bootDiagnostics")] - public BootDiagnosticsInstanceView BootDiagnostics { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "bootDiagnostics")] + public BootDiagnosticsInstanceView BootDiagnostics {get; set; } /// - /// Gets 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. Minimum api-version: 2020-06-01. + /// Gets 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. Minimum api-version: 2020-06-01. /// - [JsonProperty(PropertyName = "assignedHost")] - public string AssignedHost { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "assignedHost")] + public string AssignedHost {get; private set; } /// /// Gets or sets the resource status information. /// - [JsonProperty(PropertyName = "statuses")] - public IList Statuses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "statuses")] + public System.Collections.Generic.IList Statuses {get; set; } /// /// Gets or sets [Preview Feature] The status of virtual machine patch /// operations. /// - [JsonProperty(PropertyName = "patchStatus")] - public VirtualMachinePatchStatus PatchStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "patchStatus")] + public VirtualMachinePatchStatus PatchStatus {get; set; } /// - /// Gets [Preview Feature] Specifies whether the VM is currently in or - /// out of the Standby Pool. + /// Gets [Preview Feature] Specifies whether the VM is currently in or out of + /// the Standby Pool. /// - [JsonProperty(PropertyName = "isVMInStandbyPool")] - public bool? IsVMInStandbyPool { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "isVMInStandbyPool")] + public bool? IsVMInStandbyPool {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineIpTag.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineIpTag.cs index 35ef67f4e918..c708c21ab442 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineIpTag.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineIpTag.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public VirtualMachineIpTag() /// /// Initializes a new instance of the VirtualMachineIpTag class. /// - /// IP tag type. Example: - /// FirstPartyUsage. - /// IP tag associated with the public IP. Example: - /// SQL, Storage etc. + + /// IP tag type. Example: FirstPartyUsage. + /// + + /// IP tag associated with the public IP. Example: SQL, Storage etc. + /// public VirtualMachineIpTag(string ipTagType = default(string), string tag = default(string)) + { - IpTagType = ipTagType; - Tag = tag; + this.IpTagType = ipTagType; + this.Tag = tag; CustomInit(); } @@ -45,18 +42,18 @@ public VirtualMachineIpTag() /// partial void CustomInit(); + /// - /// Gets or sets IP tag type. Example: FirstPartyUsage. + /// Gets or sets iP tag type. Example: FirstPartyUsage. /// - [JsonProperty(PropertyName = "ipTagType")] - public string IpTagType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ipTagType")] + public string IpTagType {get; set; } /// - /// Gets or sets IP tag associated with the public IP. Example: SQL, - /// Storage etc. + /// Gets or sets iP tag associated with the public IP. Example: SQL, Storage + /// etc. /// - [JsonProperty(PropertyName = "tag")] - public string Tag { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tag")] + public string Tag {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceConfiguration.cs index d2b62f1928cf..806cee45a96b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceConfiguration.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Describes a virtual machine network interface configurations. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachineNetworkInterfaceConfiguration { /// - /// Initializes a new instance of the - /// VirtualMachineNetworkInterfaceConfiguration class. + /// Initializes a new instance of the VirtualMachineNetworkInterfaceConfiguration class. /// public VirtualMachineNetworkInterfaceConfiguration() { @@ -33,54 +22,71 @@ public VirtualMachineNetworkInterfaceConfiguration() } /// - /// Initializes a new instance of the - /// VirtualMachineNetworkInterfaceConfiguration class. - /// - /// The network interface configuration - /// name. - /// Specifies the IP configurations of - /// the network interface. - /// Specifies the primary network interface in - /// case the virtual machine has more than 1 network interface. - /// Specify what happens to the network - /// interface when the VM is deleted. Possible values include: - /// 'Delete', 'Detach' - /// Specifies whether the - /// network interface is accelerated networking-enabled. - /// Specifies whether the network - /// interface is disabled for tcp state tracking. - /// Specifies whether the network interface is - /// FPGA networking-enabled. - /// Whether IP forwarding enabled on - /// this NIC. - /// The network security - /// group. - /// The dns settings to be applied on the - /// network interfaces. - /// Specifies whether the Auxiliary mode is - /// enabled for the Network Interface resource. Possible values - /// include: 'None', 'AcceleratedConnections', 'Floating' - /// Specifies whether the Auxiliary sku is - /// enabled for the Network Interface resource. Possible values - /// include: 'None', 'A1', 'A2', 'A4', 'A8' - /// Resource tags applied to the networkInterface - /// address created by this NetworkInterfaceConfiguration - public VirtualMachineNetworkInterfaceConfiguration(string name, IList ipConfigurations, bool? primary = default(bool?), string deleteOption = default(string), bool? enableAcceleratedNetworking = default(bool?), bool? disableTcpStateTracking = default(bool?), bool? enableFpga = default(bool?), bool? enableIPForwarding = default(bool?), SubResource networkSecurityGroup = default(SubResource), VirtualMachineNetworkInterfaceDnsSettingsConfiguration dnsSettings = default(VirtualMachineNetworkInterfaceDnsSettingsConfiguration), SubResource dscpConfiguration = default(SubResource), string auxiliaryMode = default(string), string auxiliarySku = default(string), IDictionary tags = default(IDictionary)) + /// Initializes a new instance of the VirtualMachineNetworkInterfaceConfiguration class. + /// + + /// The network interface configuration name. + /// + + /// Resource tags applied to the networkInterface address created by this + /// NetworkInterfaceConfiguration + /// + + /// Specifies the primary network interface in case the virtual machine has + /// more than 1 network interface. + /// + + /// Specify what happens to the network interface when the VM is deleted + /// Possible values include: 'Delete', 'Detach' + + /// Specifies whether the network interface is accelerated networking-enabled. + /// + + /// Specifies whether the network interface is disabled for tcp state tracking. + /// + + /// Specifies whether the network interface is FPGA networking-enabled. + /// + + /// Whether IP forwarding enabled on this NIC. + /// + + /// The network security group. + /// + + /// The dns settings to be applied on the network interfaces. + /// + + /// Specifies the IP configurations of the network interface. + /// + + /// + /// + + /// Specifies whether the Auxiliary mode is enabled for the Network Interface + /// resource. + /// Possible values include: 'None', 'AcceleratedConnections', 'Floating' + + /// Specifies whether the Auxiliary sku is enabled for the Network Interface + /// resource. + /// Possible values include: 'None', 'A1', 'A2', 'A4', 'A8' + public VirtualMachineNetworkInterfaceConfiguration(string name, System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), bool? primary = default(bool?), string deleteOption = default(string), bool? enableAcceleratedNetworking = default(bool?), bool? disableTcpStateTracking = default(bool?), bool? enableFpga = default(bool?), bool? enableIPForwarding = default(bool?), SubResource networkSecurityGroup = default(SubResource), VirtualMachineNetworkInterfaceDnsSettingsConfiguration dnsSettings = default(VirtualMachineNetworkInterfaceDnsSettingsConfiguration), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), SubResource dscpConfiguration = default(SubResource), string auxiliaryMode = default(string), string auxiliarySku = default(string)) + { - Name = name; - Primary = primary; - DeleteOption = deleteOption; - EnableAcceleratedNetworking = enableAcceleratedNetworking; - DisableTcpStateTracking = disableTcpStateTracking; - EnableFpga = enableFpga; - EnableIPForwarding = enableIPForwarding; - NetworkSecurityGroup = networkSecurityGroup; - DnsSettings = dnsSettings; - IpConfigurations = ipConfigurations; - DscpConfiguration = dscpConfiguration; - AuxiliaryMode = auxiliaryMode; - AuxiliarySku = auxiliarySku; - Tags = tags; + this.Name = name; + this.Tags = tags; + this.Primary = primary; + this.DeleteOption = deleteOption; + this.EnableAcceleratedNetworking = enableAcceleratedNetworking; + this.DisableTcpStateTracking = disableTcpStateTracking; + this.EnableFpga = enableFpga; + this.EnableIPForwarding = enableIPForwarding; + this.NetworkSecurityGroup = networkSecurityGroup; + this.DnsSettings = dnsSettings; + this.IpConfigurations = ipConfigurations; + this.DscpConfiguration = dscpConfiguration; + this.AuxiliaryMode = auxiliaryMode; + this.AuxiliarySku = auxiliarySku; CustomInit(); } @@ -89,120 +95,118 @@ public VirtualMachineNetworkInterfaceConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the network interface configuration name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets specifies the primary network interface in case the - /// virtual machine has more than 1 network interface. + /// Gets or sets resource tags applied to the networkInterface address created + /// by this NetworkInterfaceConfiguration /// - [JsonProperty(PropertyName = "properties.primary")] - public bool? Primary { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets or sets specify what happens to the network interface when the - /// VM is deleted. Possible values include: 'Delete', 'Detach' + /// Gets or sets specifies the primary network interface in case the virtual + /// machine has more than 1 network interface. /// - [JsonProperty(PropertyName = "properties.deleteOption")] - public string DeleteOption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primary")] + public bool? Primary {get; set; } + + /// + /// Gets or sets specify what happens to the network interface when the VM is + /// deleted Possible values include: 'Delete', 'Detach' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deleteOption")] + public string DeleteOption {get; set; } /// /// Gets or sets specifies whether the network interface is accelerated /// networking-enabled. /// - [JsonProperty(PropertyName = "properties.enableAcceleratedNetworking")] - public bool? EnableAcceleratedNetworking { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableAcceleratedNetworking")] + public bool? EnableAcceleratedNetworking {get; set; } /// - /// Gets or sets specifies whether the network interface is disabled - /// for tcp state tracking. + /// Gets or sets specifies whether the network interface is disabled for tcp + /// state tracking. /// - [JsonProperty(PropertyName = "properties.disableTcpStateTracking")] - public bool? DisableTcpStateTracking { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disableTcpStateTracking")] + public bool? DisableTcpStateTracking {get; set; } /// /// Gets or sets specifies whether the network interface is FPGA /// networking-enabled. /// - [JsonProperty(PropertyName = "properties.enableFpga")] - public bool? EnableFpga { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableFpga")] + public bool? EnableFpga {get; set; } /// /// Gets or sets whether IP forwarding enabled on this NIC. /// - [JsonProperty(PropertyName = "properties.enableIPForwarding")] - public bool? EnableIPForwarding { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableIPForwarding")] + public bool? EnableIPForwarding {get; set; } /// /// Gets or sets the network security group. /// - [JsonProperty(PropertyName = "properties.networkSecurityGroup")] - public SubResource NetworkSecurityGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkSecurityGroup")] + public SubResource NetworkSecurityGroup {get; set; } /// - /// Gets or sets the dns settings to be applied on the network - /// interfaces. + /// Gets or sets the dns settings to be applied on the network interfaces. /// - [JsonProperty(PropertyName = "properties.dnsSettings")] - public VirtualMachineNetworkInterfaceDnsSettingsConfiguration DnsSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dnsSettings")] + public VirtualMachineNetworkInterfaceDnsSettingsConfiguration DnsSettings {get; set; } /// - /// Gets or sets specifies the IP configurations of the network - /// interface. + /// Gets or sets specifies the IP configurations of the network interface. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IpConfigurations {get; set; } /// + /// Gets or sets /// - [JsonProperty(PropertyName = "properties.dscpConfiguration")] - public SubResource DscpConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dscpConfiguration")] + public SubResource DscpConfiguration {get; set; } /// - /// Gets or sets specifies whether the Auxiliary mode is enabled for - /// the Network Interface resource. Possible values include: 'None', - /// 'AcceleratedConnections', 'Floating' + /// Gets or sets specifies whether the Auxiliary mode is enabled for the + /// Network Interface resource. Possible values include: 'None', 'AcceleratedConnections', 'Floating' /// - [JsonProperty(PropertyName = "properties.auxiliaryMode")] - public string AuxiliaryMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.auxiliaryMode")] + public string AuxiliaryMode {get; set; } /// - /// Gets or sets specifies whether the Auxiliary sku is enabled for the - /// Network Interface resource. Possible values include: 'None', 'A1', - /// 'A2', 'A4', 'A8' + /// Gets or sets specifies whether the Auxiliary sku is enabled for the Network + /// Interface resource. Possible values include: 'None', 'A1', 'A2', 'A4', 'A8' /// - [JsonProperty(PropertyName = "properties.auxiliarySku")] - public string AuxiliarySku { get; set; } - - /// - /// Gets or sets resource tags applied to the networkInterface address - /// created by this NetworkInterfaceConfiguration - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.auxiliarySku")] + public string AuxiliarySku {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (IpConfigurations == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "IpConfigurations"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (IpConfigurations != null) + + + + + + if (this.IpConfigurations != null) { - foreach (var element in IpConfigurations) + foreach (var element in this.IpConfigurations) { if (element != null) { @@ -210,6 +214,9 @@ public virtual void Validate() } } } + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceConfigurationProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceConfigurationProperties.cs new file mode 100644 index 000000000000..0c589250cf1f --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceConfigurationProperties.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes a virtual machine network profile's IP configuration. + /// + public partial class VirtualMachineNetworkInterfaceConfigurationProperties + { + /// + /// Initializes a new instance of the VirtualMachineNetworkInterfaceConfigurationProperties class. + /// + public VirtualMachineNetworkInterfaceConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineNetworkInterfaceConfigurationProperties class. + /// + + /// Specifies the primary network interface in case the virtual machine has + /// more than 1 network interface. + /// + + /// Specify what happens to the network interface when the VM is deleted + /// Possible values include: 'Delete', 'Detach' + + /// Specifies whether the network interface is accelerated networking-enabled. + /// + + /// Specifies whether the network interface is disabled for tcp state tracking. + /// + + /// Specifies whether the network interface is FPGA networking-enabled. + /// + + /// Whether IP forwarding enabled on this NIC. + /// + + /// The network security group. + /// + + /// The dns settings to be applied on the network interfaces. + /// + + /// Specifies the IP configurations of the network interface. + /// + + /// + /// + + /// Specifies whether the Auxiliary mode is enabled for the Network Interface + /// resource. + /// Possible values include: 'None', 'AcceleratedConnections', 'Floating' + + /// Specifies whether the Auxiliary sku is enabled for the Network Interface + /// resource. + /// Possible values include: 'None', 'A1', 'A2', 'A4', 'A8' + public VirtualMachineNetworkInterfaceConfigurationProperties(System.Collections.Generic.IList ipConfigurations, bool? primary = default(bool?), string deleteOption = default(string), bool? enableAcceleratedNetworking = default(bool?), bool? disableTcpStateTracking = default(bool?), bool? enableFpga = default(bool?), bool? enableIPForwarding = default(bool?), SubResource networkSecurityGroup = default(SubResource), VirtualMachineNetworkInterfaceDnsSettingsConfiguration dnsSettings = default(VirtualMachineNetworkInterfaceDnsSettingsConfiguration), SubResource dscpConfiguration = default(SubResource), string auxiliaryMode = default(string), string auxiliarySku = default(string)) + + { + this.Primary = primary; + this.DeleteOption = deleteOption; + this.EnableAcceleratedNetworking = enableAcceleratedNetworking; + this.DisableTcpStateTracking = disableTcpStateTracking; + this.EnableFpga = enableFpga; + this.EnableIPForwarding = enableIPForwarding; + this.NetworkSecurityGroup = networkSecurityGroup; + this.DnsSettings = dnsSettings; + this.IpConfigurations = ipConfigurations; + this.DscpConfiguration = dscpConfiguration; + this.AuxiliaryMode = auxiliaryMode; + this.AuxiliarySku = auxiliarySku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets specifies the primary network interface in case the virtual + /// machine has more than 1 network interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primary")] + public bool? Primary {get; set; } + + /// + /// Gets or sets specify what happens to the network interface when the VM is + /// deleted Possible values include: 'Delete', 'Detach' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "deleteOption")] + public string DeleteOption {get; set; } + + /// + /// Gets or sets specifies whether the network interface is accelerated + /// networking-enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableAcceleratedNetworking")] + public bool? EnableAcceleratedNetworking {get; set; } + + /// + /// Gets or sets specifies whether the network interface is disabled for tcp + /// state tracking. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disableTcpStateTracking")] + public bool? DisableTcpStateTracking {get; set; } + + /// + /// Gets or sets specifies whether the network interface is FPGA + /// networking-enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableFpga")] + public bool? EnableFpga {get; set; } + + /// + /// Gets or sets whether IP forwarding enabled on this NIC. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableIPForwarding")] + public bool? EnableIPForwarding {get; set; } + + /// + /// Gets or sets the network security group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkSecurityGroup")] + public SubResource NetworkSecurityGroup {get; set; } + + /// + /// Gets or sets the dns settings to be applied on the network interfaces. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsSettings")] + public VirtualMachineNetworkInterfaceDnsSettingsConfiguration DnsSettings {get; set; } + + /// + /// Gets or sets specifies the IP configurations of the network interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurations")] + public System.Collections.Generic.IList IpConfigurations {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dscpConfiguration")] + public SubResource DscpConfiguration {get; set; } + + /// + /// Gets or sets specifies whether the Auxiliary mode is enabled for the + /// Network Interface resource. Possible values include: 'None', 'AcceleratedConnections', 'Floating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "auxiliaryMode")] + public string AuxiliaryMode {get; set; } + + /// + /// Gets or sets specifies whether the Auxiliary sku is enabled for the Network + /// Interface resource. Possible values include: 'None', 'A1', 'A2', 'A4', 'A8' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "auxiliarySku")] + public string AuxiliarySku {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.IpConfigurations == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "IpConfigurations"); + } + + + + if (this.IpConfigurations != null) + { + foreach (var element in this.IpConfigurations) + { + if (element != null) + { + element.Validate(); + } + } + } + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.cs index 452f8771a091..bf9a885e4d8b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.cs @@ -1,28 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Describes a virtual machines network configuration's DNS settings. + /// Describes a virtual machines network configuration's DNS settings. /// public partial class VirtualMachineNetworkInterfaceDnsSettingsConfiguration { /// - /// Initializes a new instance of the - /// VirtualMachineNetworkInterfaceDnsSettingsConfiguration class. + /// Initializes a new instance of the VirtualMachineNetworkInterfaceDnsSettingsConfiguration class. /// public VirtualMachineNetworkInterfaceDnsSettingsConfiguration() { @@ -30,13 +21,15 @@ public VirtualMachineNetworkInterfaceDnsSettingsConfiguration() } /// - /// Initializes a new instance of the - /// VirtualMachineNetworkInterfaceDnsSettingsConfiguration class. + /// Initializes a new instance of the VirtualMachineNetworkInterfaceDnsSettingsConfiguration class. /// - /// List of DNS servers IP addresses - public VirtualMachineNetworkInterfaceDnsSettingsConfiguration(IList dnsServers = default(IList)) + + /// List of DNS servers IP addresses + /// + public VirtualMachineNetworkInterfaceDnsSettingsConfiguration(System.Collections.Generic.IList dnsServers = default(System.Collections.Generic.IList)) + { - DnsServers = dnsServers; + this.DnsServers = dnsServers; CustomInit(); } @@ -45,11 +38,11 @@ public VirtualMachineNetworkInterfaceDnsSettingsConfiguration() /// partial void CustomInit(); + /// /// Gets or sets list of DNS servers IP addresses /// - [JsonProperty(PropertyName = "dnsServers")] - public IList DnsServers { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsServers")] + public System.Collections.Generic.IList DnsServers {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceIPConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceIPConfiguration.cs index 9ec3dac67959..5f0eb45b1860 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceIPConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceIPConfiguration.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Describes a virtual machine network profile's IP configuration. + /// Describes a virtual machine network profile's IP configuration. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachineNetworkInterfaceIPConfiguration { /// - /// Initializes a new instance of the - /// VirtualMachineNetworkInterfaceIPConfiguration class. + /// Initializes a new instance of the VirtualMachineNetworkInterfaceIPConfiguration class. /// public VirtualMachineNetworkInterfaceIPConfiguration() { @@ -33,43 +22,52 @@ public VirtualMachineNetworkInterfaceIPConfiguration() } /// - /// Initializes a new instance of the - /// VirtualMachineNetworkInterfaceIPConfiguration class. + /// Initializes a new instance of the VirtualMachineNetworkInterfaceIPConfiguration class. /// - /// The IP configuration name. - /// Specifies the identifier of the - /// subnet. - /// Specifies the primary network interface in - /// case the virtual machine has more than 1 network interface. - /// The - /// publicIPAddressConfiguration. - /// Available from Api-Version - /// 2017-03-30 onwards, it represents whether the specific - /// ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - /// Possible values are: 'IPv4' and 'IPv6'. Possible values include: - /// 'IPv4', 'IPv6' - /// Specifies an array of - /// references to application security group. - /// Specifies an - /// array of references to backend address pools of application - /// gateways. A virtual machine can reference backend address pools of - /// multiple application gateways. Multiple virtual machines cannot use - /// the same application gateway. - /// Specifies an array of - /// references to backend address pools of load balancers. A virtual - /// machine can reference backend address pools of one public and one - /// internal load balancer. [Multiple virtual machines cannot use the - /// same basic sku load balancer]. - public VirtualMachineNetworkInterfaceIPConfiguration(string name, SubResource subnet = default(SubResource), bool? primary = default(bool?), VirtualMachinePublicIPAddressConfiguration publicIPAddressConfiguration = default(VirtualMachinePublicIPAddressConfiguration), string privateIPAddressVersion = default(string), IList applicationSecurityGroups = default(IList), IList applicationGatewayBackendAddressPools = default(IList), IList loadBalancerBackendAddressPools = default(IList)) + + /// The IP configuration name. + /// + + /// Specifies the identifier of the subnet. + /// + + /// Specifies the primary network interface in case the virtual machine has + /// more than 1 network interface. + /// + + /// The publicIPAddressConfiguration. + /// + + /// Available from Api-Version 2017-03-30 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + /// Possible values are: 'IPv4' and 'IPv6'. + /// Possible values include: 'IPv4', 'IPv6' + + /// Specifies an array of references to application security group. + /// + + /// Specifies an array of references to backend address pools of application + /// gateways. A virtual machine can reference backend address pools of multiple + /// application gateways. Multiple virtual machines cannot use the same + /// application gateway. + /// + + /// Specifies an array of references to backend address pools of load + /// balancers. A virtual machine can reference backend address pools of one + /// public and one internal load balancer. [Multiple virtual machines cannot + /// use the same basic sku load balancer]. + /// + public VirtualMachineNetworkInterfaceIPConfiguration(string name, SubResource subnet = default(SubResource), bool? primary = default(bool?), VirtualMachinePublicIPAddressConfiguration publicIPAddressConfiguration = default(VirtualMachinePublicIPAddressConfiguration), string privateIPAddressVersion = default(string), System.Collections.Generic.IList applicationSecurityGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationGatewayBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerBackendAddressPools = default(System.Collections.Generic.IList)) + { - Name = name; - Subnet = subnet; - Primary = primary; - PublicIPAddressConfiguration = publicIPAddressConfiguration; - PrivateIPAddressVersion = privateIPAddressVersion; - ApplicationSecurityGroups = applicationSecurityGroups; - ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; - LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + this.Name = name; + this.Subnet = subnet; + this.Primary = primary; + this.PublicIPAddressConfiguration = publicIPAddressConfiguration; + this.PrivateIPAddressVersion = privateIPAddressVersion; + this.ApplicationSecurityGroups = applicationSecurityGroups; + this.ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + this.LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; CustomInit(); } @@ -78,82 +76,86 @@ public VirtualMachineNetworkInterfaceIPConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the IP configuration name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets specifies the identifier of the subnet. /// - [JsonProperty(PropertyName = "properties.subnet")] - public SubResource Subnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public SubResource Subnet {get; set; } /// - /// Gets or sets specifies the primary network interface in case the - /// virtual machine has more than 1 network interface. + /// Gets or sets specifies the primary network interface in case the virtual + /// machine has more than 1 network interface. /// - [JsonProperty(PropertyName = "properties.primary")] - public bool? Primary { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primary")] + public bool? Primary {get; set; } /// /// Gets or sets the publicIPAddressConfiguration. /// - [JsonProperty(PropertyName = "properties.publicIPAddressConfiguration")] - public VirtualMachinePublicIPAddressConfiguration PublicIPAddressConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddressConfiguration")] + public VirtualMachinePublicIPAddressConfiguration PublicIPAddressConfiguration {get; set; } /// - /// Gets or sets available from Api-Version 2017-03-30 onwards, it - /// represents whether the specific ipconfiguration is IPv4 or IPv6. - /// Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - /// Possible values include: 'IPv4', 'IPv6' + /// Gets or sets available from Api-Version 2017-03-30 onwards, it represents + /// whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as + /// IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' /// - [JsonProperty(PropertyName = "properties.privateIPAddressVersion")] - public string PrivateIPAddressVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddressVersion")] + public string PrivateIPAddressVersion {get; set; } /// - /// Gets or sets specifies an array of references to application - /// security group. + /// Gets or sets specifies an array of references to application security + /// group. /// - [JsonProperty(PropertyName = "properties.applicationSecurityGroups")] - public IList ApplicationSecurityGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicationSecurityGroups")] + public System.Collections.Generic.IList ApplicationSecurityGroups {get; set; } /// - /// Gets or sets specifies an array of references to backend address - /// pools of application gateways. A virtual machine can reference - /// backend address pools of multiple application gateways. Multiple - /// virtual machines cannot use the same application gateway. + /// Gets or sets specifies an array of references to backend address pools of + /// application gateways. A virtual machine can reference backend address pools + /// of multiple application gateways. Multiple virtual machines cannot use the + /// same application gateway. /// - [JsonProperty(PropertyName = "properties.applicationGatewayBackendAddressPools")] - public IList ApplicationGatewayBackendAddressPools { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicationGatewayBackendAddressPools")] + public System.Collections.Generic.IList ApplicationGatewayBackendAddressPools {get; set; } /// - /// Gets or sets specifies an array of references to backend address - /// pools of load balancers. A virtual machine can reference backend - /// address pools of one public and one internal load balancer. - /// [Multiple virtual machines cannot use the same basic sku load - /// balancer]. + /// Gets or sets specifies an array of references to backend address pools of + /// load balancers. A virtual machine can reference backend address pools of + /// one public and one internal load balancer. [Multiple virtual machines + /// cannot use the same basic sku load balancer]. /// - [JsonProperty(PropertyName = "properties.loadBalancerBackendAddressPools")] - public IList LoadBalancerBackendAddressPools { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancerBackendAddressPools")] + public System.Collections.Generic.IList LoadBalancerBackendAddressPools {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (PublicIPAddressConfiguration != null) + + + if (this.PublicIPAddressConfiguration != null) { - PublicIPAddressConfiguration.Validate(); + this.PublicIPAddressConfiguration.Validate(); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceIPConfigurationProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceIPConfigurationProperties.cs new file mode 100644 index 000000000000..7e9fccc5bbc5 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineNetworkInterfaceIPConfigurationProperties.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes a virtual machine network interface IP configuration properties. + /// + public partial class VirtualMachineNetworkInterfaceIPConfigurationProperties + { + /// + /// Initializes a new instance of the VirtualMachineNetworkInterfaceIPConfigurationProperties class. + /// + public VirtualMachineNetworkInterfaceIPConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineNetworkInterfaceIPConfigurationProperties class. + /// + + /// Specifies the identifier of the subnet. + /// + + /// Specifies the primary network interface in case the virtual machine has + /// more than 1 network interface. + /// + + /// The publicIPAddressConfiguration. + /// + + /// Available from Api-Version 2017-03-30 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + /// Possible values are: 'IPv4' and 'IPv6'. + /// Possible values include: 'IPv4', 'IPv6' + + /// Specifies an array of references to application security group. + /// + + /// Specifies an array of references to backend address pools of application + /// gateways. A virtual machine can reference backend address pools of multiple + /// application gateways. Multiple virtual machines cannot use the same + /// application gateway. + /// + + /// Specifies an array of references to backend address pools of load + /// balancers. A virtual machine can reference backend address pools of one + /// public and one internal load balancer. [Multiple virtual machines cannot + /// use the same basic sku load balancer]. + /// + public VirtualMachineNetworkInterfaceIPConfigurationProperties(SubResource subnet = default(SubResource), bool? primary = default(bool?), VirtualMachinePublicIPAddressConfiguration publicIPAddressConfiguration = default(VirtualMachinePublicIPAddressConfiguration), string privateIPAddressVersion = default(string), System.Collections.Generic.IList applicationSecurityGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationGatewayBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerBackendAddressPools = default(System.Collections.Generic.IList)) + + { + this.Subnet = subnet; + this.Primary = primary; + this.PublicIPAddressConfiguration = publicIPAddressConfiguration; + this.PrivateIPAddressVersion = privateIPAddressVersion; + this.ApplicationSecurityGroups = applicationSecurityGroups; + this.ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + this.LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets specifies the identifier of the subnet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public SubResource Subnet {get; set; } + + /// + /// Gets or sets specifies the primary network interface in case the virtual + /// machine has more than 1 network interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primary")] + public bool? Primary {get; set; } + + /// + /// Gets or sets the publicIPAddressConfiguration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddressConfiguration")] + public VirtualMachinePublicIPAddressConfiguration PublicIPAddressConfiguration {get; set; } + + /// + /// Gets or sets available from Api-Version 2017-03-30 onwards, it represents + /// whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as + /// IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAddressVersion")] + public string PrivateIPAddressVersion {get; set; } + + /// + /// Gets or sets specifies an array of references to application security + /// group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applicationSecurityGroups")] + public System.Collections.Generic.IList ApplicationSecurityGroups {get; set; } + + /// + /// Gets or sets specifies an array of references to backend address pools of + /// application gateways. A virtual machine can reference backend address pools + /// of multiple application gateways. Multiple virtual machines cannot use the + /// same application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applicationGatewayBackendAddressPools")] + public System.Collections.Generic.IList ApplicationGatewayBackendAddressPools {get; set; } + + /// + /// Gets or sets specifies an array of references to backend address pools of + /// load balancers. A virtual machine can reference backend address pools of + /// one public and one internal load balancer. [Multiple virtual machines + /// cannot use the same basic sku load balancer]. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadBalancerBackendAddressPools")] + public System.Collections.Generic.IList LoadBalancerBackendAddressPools {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + if (this.PublicIPAddressConfiguration != null) + { + this.PublicIPAddressConfiguration.Validate(); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePatchStatus.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePatchStatus.cs index bd1b95c7f635..ff61a540bafb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePatchStatus.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePatchStatus.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,18 +23,23 @@ public VirtualMachinePatchStatus() /// /// Initializes a new instance of the VirtualMachinePatchStatus class. /// - /// The available patch summary of - /// the latest assessment operation for the virtual machine. - /// The installation summary - /// of the latest installation operation for the virtual - /// machine. - /// The enablement status of the - /// specified patchMode - public VirtualMachinePatchStatus(AvailablePatchSummary availablePatchSummary = default(AvailablePatchSummary), LastPatchInstallationSummary lastPatchInstallationSummary = default(LastPatchInstallationSummary), IList configurationStatuses = default(IList)) + + /// The available patch summary of the latest assessment operation for the + /// virtual machine. + /// + + /// The installation summary of the latest installation operation for the + /// virtual machine. + /// + + /// The enablement status of the specified patchMode + /// + public VirtualMachinePatchStatus(AvailablePatchSummary availablePatchSummary = default(AvailablePatchSummary), LastPatchInstallationSummary lastPatchInstallationSummary = default(LastPatchInstallationSummary), System.Collections.Generic.IList configurationStatuses = default(System.Collections.Generic.IList)) + { - AvailablePatchSummary = availablePatchSummary; - LastPatchInstallationSummary = lastPatchInstallationSummary; - ConfigurationStatuses = configurationStatuses; + this.AvailablePatchSummary = availablePatchSummary; + this.LastPatchInstallationSummary = lastPatchInstallationSummary; + this.ConfigurationStatuses = configurationStatuses; CustomInit(); } @@ -51,25 +48,25 @@ public VirtualMachinePatchStatus() /// partial void CustomInit(); + /// - /// Gets or sets the available patch summary of the latest assessment - /// operation for the virtual machine. + /// Gets or sets the available patch summary of the latest assessment operation + /// for the virtual machine. /// - [JsonProperty(PropertyName = "availablePatchSummary")] - public AvailablePatchSummary AvailablePatchSummary { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "availablePatchSummary")] + public AvailablePatchSummary AvailablePatchSummary {get; set; } /// - /// Gets or sets the installation summary of the latest installation - /// operation for the virtual machine. + /// Gets or sets the installation summary of the latest installation operation + /// for the virtual machine. /// - [JsonProperty(PropertyName = "lastPatchInstallationSummary")] - public LastPatchInstallationSummary LastPatchInstallationSummary { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastPatchInstallationSummary")] + public LastPatchInstallationSummary LastPatchInstallationSummary {get; set; } /// /// Gets the enablement status of the specified patchMode /// - [JsonProperty(PropertyName = "configurationStatuses")] - public IList ConfigurationStatuses { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "configurationStatuses")] + public System.Collections.Generic.IList ConfigurationStatuses {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePriorityTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePriorityTypes.cs index 6a5d628ee3e3..17439848827d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePriorityTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePriorityTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for VirtualMachinePriorityTypes. /// + + public static class VirtualMachinePriorityTypes { public const string Regular = "Regular"; public const string Low = "Low"; public const string Spot = "Spot"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineProperties.cs new file mode 100644 index 000000000000..225592757bd0 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineProperties.cs @@ -0,0 +1,465 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a Virtual Machine. + /// + public partial class VirtualMachineProperties + { + /// + /// Initializes a new instance of the VirtualMachineProperties class. + /// + public VirtualMachineProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineProperties class. + /// + + /// Specifies the hardware settings for the virtual machine. + /// + + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets + /// Scheduled Event related configurations for the virtual machine. + /// + + /// Specifies the storage settings for the virtual machine disks. + /// + + /// Specifies additional capabilities enabled or disabled on the virtual + /// machine. + /// + + /// Specifies the operating system settings used while creating the virtual + /// machine. Some of the settings cannot be changed once VM is provisioned. + /// + + /// Specifies the network interfaces of the virtual machine. + /// + + /// Specifies the Security related profile settings for the virtual machine. + /// + + /// Specifies the boot diagnostic settings state. Minimum api-version: + /// 2015-06-15. + /// + + /// Specifies information about the availability set that the virtual machine + /// should be assigned to. Virtual machines specified in the same availability + /// set are allocated to different nodes to maximize availability. For more + /// information about availability sets, see [Availability sets + /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + /// For more information on Azure planned maintenance, see [Maintenance and + /// updates for Virtual Machines in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). + /// Currently, a VM can only be added to availability set at creation time. The + /// availability set to which the VM is being added should be under the same + /// resource group as the availability set resource. An existing VM cannot be + /// added to an availability set. This property cannot exist along with a + /// non-null properties.virtualMachineScaleSet reference. + /// + + /// Specifies information about the virtual machine scale set that the virtual + /// machine should be assigned to. Virtual machines specified in the same + /// virtual machine scale set are allocated to different nodes to maximize + /// availability. Currently, a VM can only be added to virtual machine scale + /// set at creation time. An existing VM cannot be added to a virtual machine + /// scale set. This property cannot exist along with a non-null + /// properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. + /// + + /// Specifies information about the proximity placement group that the virtual + /// machine should be assigned to. Minimum api-version: 2018-04-01. + /// + + /// Specifies the priority for the virtual machine. Minimum api-version: + /// 2019-03-01 + /// Possible values include: 'Regular', 'Low', 'Spot' + + /// Specifies the eviction policy for the Azure Spot virtual machine and Azure + /// Spot scale set. For Azure Spot virtual machines, both 'Deallocate' and + /// 'Delete' are supported and the minimum api-version is 2019-03-01. For Azure + /// Spot scale sets, both 'Deallocate' and 'Delete' are supported and the + /// minimum api-version is 2017-10-30-preview. + /// Possible values include: 'Deallocate', 'Delete' + + /// Specifies the billing related details of a Azure Spot virtual machine. + /// Minimum api-version: 2019-03-01. + /// + + /// Specifies information about the dedicated host that the virtual machine + /// resides in. Minimum api-version: 2018-10-01. + /// + + /// Specifies information about the dedicated host group that the virtual + /// machine resides in. **Note:** User cannot specify both host and hostGroup + /// properties. Minimum api-version: 2020-06-01. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// The virtual machine instance view. + /// + + /// Specifies that the image or disk that is being used was licensed + /// on-premises. <br><br> Possible values for Windows Server operating system + /// are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible + /// values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) + /// <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure + /// Hybrid Use Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// + + /// Specifies the VM unique ID which is a 128-bits identifier that is encoded + /// and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS + /// commands. + /// + + /// Specifies the time alloted for all extensions to start. The time duration + /// should be between 15 minutes and 120 minutes (inclusive) and should be + /// specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). + /// Minimum api-version: 2020-06-01. + /// + + /// Specifies the scale set logical fault domain into which the Virtual Machine + /// will be created. By default, the Virtual Machine will by automatically + /// assigned to a fault domain that best maintains balance across available + /// fault domains. This is applicable only if the 'virtualMachineScaleSet' + /// property of this Virtual Machine is set. The Virtual Machine Scale Set that + /// is referenced, must have 'platformFaultDomainCount' greater than 1. This + /// property cannot be updated once the Virtual Machine is created. Fault + /// domain assignment can be viewed in the Virtual Machine Instance View. + /// Minimum api‐version: 2020‐12‐01. + /// + + /// Specifies Scheduled Event related configurations. + /// + + /// UserData for the VM, which must be base-64 encoded. Customer should not + /// pass any secrets in here. Minimum api-version: 2021-03-01. + /// + + /// Specifies information about the capacity reservation that is used to + /// allocate virtual machine. Minimum api-version: 2021-04-01. + /// + + /// Specifies the gallery applications that should be made available to the + /// VM/VMSS. + /// + + /// Specifies the time at which the Virtual Machine resource was created. + /// Minimum api-version: 2021-11-01. + /// + public VirtualMachineProperties(HardwareProfile hardwareProfile = default(HardwareProfile), ScheduledEventsPolicy scheduledEventsPolicy = default(ScheduledEventsPolicy), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), ScheduledEventsProfile scheduledEventsProfile = default(ScheduledEventsProfile), string userData = default(string), CapacityReservationProfile capacityReservation = default(CapacityReservationProfile), ApplicationProfile applicationProfile = default(ApplicationProfile), System.DateTime? timeCreated = default(System.DateTime?)) + + { + this.HardwareProfile = hardwareProfile; + this.ScheduledEventsPolicy = scheduledEventsPolicy; + this.StorageProfile = storageProfile; + this.AdditionalCapabilities = additionalCapabilities; + this.OsProfile = osProfile; + this.NetworkProfile = networkProfile; + this.SecurityProfile = securityProfile; + this.DiagnosticsProfile = diagnosticsProfile; + this.AvailabilitySet = availabilitySet; + this.VirtualMachineScaleSet = virtualMachineScaleSet; + this.ProximityPlacementGroup = proximityPlacementGroup; + this.Priority = priority; + this.EvictionPolicy = evictionPolicy; + this.BillingProfile = billingProfile; + this.Host = host; + this.HostGroup = hostGroup; + this.ProvisioningState = provisioningState; + this.InstanceView = instanceView; + this.LicenseType = licenseType; + this.VmId = vmId; + this.ExtensionsTimeBudget = extensionsTimeBudget; + this.PlatformFaultDomain = platformFaultDomain; + this.ScheduledEventsProfile = scheduledEventsProfile; + this.UserData = userData; + this.CapacityReservation = capacityReservation; + this.ApplicationProfile = applicationProfile; + this.TimeCreated = timeCreated; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets specifies the hardware settings for the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hardwareProfile")] + public HardwareProfile HardwareProfile {get; set; } + + /// + /// Gets or sets specifies Redeploy, Reboot and + /// ScheduledEventsAdditionalPublishingTargets Scheduled Event related + /// configurations for the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scheduledEventsPolicy")] + public ScheduledEventsPolicy ScheduledEventsPolicy {get; set; } + + /// + /// Gets or sets specifies the storage settings for the virtual machine disks. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageProfile")] + public StorageProfile StorageProfile {get; set; } + + /// + /// Gets or sets specifies additional capabilities enabled or disabled on the + /// virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalCapabilities")] + public AdditionalCapabilities AdditionalCapabilities {get; set; } + + /// + /// Gets or sets specifies the operating system settings used while creating + /// the virtual machine. Some of the settings cannot be changed once VM is + /// provisioned. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osProfile")] + public OSProfile OsProfile {get; set; } + + /// + /// Gets or sets specifies the network interfaces of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkProfile")] + public NetworkProfile NetworkProfile {get; set; } + + /// + /// Gets or sets specifies the Security related profile settings for the + /// virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "securityProfile")] + public SecurityProfile SecurityProfile {get; set; } + + /// + /// Gets or sets specifies the boot diagnostic settings state. Minimum + /// api-version: 2015-06-15. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diagnosticsProfile")] + public DiagnosticsProfile DiagnosticsProfile {get; set; } + + /// + /// Gets or sets specifies information about the availability set that the + /// virtual machine should be assigned to. Virtual machines specified in the + /// same availability set are allocated to different nodes to maximize + /// availability. For more information about availability sets, see + /// [Availability sets + /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + /// For more information on Azure planned maintenance, see [Maintenance and + /// updates for Virtual Machines in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). + /// Currently, a VM can only be added to availability set at creation time. The + /// availability set to which the VM is being added should be under the same + /// resource group as the availability set resource. An existing VM cannot be + /// added to an availability set. This property cannot exist along with a + /// non-null properties.virtualMachineScaleSet reference. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "availabilitySet")] + public SubResource AvailabilitySet {get; set; } + + /// + /// Gets or sets specifies information about the virtual machine scale set that + /// the virtual machine should be assigned to. Virtual machines specified in + /// the same virtual machine scale set are allocated to different nodes to + /// maximize availability. Currently, a VM can only be added to virtual machine + /// scale set at creation time. An existing VM cannot be added to a virtual + /// machine scale set. This property cannot exist along with a non-null + /// properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachineScaleSet")] + public SubResource VirtualMachineScaleSet {get; set; } + + /// + /// Gets or sets specifies information about the proximity placement group that + /// the virtual machine should be assigned to. Minimum api-version: 2018-04-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "proximityPlacementGroup")] + public SubResource ProximityPlacementGroup {get; set; } + + /// + /// Gets or sets specifies the priority for the virtual machine. Minimum + /// api-version: 2019-03-01 Possible values include: 'Regular', 'Low', 'Spot' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + public string Priority {get; set; } + + /// + /// Gets or sets specifies the eviction policy for the Azure Spot virtual + /// machine and Azure Spot scale set. For Azure Spot virtual machines, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version is + /// 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are + /// supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "evictionPolicy")] + public string EvictionPolicy {get; set; } + + /// + /// Gets or sets specifies the billing related details of a Azure Spot virtual + /// machine. Minimum api-version: 2019-03-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "billingProfile")] + public BillingProfile BillingProfile {get; set; } + + /// + /// Gets or sets specifies information about the dedicated host that the + /// virtual machine resides in. Minimum api-version: 2018-10-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "host")] + public SubResource Host {get; set; } + + /// + /// Gets or sets specifies information about the dedicated host group that the + /// virtual machine resides in. **Note:** User cannot specify both host and + /// hostGroup properties. Minimum api-version: 2020-06-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hostGroup")] + public SubResource HostGroup {get; set; } + + /// + /// Gets the provisioning state, which only appears in the response. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the virtual machine instance view. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "instanceView")] + public VirtualMachineInstanceView InstanceView {get; private set; } + + /// + /// Gets or sets specifies that the image or disk that is being used was + /// licensed on-premises. <br><br> Possible values for Windows Server operating + /// system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> + /// Possible values for Linux Server operating system are: <br><br> RHEL_BYOS + /// (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see + /// [Azure Hybrid Use Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "licenseType")] + public string LicenseType {get; set; } + + /// + /// Gets specifies the VM unique ID which is a 128-bits identifier that is + /// encoded and stored in all Azure IaaS VMs SMBIOS and can be read using + /// platform BIOS commands. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vmId")] + public string VmId {get; private set; } + + /// + /// Gets or sets specifies the time alloted for all extensions to start. The + /// time duration should be between 15 minutes and 120 minutes (inclusive) and + /// should be specified in ISO 8601 format. The default value is 90 minutes + /// (PT1H30M). Minimum api-version: 2020-06-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "extensionsTimeBudget")] + public string ExtensionsTimeBudget {get; set; } + + /// + /// Gets or sets specifies the scale set logical fault domain into which the + /// Virtual Machine will be created. By default, the Virtual Machine will by + /// automatically assigned to a fault domain that best maintains balance across + /// available fault domains. This is applicable only if the + /// 'virtualMachineScaleSet' property of this Virtual Machine is set. The + /// Virtual Machine Scale Set that is referenced, must have + /// 'platformFaultDomainCount' greater than 1. This property cannot be updated + /// once the Virtual Machine is created. Fault domain assignment can be viewed + /// in the Virtual Machine Instance View. Minimum api‐version: 2020‐12‐01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "platformFaultDomain")] + public int? PlatformFaultDomain {get; set; } + + /// + /// Gets or sets specifies Scheduled Event related configurations. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scheduledEventsProfile")] + public ScheduledEventsProfile ScheduledEventsProfile {get; set; } + + /// + /// Gets or sets userData for the VM, which must be base-64 encoded. Customer + /// should not pass any secrets in here. Minimum api-version: 2021-03-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "userData")] + public string UserData {get; set; } + + /// + /// Gets or sets specifies information about the capacity reservation that is + /// used to allocate virtual machine. Minimum api-version: 2021-04-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "capacityReservation")] + public CapacityReservationProfile CapacityReservation {get; set; } + + /// + /// Gets or sets specifies the gallery applications that should be made + /// available to the VM/VMSS. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applicationProfile")] + public ApplicationProfile ApplicationProfile {get; set; } + + /// + /// Gets specifies the time at which the Virtual Machine resource was created. + /// Minimum api-version: 2021-11-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeCreated")] + public System.DateTime? TimeCreated {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + if (this.StorageProfile != null) + { + this.StorageProfile.Validate(); + } + + + + + + + + + + + + + + + + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePublicIPAddressConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePublicIPAddressConfiguration.cs index 59323c4dfaf8..7ead4e25449c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePublicIPAddressConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePublicIPAddressConfiguration.cs @@ -1,32 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Describes a virtual machines IP Configuration's PublicIPAddress + /// Describes a virtual machines IP Configuration's PublicIPAddress /// configuration /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachinePublicIPAddressConfiguration { /// - /// Initializes a new instance of the - /// VirtualMachinePublicIPAddressConfiguration class. + /// Initializes a new instance of the VirtualMachinePublicIPAddressConfiguration class. /// public VirtualMachinePublicIPAddressConfiguration() { @@ -34,45 +23,55 @@ public VirtualMachinePublicIPAddressConfiguration() } /// - /// Initializes a new instance of the - /// VirtualMachinePublicIPAddressConfiguration class. + /// Initializes a new instance of the VirtualMachinePublicIPAddressConfiguration class. /// - /// The publicIP address configuration name. - /// The idle timeout of the public - /// IP address. - /// Specify what happens to the public IP - /// address when the VM is deleted. Possible values include: 'Delete', - /// 'Detach' - /// The dns settings to be applied on the - /// publicIP addresses . - /// The list of IP tags associated with the public - /// IP address. - /// The PublicIPPrefix from which to - /// allocate publicIP addresses. - /// Available from Api-Version - /// 2019-07-01 onwards, it represents whether the specific - /// ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible - /// values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - /// 'IPv6' - /// Specify the public IP - /// allocation type. Possible values include: 'Dynamic', - /// 'Static' - /// Describes the public IP Sku. It can only be set - /// with OrchestrationMode as Flexible. - /// Resource tags applied to the publicIP address - /// created by this PublicIPAddressConfiguration - public VirtualMachinePublicIPAddressConfiguration(string name, int? idleTimeoutInMinutes = default(int?), string deleteOption = default(string), VirtualMachinePublicIPAddressDnsSettingsConfiguration dnsSettings = default(VirtualMachinePublicIPAddressDnsSettingsConfiguration), IList ipTags = default(IList), SubResource publicIPPrefix = default(SubResource), string publicIPAddressVersion = default(string), string publicIPAllocationMethod = default(string), PublicIPAddressSku sku = default(PublicIPAddressSku), IDictionary tags = default(IDictionary)) + + /// The publicIP address configuration name. + /// + + /// Describes the public IP Sku. It can only be set with OrchestrationMode as + /// Flexible. + /// + + /// Resource tags applied to the publicIP address created by this + /// PublicIPAddressConfiguration + /// + + /// The idle timeout of the public IP address. + /// + + /// Specify what happens to the public IP address when the VM is deleted + /// Possible values include: 'Delete', 'Detach' + + /// The dns settings to be applied on the publicIP addresses . + /// + + /// The list of IP tags associated with the public IP address. + /// + + /// The PublicIPPrefix from which to allocate publicIP addresses. + /// + + /// Available from Api-Version 2019-07-01 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + /// Possible values are: 'IPv4' and 'IPv6'. + /// Possible values include: 'IPv4', 'IPv6' + + /// Specify the public IP allocation type + /// Possible values include: 'Dynamic', 'Static' + public VirtualMachinePublicIPAddressConfiguration(string name, PublicIPAddressSku sku = default(PublicIPAddressSku), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), int? idleTimeoutInMinutes = default(int?), string deleteOption = default(string), VirtualMachinePublicIPAddressDnsSettingsConfiguration dnsSettings = default(VirtualMachinePublicIPAddressDnsSettingsConfiguration), System.Collections.Generic.IList ipTags = default(System.Collections.Generic.IList), SubResource publicIPPrefix = default(SubResource), string publicIPAddressVersion = default(string), string publicIPAllocationMethod = default(string)) + { - Name = name; - IdleTimeoutInMinutes = idleTimeoutInMinutes; - DeleteOption = deleteOption; - DnsSettings = dnsSettings; - IpTags = ipTags; - PublicIPPrefix = publicIPPrefix; - PublicIPAddressVersion = publicIPAddressVersion; - PublicIPAllocationMethod = publicIPAllocationMethod; - Sku = sku; - Tags = tags; + this.Name = name; + this.Sku = sku; + this.Tags = tags; + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; + this.DeleteOption = deleteOption; + this.DnsSettings = dnsSettings; + this.IpTags = ipTags; + this.PublicIPPrefix = publicIPPrefix; + this.PublicIPAddressVersion = publicIPAddressVersion; + this.PublicIPAllocationMethod = publicIPAllocationMethod; CustomInit(); } @@ -81,92 +80,95 @@ public VirtualMachinePublicIPAddressConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the publicIP address configuration name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the idle timeout of the public IP address. + /// Gets or sets describes the public IP Sku. It can only be set with + /// OrchestrationMode as Flexible. /// - [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] - public int? IdleTimeoutInMinutes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public PublicIPAddressSku Sku {get; set; } /// - /// Gets or sets specify what happens to the public IP address when the - /// VM is deleted. Possible values include: 'Delete', 'Detach' + /// Gets or sets resource tags applied to the publicIP address created by this + /// PublicIPAddressConfiguration /// - [JsonProperty(PropertyName = "properties.deleteOption")] - public string DeleteOption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets or sets the dns settings to be applied on the publicIP - /// addresses . + /// Gets or sets the idle timeout of the public IP address. /// - [JsonProperty(PropertyName = "properties.dnsSettings")] - public VirtualMachinePublicIPAddressDnsSettingsConfiguration DnsSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } /// - /// Gets or sets the list of IP tags associated with the public IP - /// address. + /// Gets or sets specify what happens to the public IP address when the VM is + /// deleted Possible values include: 'Delete', 'Detach' /// - [JsonProperty(PropertyName = "properties.ipTags")] - public IList IpTags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deleteOption")] + public string DeleteOption {get; set; } /// - /// Gets or sets the PublicIPPrefix from which to allocate publicIP - /// addresses. + /// Gets or sets the dns settings to be applied on the publicIP addresses . /// - [JsonProperty(PropertyName = "properties.publicIPPrefix")] - public SubResource PublicIPPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dnsSettings")] + public VirtualMachinePublicIPAddressDnsSettingsConfiguration DnsSettings {get; set; } /// - /// Gets or sets available from Api-Version 2019-07-01 onwards, it - /// represents whether the specific ipconfiguration is IPv4 or IPv6. - /// Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - /// Possible values include: 'IPv4', 'IPv6' + /// Gets or sets the list of IP tags associated with the public IP address. /// - [JsonProperty(PropertyName = "properties.publicIPAddressVersion")] - public string PublicIPAddressVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipTags")] + public System.Collections.Generic.IList IpTags {get; set; } /// - /// Gets or sets specify the public IP allocation type. Possible values - /// include: 'Dynamic', 'Static' + /// Gets or sets the PublicIPPrefix from which to allocate publicIP addresses. /// - [JsonProperty(PropertyName = "properties.publicIPAllocationMethod")] - public string PublicIPAllocationMethod { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPPrefix")] + public SubResource PublicIPPrefix {get; set; } /// - /// Gets or sets describes the public IP Sku. It can only be set with - /// OrchestrationMode as Flexible. + /// Gets or sets available from Api-Version 2019-07-01 onwards, it represents + /// whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as + /// IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' /// - [JsonProperty(PropertyName = "sku")] - public PublicIPAddressSku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddressVersion")] + public string PublicIPAddressVersion {get; set; } /// - /// Gets or sets resource tags applied to the publicIP address created - /// by this PublicIPAddressConfiguration + /// Gets or sets specify the public IP allocation type Possible values include: 'Dynamic', 'Static' /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAllocationMethod")] + public string PublicIPAllocationMethod {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (DnsSettings != null) + + + + + if (this.DnsSettings != null) { - DnsSettings.Validate(); + this.DnsSettings.Validate(); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePublicIPAddressConfigurationProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePublicIPAddressConfigurationProperties.cs new file mode 100644 index 000000000000..d67f5c4dfebb --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePublicIPAddressConfigurationProperties.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes a virtual machines IP Configuration's PublicIPAddress + /// configuration + /// + public partial class VirtualMachinePublicIPAddressConfigurationProperties + { + /// + /// Initializes a new instance of the VirtualMachinePublicIPAddressConfigurationProperties class. + /// + public VirtualMachinePublicIPAddressConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachinePublicIPAddressConfigurationProperties class. + /// + + /// The idle timeout of the public IP address. + /// + + /// Specify what happens to the public IP address when the VM is deleted + /// Possible values include: 'Delete', 'Detach' + + /// The dns settings to be applied on the publicIP addresses . + /// + + /// The list of IP tags associated with the public IP address. + /// + + /// The PublicIPPrefix from which to allocate publicIP addresses. + /// + + /// Available from Api-Version 2019-07-01 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + /// Possible values are: 'IPv4' and 'IPv6'. + /// Possible values include: 'IPv4', 'IPv6' + + /// Specify the public IP allocation type + /// Possible values include: 'Dynamic', 'Static' + public VirtualMachinePublicIPAddressConfigurationProperties(int? idleTimeoutInMinutes = default(int?), string deleteOption = default(string), VirtualMachinePublicIPAddressDnsSettingsConfiguration dnsSettings = default(VirtualMachinePublicIPAddressDnsSettingsConfiguration), System.Collections.Generic.IList ipTags = default(System.Collections.Generic.IList), SubResource publicIPPrefix = default(SubResource), string publicIPAddressVersion = default(string), string publicIPAllocationMethod = default(string)) + + { + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; + this.DeleteOption = deleteOption; + this.DnsSettings = dnsSettings; + this.IpTags = ipTags; + this.PublicIPPrefix = publicIPPrefix; + this.PublicIPAddressVersion = publicIPAddressVersion; + this.PublicIPAllocationMethod = publicIPAllocationMethod; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the idle timeout of the public IP address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } + + /// + /// Gets or sets specify what happens to the public IP address when the VM is + /// deleted Possible values include: 'Delete', 'Detach' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "deleteOption")] + public string DeleteOption {get; set; } + + /// + /// Gets or sets the dns settings to be applied on the publicIP addresses . + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsSettings")] + public VirtualMachinePublicIPAddressDnsSettingsConfiguration DnsSettings {get; set; } + + /// + /// Gets or sets the list of IP tags associated with the public IP address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipTags")] + public System.Collections.Generic.IList IpTags {get; set; } + + /// + /// Gets or sets the PublicIPPrefix from which to allocate publicIP addresses. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPPrefix")] + public SubResource PublicIPPrefix {get; set; } + + /// + /// Gets or sets available from Api-Version 2019-07-01 onwards, it represents + /// whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as + /// IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddressVersion")] + public string PublicIPAddressVersion {get; set; } + + /// + /// Gets or sets specify the public IP allocation type Possible values include: 'Dynamic', 'Static' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAllocationMethod")] + public string PublicIPAllocationMethod {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + if (this.DnsSettings != null) + { + this.DnsSettings.Validate(); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePublicIPAddressDnsSettingsConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePublicIPAddressDnsSettingsConfiguration.cs index bb5e5d0f190f..569d9dff46f1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePublicIPAddressDnsSettingsConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinePublicIPAddressDnsSettingsConfiguration.cs @@ -1,27 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// - /// Describes a virtual machines network configuration's DNS settings. + /// Describes a virtual machines network configuration's DNS settings. /// public partial class VirtualMachinePublicIPAddressDnsSettingsConfiguration { /// - /// Initializes a new instance of the - /// VirtualMachinePublicIPAddressDnsSettingsConfiguration class. + /// Initializes a new instance of the VirtualMachinePublicIPAddressDnsSettingsConfiguration class. /// public VirtualMachinePublicIPAddressDnsSettingsConfiguration() { @@ -29,23 +21,25 @@ public VirtualMachinePublicIPAddressDnsSettingsConfiguration() } /// - /// Initializes a new instance of the - /// VirtualMachinePublicIPAddressDnsSettingsConfiguration class. + /// Initializes a new instance of the VirtualMachinePublicIPAddressDnsSettingsConfiguration class. /// - /// The Domain name label prefix of the - /// PublicIPAddress resources that will be created. The generated name - /// label is the concatenation of the domain name label and vm network - /// profile unique ID. - /// The Domain name label scope of - /// the PublicIPAddress resources that will be created. The generated - /// name label is the concatenation of the hashed domain name label - /// with policy according to the domain name label scope and vm network - /// profile unique ID. Possible values include: 'TenantReuse', - /// 'SubscriptionReuse', 'ResourceGroupReuse', 'NoReuse' + + /// The Domain name label prefix of the PublicIPAddress resources that will be + /// created. The generated name label is the concatenation of the domain name + /// label and vm network profile unique ID. + /// + + /// The Domain name label scope of the PublicIPAddress resources that will be + /// created. The generated name label is the concatenation of the hashed domain + /// name label with policy according to the domain name label scope and vm + /// network profile unique ID. + /// Possible values include: 'TenantReuse', 'SubscriptionReuse', + /// 'ResourceGroupReuse', 'NoReuse' public VirtualMachinePublicIPAddressDnsSettingsConfiguration(string domainNameLabel, string domainNameLabelScope = default(string)) + { - DomainNameLabel = domainNameLabel; - DomainNameLabelScope = domainNameLabelScope; + this.DomainNameLabel = domainNameLabel; + this.DomainNameLabelScope = domainNameLabelScope; CustomInit(); } @@ -54,38 +48,37 @@ public VirtualMachinePublicIPAddressDnsSettingsConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets the Domain name label prefix of the PublicIPAddress - /// resources that will be created. The generated name label is the - /// concatenation of the domain name label and vm network profile - /// unique ID. + /// Gets or sets the Domain name label prefix of the PublicIPAddress resources + /// that will be created. The generated name label is the concatenation of the + /// domain name label and vm network profile unique ID. /// - [JsonProperty(PropertyName = "domainNameLabel")] - public string DomainNameLabel { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "domainNameLabel")] + public string DomainNameLabel {get; set; } /// - /// Gets or sets the Domain name label scope of the PublicIPAddress - /// resources that will be created. The generated name label is the - /// concatenation of the hashed domain name label with policy according - /// to the domain name label scope and vm network profile unique ID. - /// Possible values include: 'TenantReuse', 'SubscriptionReuse', - /// 'ResourceGroupReuse', 'NoReuse' + /// Gets or sets the Domain name label scope of the PublicIPAddress resources + /// that will be created. The generated name label is the concatenation of the + /// hashed domain name label with policy according to the domain name label + /// scope and vm network profile unique ID. Possible values include: 'TenantReuse', 'SubscriptionReuse', 'ResourceGroupReuse', 'NoReuse' /// - [JsonProperty(PropertyName = "domainNameLabelScope")] - public string DomainNameLabelScope { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "domainNameLabelScope")] + public string DomainNameLabelScope {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (DomainNameLabel == null) + if (this.DomainNameLabel == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "DomainNameLabel"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DomainNameLabel"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineReimageParameters.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineReimageParameters.cs index 338862ff4467..f030ae487c21 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineReimageParameters.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineReimageParameters.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +14,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineReimageParameters { /// - /// Initializes a new instance of the VirtualMachineReimageParameters - /// class. + /// Initializes a new instance of the VirtualMachineReimageParameters class. /// public VirtualMachineReimageParameters() { @@ -29,23 +22,27 @@ public VirtualMachineReimageParameters() } /// - /// Initializes a new instance of the VirtualMachineReimageParameters - /// class. + /// Initializes a new instance of the VirtualMachineReimageParameters class. /// - /// Specifies whether to reimage temp disk. - /// Default value: false. Note: This temp disk reimage parameter is - /// only supported for VM/VMSS with Ephemeral OS disk. - /// Specifies in decimal number, the version - /// the OS disk should be reimaged to. If exact version is not - /// provided, the OS disk is reimaged to the existing version of OS - /// Disk. - /// Specifies information required for - /// reimaging the non-ephemeral OS disk. + + /// Specifies whether to reimage temp disk. Default value: false. Note: This + /// temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS + /// disk. + /// + + /// Specifies in decimal number, the version the OS disk should be reimaged to. + /// If exact version is not provided, the OS disk is reimaged to the existing + /// version of OS Disk. + /// + + /// Specifies information required for reimaging the non-ephemeral OS disk. + /// public VirtualMachineReimageParameters(bool? tempDisk = default(bool?), string exactVersion = default(string), OSProfileProvisioningData osProfile = default(OSProfileProvisioningData)) + { - TempDisk = tempDisk; - ExactVersion = exactVersion; - OsProfile = osProfile; + this.TempDisk = tempDisk; + this.ExactVersion = exactVersion; + this.OsProfile = osProfile; CustomInit(); } @@ -54,28 +51,28 @@ public VirtualMachineReimageParameters() /// partial void CustomInit(); + /// - /// Gets or sets specifies whether to reimage temp disk. Default value: - /// false. Note: This temp disk reimage parameter is only supported for - /// VM/VMSS with Ephemeral OS disk. + /// Gets or sets specifies whether to reimage temp disk. Default value: false. + /// Note: This temp disk reimage parameter is only supported for VM/VMSS with + /// Ephemeral OS disk. /// - [JsonProperty(PropertyName = "tempDisk")] - public bool? TempDisk { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tempDisk")] + public bool? TempDisk {get; set; } /// - /// Gets or sets specifies in decimal number, the version the OS disk - /// should be reimaged to. If exact version is not provided, the OS - /// disk is reimaged to the existing version of OS Disk. + /// Gets or sets specifies in decimal number, the version the OS disk should be + /// reimaged to. If exact version is not provided, the OS disk is reimaged to + /// the existing version of OS Disk. /// - [JsonProperty(PropertyName = "exactVersion")] - public string ExactVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "exactVersion")] + public string ExactVersion {get; set; } /// - /// Gets or sets specifies information required for reimaging the - /// non-ephemeral OS disk. + /// Gets or sets specifies information required for reimaging the non-ephemeral + /// OS disk. /// - [JsonProperty(PropertyName = "osProfile")] - public OSProfileProvisioningData OsProfile { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "osProfile")] + public OSProfileProvisioningData OsProfile {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommand.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommand.cs index af395bdc0aae..ec159dc2ed8d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommand.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommand.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Describes a Virtual Machine run command. /// - [Rest.Serialization.JsonTransformation] - public partial class VirtualMachineRunCommand : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class VirtualMachineRunCommand : TrackedResource { /// /// Initializes a new instance of the VirtualMachineRunCommand class. @@ -34,90 +24,115 @@ public VirtualMachineRunCommand() /// /// Initializes a new instance of the VirtualMachineRunCommand class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The source of the run command script. - /// The parameters used by the script. - /// The parameters used by the - /// script. - /// Optional. If set to true, provisioning - /// will complete as soon as the script starts and will not wait for - /// script to complete. - /// Specifies the user account on the VM when - /// executing the run command. - /// Specifies the user account password on - /// the VM when executing the run command. - /// The timeout in seconds to execute - /// the run command. - /// Specifies the Azure storage blob where - /// script output stream will be uploaded. Use a SAS URI with read, - /// append, create, write access OR use managed identity to provide the - /// VM access to the blob. Refer outputBlobManagedIdentity - /// parameter. - /// Specifies the Azure storage blob where - /// script error stream will be uploaded. Use a SAS URI with read, - /// append, create, write access OR use managed identity to provide the - /// VM access to the blob. Refer errorBlobManagedIdentity - /// parameter. - /// User-assigned managed - /// identity that has access to outputBlobUri storage blob. Use an - /// empty object in case of system-assigned identity. Make sure managed - /// identity has been given access to blob's container with 'Storage - /// Blob Data Contributor' role assignment. In case of user-assigned - /// identity, make sure you add it under VM's identity. For more info - /// on managed identity and Run Command, refer - /// https://aka.ms/ManagedIdentity and - /// https://aka.ms/RunCommandManaged - /// User-assigned managed - /// identity that has access to errorBlobUri storage blob. Use an empty - /// object in case of system-assigned identity. Make sure managed - /// identity has been given access to blob's container with 'Storage - /// Blob Data Contributor' role assignment. In case of user-assigned - /// identity, make sure you add it under VM's identity. For more info - /// on managed identity and Run Command, refer - /// https://aka.ms/ManagedIdentity and - /// https://aka.ms/RunCommandManaged - /// The provisioning state, which only - /// appears in the response. If treatFailureAsDeploymentFailure set to - /// true, any failure in the script will fail the deployment and - /// ProvisioningState will be marked as Failed. If - /// treatFailureAsDeploymentFailure set to false, ProvisioningState - /// would only reflect whether the run command was run or not by the - /// extensions platform, it would not indicate whether script failed in - /// case of script failures. See instance view of run command in case - /// of script failures to see executionMessage, output, error: - /// https://aka.ms/runcommandmanaged#get-execution-status-and-results - /// The virtual machine run command instance - /// view. - /// Optional. If set to - /// true, any failure in the script will fail the deployment and - /// ProvisioningState will be marked as Failed. If set to false, - /// ProvisioningState would only reflect whether the run command was - /// run or not by the extensions platform, it would not indicate - /// whether script failed in case of script failures. See instance view - /// of run command in case of script failures to see executionMessage, - /// output, error: - /// https://aka.ms/runcommandmanaged#get-execution-status-and-results - public VirtualMachineRunCommand(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), VirtualMachineRunCommandScriptSource source = default(VirtualMachineRunCommandScriptSource), IList parameters = default(IList), IList protectedParameters = default(IList), bool? asyncExecution = default(bool?), string runAsUser = default(string), string runAsPassword = default(string), int? timeoutInSeconds = default(int?), string outputBlobUri = default(string), string errorBlobUri = default(string), RunCommandManagedIdentity outputBlobManagedIdentity = default(RunCommandManagedIdentity), RunCommandManagedIdentity errorBlobManagedIdentity = default(RunCommandManagedIdentity), string provisioningState = default(string), VirtualMachineRunCommandInstanceView instanceView = default(VirtualMachineRunCommandInstanceView), bool? treatFailureAsDeploymentFailure = default(bool?)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// The source of the run command script. + /// + + /// The parameters used by the script. + /// + + /// The parameters used by the script. + /// + + /// Optional. If set to true, provisioning will complete as soon as the script + /// starts and will not wait for script to complete. + /// + + /// Specifies the user account on the VM when executing the run command. + /// + + /// Specifies the user account password on the VM when executing the run + /// command. + /// + + /// The timeout in seconds to execute the run command. + /// + + /// Specifies the Azure storage blob where script output stream will be + /// uploaded. Use a SAS URI with read, append, create, write access OR use + /// managed identity to provide the VM access to the blob. Refer + /// outputBlobManagedIdentity parameter. + /// + + /// Specifies the Azure storage blob where script error stream will be + /// uploaded. Use a SAS URI with read, append, create, write access OR use + /// managed identity to provide the VM access to the blob. Refer + /// errorBlobManagedIdentity parameter. + /// + + /// User-assigned managed identity that has access to outputBlobUri storage + /// blob. Use an empty object in case of system-assigned identity. Make sure + /// managed identity has been given access to blob's container with 'Storage + /// Blob Data Contributor' role assignment. In case of user-assigned identity, + /// make sure you add it under VM's identity. For more info on managed identity + /// and Run Command, refer https://aka.ms/ManagedIdentity and + /// https://aka.ms/RunCommandManaged + /// + + /// User-assigned managed identity that has access to errorBlobUri storage + /// blob. Use an empty object in case of system-assigned identity. Make sure + /// managed identity has been given access to blob's container with 'Storage + /// Blob Data Contributor' role assignment. In case of user-assigned identity, + /// make sure you add it under VM's identity. For more info on managed identity + /// and Run Command, refer https://aka.ms/ManagedIdentity and + /// https://aka.ms/RunCommandManaged + /// + + /// The provisioning state, which only appears in the response. If + /// treatFailureAsDeploymentFailure set to true, any failure in the script will + /// fail the deployment and ProvisioningState will be marked as Failed. If + /// treatFailureAsDeploymentFailure set to false, ProvisioningState would only + /// reflect whether the run command was run or not by the extensions platform, + /// it would not indicate whether script failed in case of script failures. See + /// instance view of run command in case of script failures to see + /// executionMessage, output, error: + /// https://aka.ms/runcommandmanaged#get-execution-status-and-results + /// + + /// The virtual machine run command instance view. + /// + + /// Optional. If set to true, any failure in the script will fail the + /// deployment and ProvisioningState will be marked as Failed. If set to false, + /// ProvisioningState would only reflect whether the run command was run or not + /// by the extensions platform, it would not indicate whether script failed in + /// case of script failures. See instance view of run command in case of script + /// failures to see executionMessage, output, error: + /// https://aka.ms/runcommandmanaged#get-execution-status-and-results + /// + public VirtualMachineRunCommand(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), VirtualMachineRunCommandScriptSource source = default(VirtualMachineRunCommandScriptSource), System.Collections.Generic.IList parameters = default(System.Collections.Generic.IList), System.Collections.Generic.IList protectedParameters = default(System.Collections.Generic.IList), bool? asyncExecution = default(bool?), string runAsUser = default(string), string runAsPassword = default(string), int? timeoutInSeconds = default(int?), string outputBlobUri = default(string), string errorBlobUri = default(string), RunCommandManagedIdentity outputBlobManagedIdentity = default(RunCommandManagedIdentity), RunCommandManagedIdentity errorBlobManagedIdentity = default(RunCommandManagedIdentity), string provisioningState = default(string), VirtualMachineRunCommandInstanceView instanceView = default(VirtualMachineRunCommandInstanceView), bool? treatFailureAsDeploymentFailure = default(bool?)) + + : base(location, id, name, type, tags) { - Source = source; - Parameters = parameters; - ProtectedParameters = protectedParameters; - AsyncExecution = asyncExecution; - RunAsUser = runAsUser; - RunAsPassword = runAsPassword; - TimeoutInSeconds = timeoutInSeconds; - OutputBlobUri = outputBlobUri; - ErrorBlobUri = errorBlobUri; - OutputBlobManagedIdentity = outputBlobManagedIdentity; - ErrorBlobManagedIdentity = errorBlobManagedIdentity; - ProvisioningState = provisioningState; - InstanceView = instanceView; - TreatFailureAsDeploymentFailure = treatFailureAsDeploymentFailure; + this.Source = source; + this.Parameters = parameters; + this.ProtectedParameters = protectedParameters; + this.AsyncExecution = asyncExecution; + this.RunAsUser = runAsUser; + this.RunAsPassword = runAsPassword; + this.TimeoutInSeconds = timeoutInSeconds; + this.OutputBlobUri = outputBlobUri; + this.ErrorBlobUri = errorBlobUri; + this.OutputBlobManagedIdentity = outputBlobManagedIdentity; + this.ErrorBlobManagedIdentity = errorBlobManagedIdentity; + this.ProvisioningState = provisioningState; + this.InstanceView = instanceView; + this.TreatFailureAsDeploymentFailure = treatFailureAsDeploymentFailure; CustomInit(); } @@ -126,142 +141,138 @@ public VirtualMachineRunCommand() /// partial void CustomInit(); + /// /// Gets or sets the source of the run command script. /// - [JsonProperty(PropertyName = "properties.source")] - public VirtualMachineRunCommandScriptSource Source { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.source")] + public VirtualMachineRunCommandScriptSource Source {get; set; } /// /// Gets or sets the parameters used by the script. /// - [JsonProperty(PropertyName = "properties.parameters")] - public IList Parameters { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.parameters")] + public System.Collections.Generic.IList Parameters {get; set; } /// /// Gets or sets the parameters used by the script. /// - [JsonProperty(PropertyName = "properties.protectedParameters")] - public IList ProtectedParameters { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protectedParameters")] + public System.Collections.Generic.IList ProtectedParameters {get; set; } /// - /// Gets or sets optional. If set to true, provisioning will complete - /// as soon as the script starts and will not wait for script to - /// complete. + /// Gets or sets optional. If set to true, provisioning will complete as soon + /// as the script starts and will not wait for script to complete. /// - [JsonProperty(PropertyName = "properties.asyncExecution")] - public bool? AsyncExecution { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.asyncExecution")] + public bool? AsyncExecution {get; set; } /// - /// Gets or sets specifies the user account on the VM when executing - /// the run command. + /// Gets or sets specifies the user account on the VM when executing the run + /// command. /// - [JsonProperty(PropertyName = "properties.runAsUser")] - public string RunAsUser { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.runAsUser")] + public string RunAsUser {get; set; } /// - /// Gets or sets specifies the user account password on the VM when - /// executing the run command. + /// Gets or sets specifies the user account password on the VM when executing + /// the run command. /// - [JsonProperty(PropertyName = "properties.runAsPassword")] - public string RunAsPassword { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.runAsPassword")] + public string RunAsPassword {get; set; } /// /// Gets or sets the timeout in seconds to execute the run command. /// - [JsonProperty(PropertyName = "properties.timeoutInSeconds")] - public int? TimeoutInSeconds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeoutInSeconds")] + public int? TimeoutInSeconds {get; set; } /// - /// Gets or sets specifies the Azure storage blob where script output - /// stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to - /// the blob. Refer outputBlobManagedIdentity parameter. + /// Gets or sets specifies the Azure storage blob where script output stream + /// will be uploaded. Use a SAS URI with read, append, create, write access OR + /// use managed identity to provide the VM access to the blob. Refer + /// outputBlobManagedIdentity parameter. /// - [JsonProperty(PropertyName = "properties.outputBlobUri")] - public string OutputBlobUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outputBlobUri")] + public string OutputBlobUri {get; set; } /// - /// Gets or sets specifies the Azure storage blob where script error - /// stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to - /// the blob. Refer errorBlobManagedIdentity parameter. + /// Gets or sets specifies the Azure storage blob where script error stream + /// will be uploaded. Use a SAS URI with read, append, create, write access OR + /// use managed identity to provide the VM access to the blob. Refer + /// errorBlobManagedIdentity parameter. /// - [JsonProperty(PropertyName = "properties.errorBlobUri")] - public string ErrorBlobUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.errorBlobUri")] + public string ErrorBlobUri {get; set; } /// /// Gets or sets user-assigned managed identity that has access to - /// outputBlobUri storage blob. Use an empty object in case of - /// system-assigned identity. Make sure managed identity has been given - /// access to blob's container with 'Storage Blob Data Contributor' - /// role assignment. In case of user-assigned identity, make sure you - /// add it under VM's identity. For more info on managed identity and - /// Run Command, refer https://aka.ms/ManagedIdentity and - /// https://aka.ms/RunCommandManaged + /// outputBlobUri storage blob. Use an empty object in case of system-assigned + /// identity. Make sure managed identity has been given access to blob's + /// container with 'Storage Blob Data Contributor' role assignment. In case of + /// user-assigned identity, make sure you add it under VM's identity. For more + /// info on managed identity and Run Command, refer + /// https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged /// - [JsonProperty(PropertyName = "properties.outputBlobManagedIdentity")] - public RunCommandManagedIdentity OutputBlobManagedIdentity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outputBlobManagedIdentity")] + public RunCommandManagedIdentity OutputBlobManagedIdentity {get; set; } /// - /// Gets or sets user-assigned managed identity that has access to - /// errorBlobUri storage blob. Use an empty object in case of - /// system-assigned identity. Make sure managed identity has been given - /// access to blob's container with 'Storage Blob Data Contributor' - /// role assignment. In case of user-assigned identity, make sure you - /// add it under VM's identity. For more info on managed identity and - /// Run Command, refer https://aka.ms/ManagedIdentity and + /// Gets or sets user-assigned managed identity that has access to errorBlobUri + /// storage blob. Use an empty object in case of system-assigned identity. Make + /// sure managed identity has been given access to blob's container with + /// 'Storage Blob Data Contributor' role assignment. In case of user-assigned + /// identity, make sure you add it under VM's identity. For more info on + /// managed identity and Run Command, refer https://aka.ms/ManagedIdentity and /// https://aka.ms/RunCommandManaged /// - [JsonProperty(PropertyName = "properties.errorBlobManagedIdentity")] - public RunCommandManagedIdentity ErrorBlobManagedIdentity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.errorBlobManagedIdentity")] + public RunCommandManagedIdentity ErrorBlobManagedIdentity {get; set; } /// /// Gets the provisioning state, which only appears in the response. If - /// treatFailureAsDeploymentFailure set to true, any failure in the - /// script will fail the deployment and ProvisioningState will be - /// marked as Failed. If treatFailureAsDeploymentFailure set to false, - /// ProvisioningState would only reflect whether the run command was - /// run or not by the extensions platform, it would not indicate - /// whether script failed in case of script failures. See instance view - /// of run command in case of script failures to see executionMessage, - /// output, error: + /// treatFailureAsDeploymentFailure set to true, any failure in the script will + /// fail the deployment and ProvisioningState will be marked as Failed. If + /// treatFailureAsDeploymentFailure set to false, ProvisioningState would only + /// reflect whether the run command was run or not by the extensions platform, + /// it would not indicate whether script failed in case of script failures. See + /// instance view of run command in case of script failures to see + /// executionMessage, output, error: /// https://aka.ms/runcommandmanaged#get-execution-status-and-results /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Gets the virtual machine run command instance view. /// - [JsonProperty(PropertyName = "properties.instanceView")] - public VirtualMachineRunCommandInstanceView InstanceView { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.instanceView")] + public VirtualMachineRunCommandInstanceView InstanceView {get; private set; } /// - /// Gets or sets optional. If set to true, any failure in the script - /// will fail the deployment and ProvisioningState will be marked as - /// Failed. If set to false, ProvisioningState would only reflect - /// whether the run command was run or not by the extensions platform, - /// it would not indicate whether script failed in case of script - /// failures. See instance view of run command in case of script - /// failures to see executionMessage, output, error: + /// Gets or sets optional. If set to true, any failure in the script will fail + /// the deployment and ProvisioningState will be marked as Failed. If set to + /// false, ProvisioningState would only reflect whether the run command was run + /// or not by the extensions platform, it would not indicate whether script + /// failed in case of script failures. See instance view of run command in case + /// of script failures to see executionMessage, output, error: /// https://aka.ms/runcommandmanaged#get-execution-status-and-results /// - [JsonProperty(PropertyName = "properties.treatFailureAsDeploymentFailure")] - public bool? TreatFailureAsDeploymentFailure { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.treatFailureAsDeploymentFailure")] + public bool? TreatFailureAsDeploymentFailure {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (Parameters != null) + + if (this.Parameters != null) { - foreach (var element in Parameters) + foreach (var element in this.Parameters) { if (element != null) { @@ -269,16 +280,24 @@ public override void Validate() } } } - if (ProtectedParameters != null) + if (this.ProtectedParameters != null) { - foreach (var element1 in ProtectedParameters) + foreach (var element in this.ProtectedParameters) { - if (element1 != null) + if (element != null) { - element1.Validate(); + element.Validate(); } } } + + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandInstanceView.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandInstanceView.cs index 0c816fc3fa91..4844dcb3048e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandInstanceView.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandInstanceView.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineRunCommandInstanceView { /// - /// Initializes a new instance of the - /// VirtualMachineRunCommandInstanceView class. + /// Initializes a new instance of the VirtualMachineRunCommandInstanceView class. /// public VirtualMachineRunCommandInstanceView() { @@ -30,31 +21,44 @@ public VirtualMachineRunCommandInstanceView() } /// - /// Initializes a new instance of the - /// VirtualMachineRunCommandInstanceView class. + /// Initializes a new instance of the VirtualMachineRunCommandInstanceView class. /// - /// Script execution status. Possible - /// values include: 'Unknown', 'Pending', 'Running', 'Failed', - /// 'Succeeded', 'TimedOut', 'Canceled' - /// Communicate script configuration - /// errors or execution messages. - /// Exit code returned from script - /// execution. - /// Script output stream. - /// Script error stream. - /// Script start time. - /// Script end time. - /// The resource status information. - public VirtualMachineRunCommandInstanceView(string executionState = default(string), string executionMessage = default(string), int? exitCode = default(int?), string output = default(string), string error = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), IList statuses = default(IList)) + + /// Script execution status. + /// Possible values include: 'Unknown', 'Pending', 'Running', 'Failed', + /// 'Succeeded', 'TimedOut', 'Canceled' + + /// Communicate script configuration errors or execution messages. + /// + + /// Exit code returned from script execution. + /// + + /// Script output stream. + /// + + /// Script error stream. + /// + + /// Script start time. + /// + + /// Script end time. + /// + + /// The resource status information. + /// + public VirtualMachineRunCommandInstanceView(string executionState = default(string), string executionMessage = default(string), int? exitCode = default(int?), string output = default(string), string error = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), System.Collections.Generic.IList statuses = default(System.Collections.Generic.IList)) + { - ExecutionState = executionState; - ExecutionMessage = executionMessage; - ExitCode = exitCode; - Output = output; - Error = error; - StartTime = startTime; - EndTime = endTime; - Statuses = statuses; + this.ExecutionState = executionState; + this.ExecutionMessage = executionMessage; + this.ExitCode = exitCode; + this.Output = output; + this.Error = error; + this.StartTime = startTime; + this.EndTime = endTime; + this.Statuses = statuses; CustomInit(); } @@ -63,56 +67,53 @@ public VirtualMachineRunCommandInstanceView() /// partial void CustomInit(); + /// - /// Gets or sets script execution status. Possible values include: - /// 'Unknown', 'Pending', 'Running', 'Failed', 'Succeeded', 'TimedOut', - /// 'Canceled' + /// Gets or sets script execution status. Possible values include: 'Unknown', 'Pending', 'Running', 'Failed', 'Succeeded', 'TimedOut', 'Canceled' /// - [JsonProperty(PropertyName = "executionState")] - public string ExecutionState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "executionState")] + public string ExecutionState {get; set; } /// - /// Gets or sets communicate script configuration errors or execution - /// messages. + /// Gets or sets communicate script configuration errors or execution messages. /// - [JsonProperty(PropertyName = "executionMessage")] - public string ExecutionMessage { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "executionMessage")] + public string ExecutionMessage {get; set; } /// /// Gets or sets exit code returned from script execution. /// - [JsonProperty(PropertyName = "exitCode")] - public int? ExitCode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "exitCode")] + public int? ExitCode {get; set; } /// /// Gets or sets script output stream. /// - [JsonProperty(PropertyName = "output")] - public string Output { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "output")] + public string Output {get; set; } /// /// Gets or sets script error stream. /// - [JsonProperty(PropertyName = "error")] - public string Error { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public string Error {get; set; } /// /// Gets or sets script start time. /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime {get; set; } /// /// Gets or sets script end time. /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTime? EndTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime {get; set; } /// /// Gets or sets the resource status information. /// - [JsonProperty(PropertyName = "statuses")] - public IList Statuses { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "statuses")] + public System.Collections.Generic.IList Statuses {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandProperties.cs new file mode 100644 index 000000000000..97b060a1840f --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandProperties.cs @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a Virtual Machine run command. + /// + public partial class VirtualMachineRunCommandProperties + { + /// + /// Initializes a new instance of the VirtualMachineRunCommandProperties class. + /// + public VirtualMachineRunCommandProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineRunCommandProperties class. + /// + + /// The source of the run command script. + /// + + /// The parameters used by the script. + /// + + /// The parameters used by the script. + /// + + /// Optional. If set to true, provisioning will complete as soon as the script + /// starts and will not wait for script to complete. + /// + + /// Specifies the user account on the VM when executing the run command. + /// + + /// Specifies the user account password on the VM when executing the run + /// command. + /// + + /// The timeout in seconds to execute the run command. + /// + + /// Specifies the Azure storage blob where script output stream will be + /// uploaded. Use a SAS URI with read, append, create, write access OR use + /// managed identity to provide the VM access to the blob. Refer + /// outputBlobManagedIdentity parameter. + /// + + /// Specifies the Azure storage blob where script error stream will be + /// uploaded. Use a SAS URI with read, append, create, write access OR use + /// managed identity to provide the VM access to the blob. Refer + /// errorBlobManagedIdentity parameter. + /// + + /// User-assigned managed identity that has access to outputBlobUri storage + /// blob. Use an empty object in case of system-assigned identity. Make sure + /// managed identity has been given access to blob's container with 'Storage + /// Blob Data Contributor' role assignment. In case of user-assigned identity, + /// make sure you add it under VM's identity. For more info on managed identity + /// and Run Command, refer https://aka.ms/ManagedIdentity and + /// https://aka.ms/RunCommandManaged + /// + + /// User-assigned managed identity that has access to errorBlobUri storage + /// blob. Use an empty object in case of system-assigned identity. Make sure + /// managed identity has been given access to blob's container with 'Storage + /// Blob Data Contributor' role assignment. In case of user-assigned identity, + /// make sure you add it under VM's identity. For more info on managed identity + /// and Run Command, refer https://aka.ms/ManagedIdentity and + /// https://aka.ms/RunCommandManaged + /// + + /// The provisioning state, which only appears in the response. If + /// treatFailureAsDeploymentFailure set to true, any failure in the script will + /// fail the deployment and ProvisioningState will be marked as Failed. If + /// treatFailureAsDeploymentFailure set to false, ProvisioningState would only + /// reflect whether the run command was run or not by the extensions platform, + /// it would not indicate whether script failed in case of script failures. See + /// instance view of run command in case of script failures to see + /// executionMessage, output, error: + /// https://aka.ms/runcommandmanaged#get-execution-status-and-results + /// + + /// The virtual machine run command instance view. + /// + + /// Optional. If set to true, any failure in the script will fail the + /// deployment and ProvisioningState will be marked as Failed. If set to false, + /// ProvisioningState would only reflect whether the run command was run or not + /// by the extensions platform, it would not indicate whether script failed in + /// case of script failures. See instance view of run command in case of script + /// failures to see executionMessage, output, error: + /// https://aka.ms/runcommandmanaged#get-execution-status-and-results + /// + public VirtualMachineRunCommandProperties(VirtualMachineRunCommandScriptSource source = default(VirtualMachineRunCommandScriptSource), System.Collections.Generic.IList parameters = default(System.Collections.Generic.IList), System.Collections.Generic.IList protectedParameters = default(System.Collections.Generic.IList), bool? asyncExecution = default(bool?), string runAsUser = default(string), string runAsPassword = default(string), int? timeoutInSeconds = default(int?), string outputBlobUri = default(string), string errorBlobUri = default(string), RunCommandManagedIdentity outputBlobManagedIdentity = default(RunCommandManagedIdentity), RunCommandManagedIdentity errorBlobManagedIdentity = default(RunCommandManagedIdentity), string provisioningState = default(string), VirtualMachineRunCommandInstanceView instanceView = default(VirtualMachineRunCommandInstanceView), bool? treatFailureAsDeploymentFailure = default(bool?)) + + { + this.Source = source; + this.Parameters = parameters; + this.ProtectedParameters = protectedParameters; + this.AsyncExecution = asyncExecution; + this.RunAsUser = runAsUser; + this.RunAsPassword = runAsPassword; + this.TimeoutInSeconds = timeoutInSeconds; + this.OutputBlobUri = outputBlobUri; + this.ErrorBlobUri = errorBlobUri; + this.OutputBlobManagedIdentity = outputBlobManagedIdentity; + this.ErrorBlobManagedIdentity = errorBlobManagedIdentity; + this.ProvisioningState = provisioningState; + this.InstanceView = instanceView; + this.TreatFailureAsDeploymentFailure = treatFailureAsDeploymentFailure; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the source of the run command script. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "source")] + public VirtualMachineRunCommandScriptSource Source {get; set; } + + /// + /// Gets or sets the parameters used by the script. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "parameters")] + public System.Collections.Generic.IList Parameters {get; set; } + + /// + /// Gets or sets the parameters used by the script. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protectedParameters")] + public System.Collections.Generic.IList ProtectedParameters {get; set; } + + /// + /// Gets or sets optional. If set to true, provisioning will complete as soon + /// as the script starts and will not wait for script to complete. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "asyncExecution")] + public bool? AsyncExecution {get; set; } + + /// + /// Gets or sets specifies the user account on the VM when executing the run + /// command. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "runAsUser")] + public string RunAsUser {get; set; } + + /// + /// Gets or sets specifies the user account password on the VM when executing + /// the run command. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "runAsPassword")] + public string RunAsPassword {get; set; } + + /// + /// Gets or sets the timeout in seconds to execute the run command. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeoutInSeconds")] + public int? TimeoutInSeconds {get; set; } + + /// + /// Gets or sets specifies the Azure storage blob where script output stream + /// will be uploaded. Use a SAS URI with read, append, create, write access OR + /// use managed identity to provide the VM access to the blob. Refer + /// outputBlobManagedIdentity parameter. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "outputBlobUri")] + public string OutputBlobUri {get; set; } + + /// + /// Gets or sets specifies the Azure storage blob where script error stream + /// will be uploaded. Use a SAS URI with read, append, create, write access OR + /// use managed identity to provide the VM access to the blob. Refer + /// errorBlobManagedIdentity parameter. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "errorBlobUri")] + public string ErrorBlobUri {get; set; } + + /// + /// Gets or sets user-assigned managed identity that has access to + /// outputBlobUri storage blob. Use an empty object in case of system-assigned + /// identity. Make sure managed identity has been given access to blob's + /// container with 'Storage Blob Data Contributor' role assignment. In case of + /// user-assigned identity, make sure you add it under VM's identity. For more + /// info on managed identity and Run Command, refer + /// https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "outputBlobManagedIdentity")] + public RunCommandManagedIdentity OutputBlobManagedIdentity {get; set; } + + /// + /// Gets or sets user-assigned managed identity that has access to errorBlobUri + /// storage blob. Use an empty object in case of system-assigned identity. Make + /// sure managed identity has been given access to blob's container with + /// 'Storage Blob Data Contributor' role assignment. In case of user-assigned + /// identity, make sure you add it under VM's identity. For more info on + /// managed identity and Run Command, refer https://aka.ms/ManagedIdentity and + /// https://aka.ms/RunCommandManaged + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "errorBlobManagedIdentity")] + public RunCommandManagedIdentity ErrorBlobManagedIdentity {get; set; } + + /// + /// Gets the provisioning state, which only appears in the response. If + /// treatFailureAsDeploymentFailure set to true, any failure in the script will + /// fail the deployment and ProvisioningState will be marked as Failed. If + /// treatFailureAsDeploymentFailure set to false, ProvisioningState would only + /// reflect whether the run command was run or not by the extensions platform, + /// it would not indicate whether script failed in case of script failures. See + /// instance view of run command in case of script failures to see + /// executionMessage, output, error: + /// https://aka.ms/runcommandmanaged#get-execution-status-and-results + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets the virtual machine run command instance view. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "instanceView")] + public VirtualMachineRunCommandInstanceView InstanceView {get; private set; } + + /// + /// Gets or sets optional. If set to true, any failure in the script will fail + /// the deployment and ProvisioningState will be marked as Failed. If set to + /// false, ProvisioningState would only reflect whether the run command was run + /// or not by the extensions platform, it would not indicate whether script + /// failed in case of script failures. See instance view of run command in case + /// of script failures to see executionMessage, output, error: + /// https://aka.ms/runcommandmanaged#get-execution-status-and-results + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "treatFailureAsDeploymentFailure")] + public bool? TreatFailureAsDeploymentFailure {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandScriptSource.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandScriptSource.cs index 6a85c8a6b7dd..590ec64b1513 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandScriptSource.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandScriptSource.cs @@ -1,27 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Describes the script sources for run command. Use only one of these - /// script sources: script, scriptUri, commandId, galleryScriptReferenceId. + /// Describes the script sources for run command. Use only one of these script + /// sources: script, scriptUri, commandId, galleryScriptReferenceId. /// public partial class VirtualMachineRunCommandScriptSource { /// - /// Initializes a new instance of the - /// VirtualMachineRunCommandScriptSource class. + /// Initializes a new instance of the VirtualMachineRunCommandScriptSource class. /// public VirtualMachineRunCommandScriptSource() { @@ -29,45 +22,50 @@ public VirtualMachineRunCommandScriptSource() } /// - /// Initializes a new instance of the - /// VirtualMachineRunCommandScriptSource class. + /// Initializes a new instance of the VirtualMachineRunCommandScriptSource class. /// - /// Specifies the script content to be executed on - /// the VM. - /// Specifies the script download location. It - /// can be either SAS URI of an Azure storage blob with read access or - /// public URI. - /// Specifies a commandId of predefined - /// built-in script. Command IDs available for Linux are listed at - /// https://aka.ms/RunCommandManagedLinux#available-commands, Windows - /// at - /// https://aka.ms/RunCommandManagedWindows#available-commands. - /// User-assigned managed - /// identity that has access to scriptUri in case of Azure storage - /// blob. Use an empty object in case of system-assigned identity. Make - /// sure the Azure storage blob exists, and managed identity has been - /// given access to blob's container with 'Storage Blob Data Reader' - /// role assignment. In case of user-assigned identity, make sure you - /// add it under VM's identity. For more info on managed identity and - /// Run Command, refer https://aka.ms/ManagedIdentity and - /// https://aka.ms/RunCommandManaged. - /// Optional. Specify which shell to use for - /// running the script. These values must match those expected by the - /// extension. Currently supported only for Windows VMs, script uses - /// Powershell 7 when specified. Powershell 7 must be already installed - /// on the machine to use Powershell7 parameter value. Possible values - /// include: 'Default', 'Powershell7' - /// The resource ID of a Gallery - /// Script version that needs to be executed. Example ID looks like - /// /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{scriptName}/versions/{version}. + + /// Specifies the script content to be executed on the VM. + /// + + /// Specifies the script download location. It can be either SAS URI of an + /// Azure storage blob with read access or public URI. + /// + + /// Specifies a commandId of predefined built-in script. Command IDs available + /// for Linux are listed at + /// https://aka.ms/RunCommandManagedLinux#available-commands, Windows at + /// https://aka.ms/RunCommandManagedWindows#available-commands. + /// + + /// User-assigned managed identity that has access to scriptUri in case of + /// Azure storage blob. Use an empty object in case of system-assigned + /// identity. Make sure the Azure storage blob exists, and managed identity has + /// been given access to blob's container with 'Storage Blob Data Reader' role + /// assignment. In case of user-assigned identity, make sure you add it under + /// VM's identity. For more info on managed identity and Run Command, refer + /// https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + /// + + /// Optional. Specify which shell to use for running the script. These values + /// must match those expected by the extension. Currently supported only for + /// Windows VMs, script uses Powershell 7 when specified. Powershell 7 must be + /// already installed on the machine to use Powershell7 parameter value. + /// Possible values include: 'Default', 'Powershell7' + + /// The resource ID of a Gallery Script version that needs to be executed. + /// Example ID looks like + /// /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{scriptName}/versions/{version}. + /// public VirtualMachineRunCommandScriptSource(string script = default(string), string scriptUri = default(string), string commandId = default(string), RunCommandManagedIdentity scriptUriManagedIdentity = default(RunCommandManagedIdentity), string scriptShell = default(string), string galleryScriptReferenceId = default(string)) + { - Script = script; - ScriptUri = scriptUri; - CommandId = commandId; - ScriptUriManagedIdentity = scriptUriManagedIdentity; - ScriptShell = scriptShell; - GalleryScriptReferenceId = galleryScriptReferenceId; + this.Script = script; + this.ScriptUri = scriptUri; + this.CommandId = commandId; + this.ScriptUriManagedIdentity = scriptUriManagedIdentity; + this.ScriptShell = scriptShell; + this.GalleryScriptReferenceId = galleryScriptReferenceId; CustomInit(); } @@ -76,61 +74,57 @@ public VirtualMachineRunCommandScriptSource() /// partial void CustomInit(); + /// /// Gets or sets specifies the script content to be executed on the VM. /// - [JsonProperty(PropertyName = "script")] - public string Script { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "script")] + public string Script {get; set; } /// - /// Gets or sets specifies the script download location. It can be - /// either SAS URI of an Azure storage blob with read access or public - /// URI. + /// Gets or sets specifies the script download location. It can be either SAS + /// URI of an Azure storage blob with read access or public URI. /// - [JsonProperty(PropertyName = "scriptUri")] - public string ScriptUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "scriptUri")] + public string ScriptUri {get; set; } /// - /// Gets or sets specifies a commandId of predefined built-in script. - /// Command IDs available for Linux are listed at - /// https://aka.ms/RunCommandManagedLinux#available-commands, Windows - /// at https://aka.ms/RunCommandManagedWindows#available-commands. + /// Gets or sets specifies a commandId of predefined built-in script. Command + /// IDs available for Linux are listed at + /// https://aka.ms/RunCommandManagedLinux#available-commands, Windows at + /// https://aka.ms/RunCommandManagedWindows#available-commands. /// - [JsonProperty(PropertyName = "commandId")] - public string CommandId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "commandId")] + public string CommandId {get; set; } /// - /// Gets or sets user-assigned managed identity that has access to - /// scriptUri in case of Azure storage blob. Use an empty object in - /// case of system-assigned identity. Make sure the Azure storage blob - /// exists, and managed identity has been given access to blob's - /// container with 'Storage Blob Data Reader' role assignment. In case - /// of user-assigned identity, make sure you add it under VM's - /// identity. For more info on managed identity and Run Command, refer - /// https://aka.ms/ManagedIdentity and - /// https://aka.ms/RunCommandManaged. + /// Gets or sets user-assigned managed identity that has access to scriptUri in + /// case of Azure storage blob. Use an empty object in case of system-assigned + /// identity. Make sure the Azure storage blob exists, and managed identity has + /// been given access to blob's container with 'Storage Blob Data Reader' role + /// assignment. In case of user-assigned identity, make sure you add it under + /// VM's identity. For more info on managed identity and Run Command, refer + /// https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. /// - [JsonProperty(PropertyName = "scriptUriManagedIdentity")] - public RunCommandManagedIdentity ScriptUriManagedIdentity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "scriptUriManagedIdentity")] + public RunCommandManagedIdentity ScriptUriManagedIdentity {get; set; } /// - /// Gets or sets optional. Specify which shell to use for running the - /// script. These values must match those expected by the extension. - /// Currently supported only for Windows VMs, script uses Powershell 7 - /// when specified. Powershell 7 must be already installed on the - /// machine to use Powershell7 parameter value. Possible values - /// include: 'Default', 'Powershell7' + /// Gets or sets optional. Specify which shell to use for running the script. + /// These values must match those expected by the extension. Currently + /// supported only for Windows VMs, script uses Powershell 7 when specified. + /// Powershell 7 must be already installed on the machine to use Powershell7 + /// parameter value. Possible values include: 'Default', 'Powershell7' /// - [JsonProperty(PropertyName = "scriptShell")] - public string ScriptShell { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "scriptShell")] + public string ScriptShell {get; set; } /// - /// Gets or sets the resource ID of a Gallery Script version that needs - /// to be executed. Example ID looks like + /// Gets or sets the resource ID of a Gallery Script version that needs to be + /// executed. Example ID looks like /// /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{scriptName}/versions/{version}. /// - [JsonProperty(PropertyName = "galleryScriptReferenceId")] - public string GalleryScriptReferenceId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "galleryScriptReferenceId")] + public string GalleryScriptReferenceId {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandUpdate.cs index 3a54ac63c34f..c80519ef6771 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandUpdate.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Describes a Virtual Machine run command. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachineRunCommandUpdate : UpdateResource { /// - /// Initializes a new instance of the VirtualMachineRunCommandUpdate - /// class. + /// Initializes a new instance of the VirtualMachineRunCommandUpdate class. /// public VirtualMachineRunCommandUpdate() { @@ -33,89 +22,105 @@ public VirtualMachineRunCommandUpdate() } /// - /// Initializes a new instance of the VirtualMachineRunCommandUpdate - /// class. - /// - /// Resource tags - /// The source of the run command script. - /// The parameters used by the script. - /// The parameters used by the - /// script. - /// Optional. If set to true, provisioning - /// will complete as soon as the script starts and will not wait for - /// script to complete. - /// Specifies the user account on the VM when - /// executing the run command. - /// Specifies the user account password on - /// the VM when executing the run command. - /// The timeout in seconds to execute - /// the run command. - /// Specifies the Azure storage blob where - /// script output stream will be uploaded. Use a SAS URI with read, - /// append, create, write access OR use managed identity to provide the - /// VM access to the blob. Refer outputBlobManagedIdentity - /// parameter. - /// Specifies the Azure storage blob where - /// script error stream will be uploaded. Use a SAS URI with read, - /// append, create, write access OR use managed identity to provide the - /// VM access to the blob. Refer errorBlobManagedIdentity - /// parameter. - /// User-assigned managed - /// identity that has access to outputBlobUri storage blob. Use an - /// empty object in case of system-assigned identity. Make sure managed - /// identity has been given access to blob's container with 'Storage - /// Blob Data Contributor' role assignment. In case of user-assigned - /// identity, make sure you add it under VM's identity. For more info - /// on managed identity and Run Command, refer - /// https://aka.ms/ManagedIdentity and - /// https://aka.ms/RunCommandManaged - /// User-assigned managed - /// identity that has access to errorBlobUri storage blob. Use an empty - /// object in case of system-assigned identity. Make sure managed - /// identity has been given access to blob's container with 'Storage - /// Blob Data Contributor' role assignment. In case of user-assigned - /// identity, make sure you add it under VM's identity. For more info - /// on managed identity and Run Command, refer - /// https://aka.ms/ManagedIdentity and - /// https://aka.ms/RunCommandManaged - /// The provisioning state, which only - /// appears in the response. If treatFailureAsDeploymentFailure set to - /// true, any failure in the script will fail the deployment and - /// ProvisioningState will be marked as Failed. If - /// treatFailureAsDeploymentFailure set to false, ProvisioningState - /// would only reflect whether the run command was run or not by the - /// extensions platform, it would not indicate whether script failed in - /// case of script failures. See instance view of run command in case - /// of script failures to see executionMessage, output, error: - /// https://aka.ms/runcommandmanaged#get-execution-status-and-results - /// The virtual machine run command instance - /// view. - /// Optional. If set to - /// true, any failure in the script will fail the deployment and - /// ProvisioningState will be marked as Failed. If set to false, - /// ProvisioningState would only reflect whether the run command was - /// run or not by the extensions platform, it would not indicate - /// whether script failed in case of script failures. See instance view - /// of run command in case of script failures to see executionMessage, - /// output, error: - /// https://aka.ms/runcommandmanaged#get-execution-status-and-results - public VirtualMachineRunCommandUpdate(IDictionary tags = default(IDictionary), VirtualMachineRunCommandScriptSource source = default(VirtualMachineRunCommandScriptSource), IList parameters = default(IList), IList protectedParameters = default(IList), bool? asyncExecution = default(bool?), string runAsUser = default(string), string runAsPassword = default(string), int? timeoutInSeconds = default(int?), string outputBlobUri = default(string), string errorBlobUri = default(string), RunCommandManagedIdentity outputBlobManagedIdentity = default(RunCommandManagedIdentity), RunCommandManagedIdentity errorBlobManagedIdentity = default(RunCommandManagedIdentity), string provisioningState = default(string), VirtualMachineRunCommandInstanceView instanceView = default(VirtualMachineRunCommandInstanceView), bool? treatFailureAsDeploymentFailure = default(bool?)) - : base(tags) + /// Initializes a new instance of the VirtualMachineRunCommandUpdate class. + /// + + /// Resource tags + /// + + /// The source of the run command script. + /// + + /// The parameters used by the script. + /// + + /// The parameters used by the script. + /// + + /// Optional. If set to true, provisioning will complete as soon as the script + /// starts and will not wait for script to complete. + /// + + /// Specifies the user account on the VM when executing the run command. + /// + + /// Specifies the user account password on the VM when executing the run + /// command. + /// + + /// The timeout in seconds to execute the run command. + /// + + /// Specifies the Azure storage blob where script output stream will be + /// uploaded. Use a SAS URI with read, append, create, write access OR use + /// managed identity to provide the VM access to the blob. Refer + /// outputBlobManagedIdentity parameter. + /// + + /// Specifies the Azure storage blob where script error stream will be + /// uploaded. Use a SAS URI with read, append, create, write access OR use + /// managed identity to provide the VM access to the blob. Refer + /// errorBlobManagedIdentity parameter. + /// + + /// User-assigned managed identity that has access to outputBlobUri storage + /// blob. Use an empty object in case of system-assigned identity. Make sure + /// managed identity has been given access to blob's container with 'Storage + /// Blob Data Contributor' role assignment. In case of user-assigned identity, + /// make sure you add it under VM's identity. For more info on managed identity + /// and Run Command, refer https://aka.ms/ManagedIdentity and + /// https://aka.ms/RunCommandManaged + /// + + /// User-assigned managed identity that has access to errorBlobUri storage + /// blob. Use an empty object in case of system-assigned identity. Make sure + /// managed identity has been given access to blob's container with 'Storage + /// Blob Data Contributor' role assignment. In case of user-assigned identity, + /// make sure you add it under VM's identity. For more info on managed identity + /// and Run Command, refer https://aka.ms/ManagedIdentity and + /// https://aka.ms/RunCommandManaged + /// + + /// The provisioning state, which only appears in the response. If + /// treatFailureAsDeploymentFailure set to true, any failure in the script will + /// fail the deployment and ProvisioningState will be marked as Failed. If + /// treatFailureAsDeploymentFailure set to false, ProvisioningState would only + /// reflect whether the run command was run or not by the extensions platform, + /// it would not indicate whether script failed in case of script failures. See + /// instance view of run command in case of script failures to see + /// executionMessage, output, error: + /// https://aka.ms/runcommandmanaged#get-execution-status-and-results + /// + + /// The virtual machine run command instance view. + /// + + /// Optional. If set to true, any failure in the script will fail the + /// deployment and ProvisioningState will be marked as Failed. If set to false, + /// ProvisioningState would only reflect whether the run command was run or not + /// by the extensions platform, it would not indicate whether script failed in + /// case of script failures. See instance view of run command in case of script + /// failures to see executionMessage, output, error: + /// https://aka.ms/runcommandmanaged#get-execution-status-and-results + /// + public VirtualMachineRunCommandUpdate(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), VirtualMachineRunCommandScriptSource source = default(VirtualMachineRunCommandScriptSource), System.Collections.Generic.IList parameters = default(System.Collections.Generic.IList), System.Collections.Generic.IList protectedParameters = default(System.Collections.Generic.IList), bool? asyncExecution = default(bool?), string runAsUser = default(string), string runAsPassword = default(string), int? timeoutInSeconds = default(int?), string outputBlobUri = default(string), string errorBlobUri = default(string), RunCommandManagedIdentity outputBlobManagedIdentity = default(RunCommandManagedIdentity), RunCommandManagedIdentity errorBlobManagedIdentity = default(RunCommandManagedIdentity), string provisioningState = default(string), VirtualMachineRunCommandInstanceView instanceView = default(VirtualMachineRunCommandInstanceView), bool? treatFailureAsDeploymentFailure = default(bool?)) + + : base(tags) { - Source = source; - Parameters = parameters; - ProtectedParameters = protectedParameters; - AsyncExecution = asyncExecution; - RunAsUser = runAsUser; - RunAsPassword = runAsPassword; - TimeoutInSeconds = timeoutInSeconds; - OutputBlobUri = outputBlobUri; - ErrorBlobUri = errorBlobUri; - OutputBlobManagedIdentity = outputBlobManagedIdentity; - ErrorBlobManagedIdentity = errorBlobManagedIdentity; - ProvisioningState = provisioningState; - InstanceView = instanceView; - TreatFailureAsDeploymentFailure = treatFailureAsDeploymentFailure; + this.Source = source; + this.Parameters = parameters; + this.ProtectedParameters = protectedParameters; + this.AsyncExecution = asyncExecution; + this.RunAsUser = runAsUser; + this.RunAsPassword = runAsPassword; + this.TimeoutInSeconds = timeoutInSeconds; + this.OutputBlobUri = outputBlobUri; + this.ErrorBlobUri = errorBlobUri; + this.OutputBlobManagedIdentity = outputBlobManagedIdentity; + this.ErrorBlobManagedIdentity = errorBlobManagedIdentity; + this.ProvisioningState = provisioningState; + this.InstanceView = instanceView; + this.TreatFailureAsDeploymentFailure = treatFailureAsDeploymentFailure; CustomInit(); } @@ -124,129 +129,124 @@ public VirtualMachineRunCommandUpdate() /// partial void CustomInit(); + /// /// Gets or sets the source of the run command script. /// - [JsonProperty(PropertyName = "properties.source")] - public VirtualMachineRunCommandScriptSource Source { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.source")] + public VirtualMachineRunCommandScriptSource Source {get; set; } /// /// Gets or sets the parameters used by the script. /// - [JsonProperty(PropertyName = "properties.parameters")] - public IList Parameters { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.parameters")] + public System.Collections.Generic.IList Parameters {get; set; } /// /// Gets or sets the parameters used by the script. /// - [JsonProperty(PropertyName = "properties.protectedParameters")] - public IList ProtectedParameters { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protectedParameters")] + public System.Collections.Generic.IList ProtectedParameters {get; set; } /// - /// Gets or sets optional. If set to true, provisioning will complete - /// as soon as the script starts and will not wait for script to - /// complete. + /// Gets or sets optional. If set to true, provisioning will complete as soon + /// as the script starts and will not wait for script to complete. /// - [JsonProperty(PropertyName = "properties.asyncExecution")] - public bool? AsyncExecution { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.asyncExecution")] + public bool? AsyncExecution {get; set; } /// - /// Gets or sets specifies the user account on the VM when executing - /// the run command. + /// Gets or sets specifies the user account on the VM when executing the run + /// command. /// - [JsonProperty(PropertyName = "properties.runAsUser")] - public string RunAsUser { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.runAsUser")] + public string RunAsUser {get; set; } /// - /// Gets or sets specifies the user account password on the VM when - /// executing the run command. + /// Gets or sets specifies the user account password on the VM when executing + /// the run command. /// - [JsonProperty(PropertyName = "properties.runAsPassword")] - public string RunAsPassword { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.runAsPassword")] + public string RunAsPassword {get; set; } /// /// Gets or sets the timeout in seconds to execute the run command. /// - [JsonProperty(PropertyName = "properties.timeoutInSeconds")] - public int? TimeoutInSeconds { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeoutInSeconds")] + public int? TimeoutInSeconds {get; set; } /// - /// Gets or sets specifies the Azure storage blob where script output - /// stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to - /// the blob. Refer outputBlobManagedIdentity parameter. + /// Gets or sets specifies the Azure storage blob where script output stream + /// will be uploaded. Use a SAS URI with read, append, create, write access OR + /// use managed identity to provide the VM access to the blob. Refer + /// outputBlobManagedIdentity parameter. /// - [JsonProperty(PropertyName = "properties.outputBlobUri")] - public string OutputBlobUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outputBlobUri")] + public string OutputBlobUri {get; set; } /// - /// Gets or sets specifies the Azure storage blob where script error - /// stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to - /// the blob. Refer errorBlobManagedIdentity parameter. + /// Gets or sets specifies the Azure storage blob where script error stream + /// will be uploaded. Use a SAS URI with read, append, create, write access OR + /// use managed identity to provide the VM access to the blob. Refer + /// errorBlobManagedIdentity parameter. /// - [JsonProperty(PropertyName = "properties.errorBlobUri")] - public string ErrorBlobUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.errorBlobUri")] + public string ErrorBlobUri {get; set; } /// /// Gets or sets user-assigned managed identity that has access to - /// outputBlobUri storage blob. Use an empty object in case of - /// system-assigned identity. Make sure managed identity has been given - /// access to blob's container with 'Storage Blob Data Contributor' - /// role assignment. In case of user-assigned identity, make sure you - /// add it under VM's identity. For more info on managed identity and - /// Run Command, refer https://aka.ms/ManagedIdentity and + /// outputBlobUri storage blob. Use an empty object in case of system-assigned + /// identity. Make sure managed identity has been given access to blob's + /// container with 'Storage Blob Data Contributor' role assignment. In case of + /// user-assigned identity, make sure you add it under VM's identity. For more + /// info on managed identity and Run Command, refer + /// https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.outputBlobManagedIdentity")] + public RunCommandManagedIdentity OutputBlobManagedIdentity {get; set; } + + /// + /// Gets or sets user-assigned managed identity that has access to errorBlobUri + /// storage blob. Use an empty object in case of system-assigned identity. Make + /// sure managed identity has been given access to blob's container with + /// 'Storage Blob Data Contributor' role assignment. In case of user-assigned + /// identity, make sure you add it under VM's identity. For more info on + /// managed identity and Run Command, refer https://aka.ms/ManagedIdentity and /// https://aka.ms/RunCommandManaged /// - [JsonProperty(PropertyName = "properties.outputBlobManagedIdentity")] - public RunCommandManagedIdentity OutputBlobManagedIdentity { get; set; } - - /// - /// Gets or sets user-assigned managed identity that has access to - /// errorBlobUri storage blob. Use an empty object in case of - /// system-assigned identity. Make sure managed identity has been given - /// access to blob's container with 'Storage Blob Data Contributor' - /// role assignment. In case of user-assigned identity, make sure you - /// add it under VM's identity. For more info on managed identity and - /// Run Command, refer https://aka.ms/ManagedIdentity and - /// https://aka.ms/RunCommandManaged - /// - [JsonProperty(PropertyName = "properties.errorBlobManagedIdentity")] - public RunCommandManagedIdentity ErrorBlobManagedIdentity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.errorBlobManagedIdentity")] + public RunCommandManagedIdentity ErrorBlobManagedIdentity {get; set; } /// /// Gets the provisioning state, which only appears in the response. If - /// treatFailureAsDeploymentFailure set to true, any failure in the - /// script will fail the deployment and ProvisioningState will be - /// marked as Failed. If treatFailureAsDeploymentFailure set to false, - /// ProvisioningState would only reflect whether the run command was - /// run or not by the extensions platform, it would not indicate - /// whether script failed in case of script failures. See instance view - /// of run command in case of script failures to see executionMessage, - /// output, error: + /// treatFailureAsDeploymentFailure set to true, any failure in the script will + /// fail the deployment and ProvisioningState will be marked as Failed. If + /// treatFailureAsDeploymentFailure set to false, ProvisioningState would only + /// reflect whether the run command was run or not by the extensions platform, + /// it would not indicate whether script failed in case of script failures. See + /// instance view of run command in case of script failures to see + /// executionMessage, output, error: /// https://aka.ms/runcommandmanaged#get-execution-status-and-results /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Gets the virtual machine run command instance view. /// - [JsonProperty(PropertyName = "properties.instanceView")] - public VirtualMachineRunCommandInstanceView InstanceView { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.instanceView")] + public VirtualMachineRunCommandInstanceView InstanceView {get; private set; } /// - /// Gets or sets optional. If set to true, any failure in the script - /// will fail the deployment and ProvisioningState will be marked as - /// Failed. If set to false, ProvisioningState would only reflect - /// whether the run command was run or not by the extensions platform, - /// it would not indicate whether script failed in case of script - /// failures. See instance view of run command in case of script - /// failures to see executionMessage, output, error: + /// Gets or sets optional. If set to true, any failure in the script will fail + /// the deployment and ProvisioningState will be marked as Failed. If set to + /// false, ProvisioningState would only reflect whether the run command was run + /// or not by the extensions platform, it would not indicate whether script + /// failed in case of script failures. See instance view of run command in case + /// of script failures to see executionMessage, output, error: /// https://aka.ms/runcommandmanaged#get-execution-status-and-results /// - [JsonProperty(PropertyName = "properties.treatFailureAsDeploymentFailure")] - public bool? TreatFailureAsDeploymentFailure { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.treatFailureAsDeploymentFailure")] + public bool? TreatFailureAsDeploymentFailure {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandsCreateOrUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandsCreateOrUpdateHeaders.cs index a0aed1998267..c7a74f3c758e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandsCreateOrUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandsCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class VirtualMachineRunCommandsCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// VirtualMachineRunCommandsCreateOrUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineRunCommandsCreateOrUpdateHeaders class. /// public VirtualMachineRunCommandsCreateOrUpdateHeaders() { @@ -28,18 +18,19 @@ public VirtualMachineRunCommandsCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// VirtualMachineRunCommandsCreateOrUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineRunCommandsCreateOrUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachineRunCommandsCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachineRunCommandsCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandsUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandsUpdateHeaders.cs index b5a939f36538..f00d7ac0bb5f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandsUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineRunCommandsUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Update operation. - /// public partial class VirtualMachineRunCommandsUpdateHeaders { /// - /// Initializes a new instance of the - /// VirtualMachineRunCommandsUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineRunCommandsUpdateHeaders class. /// public VirtualMachineRunCommandsUpdateHeaders() { @@ -28,18 +18,19 @@ public VirtualMachineRunCommandsUpdateHeaders() } /// - /// Initializes a new instance of the - /// VirtualMachineRunCommandsUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineRunCommandsUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachineRunCommandsUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachineRunCommandsUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSet.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSet.cs index dd406bc3f558..e3a1654770c3 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSet.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSet.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Describes a Virtual Machine Scale Set. /// - [Rest.Serialization.JsonTransformation] - public partial class VirtualMachineScaleSet : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class VirtualMachineScaleSet : TrackedResource { /// /// Initializes a new instance of the VirtualMachineScaleSet class. @@ -34,133 +24,176 @@ public VirtualMachineScaleSet() /// /// Initializes a new instance of the VirtualMachineScaleSet class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// The virtual machine scale set sku. - /// Specifies information about the marketplace - /// image used to create the virtual machine. This element is only used - /// for marketplace images. Before you can use a marketplace image from - /// an API, you must enable the image for programmatic use. In the - /// Azure portal, find the marketplace image that you want to use and - /// then click **Want to deploy programmatically, Get Started ->**. - /// Enter any required information and then click **Save**. - /// The upgrade policy. - /// The - /// ScheduledEventsPolicy. - /// Policy for automatic - /// repairs. - /// The virtual machine - /// profile. - /// The provisioning state, which only - /// appears in the response. - /// Specifies whether the Virtual Machine - /// Scale Set should be overprovisioned. - /// When - /// Overprovision is enabled, extensions are launched only on the - /// requested number of VMs which are finally kept. This property will - /// hence ensure that the extensions do not run on the extra - /// overprovisioned VMs. - /// Specifies the ID which uniquely identifies a - /// Virtual Machine Scale Set. - /// When true this limits the scale - /// set to a single placement group, of max size 100 virtual machines. - /// NOTE: If singlePlacementGroup is true, it may be modified to false. - /// However, if singlePlacementGroup is false, it may not be modified - /// to true. - /// Whether to force strictly even Virtual - /// Machine distribution cross x-zones in case there is zone outage. - /// zoneBalance property can only be set if the zones property of the - /// scale set contains more than one zone. If there are no zones or - /// only one zone specified, then zoneBalance property should not be - /// set. - /// Fault Domain count for each - /// placement group. - /// Specifies information about - /// the proximity placement group that the virtual machine scale set - /// should be assigned to. Minimum api-version: 2018-04-01. - /// Specifies information about the dedicated - /// host group that the virtual machine scale set resides in. Minimum - /// api-version: 2020-06-01. - /// Specifies additional - /// capabilities enabled or disabled on the Virtual Machines in the - /// Virtual Machine Scale Set. For instance: whether the Virtual - /// Machines have the capability to support attaching managed data - /// disks with UltraSSD_LRS storage account type. - /// Specifies the policies applied when - /// scaling in Virtual Machines in the Virtual Machine Scale - /// Set. - /// Specifies the orchestration mode - /// for the virtual machine scale set. Possible values include: - /// 'Uniform', 'Flexible' - /// Specifies the Spot Restore - /// properties for the virtual machine scale set. - /// Specifies the desired targets for - /// mixing Spot and Regular priority VMs within the same VMSS Flex - /// instance. - /// Specifies the time at which the Virtual - /// Machine Scale Set resource was created. Minimum api-version: - /// 2021-11-01. - /// Optional property which - /// must either be set to True or omitted. - /// Policy for Resiliency - /// Specifies the align - /// mode between Virtual Machine Scale Set compute and storage Fault - /// Domain count. Possible values include: 'Aligned', - /// 'Unaligned' - /// Specifies the sku profile for the virtual - /// machine scale set. - /// Specifies the high - /// speed interconnect placement for the virtual machine scale set. - /// Possible values include: 'None', 'Trunk' - /// The identity of the virtual machine scale - /// set, if configured. - /// The availability zones. - /// The extended location of the Virtual - /// Machine Scale Set. - /// Etag is property returned in Create/Update/Get - /// response of the VMSS, so that customer can supply it in the header - /// to ensure optimistic updates - /// Placement section specifies the - /// user-defined constraints for virtual machine scale set hardware - /// placement. This property cannot be changed once VMSS is - /// provisioned. Minimum api-version: 2025-04-01. - public VirtualMachineScaleSet(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), Plan plan = default(Plan), UpgradePolicy upgradePolicy = default(UpgradePolicy), ScheduledEventsPolicy scheduledEventsPolicy = default(ScheduledEventsPolicy), AutomaticRepairsPolicy automaticRepairsPolicy = default(AutomaticRepairsPolicy), VirtualMachineScaleSetVMProfile virtualMachineProfile = default(VirtualMachineScaleSetVMProfile), string provisioningState = default(string), bool? overprovision = default(bool?), bool? doNotRunExtensionsOnOverprovisionedVMs = default(bool?), string uniqueId = default(string), bool? singlePlacementGroup = default(bool?), bool? zoneBalance = default(bool?), int? platformFaultDomainCount = default(int?), SubResource proximityPlacementGroup = default(SubResource), SubResource hostGroup = default(SubResource), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), ScaleInPolicy scaleInPolicy = default(ScaleInPolicy), string orchestrationMode = default(string), SpotRestorePolicy spotRestorePolicy = default(SpotRestorePolicy), PriorityMixPolicy priorityMixPolicy = default(PriorityMixPolicy), System.DateTime? timeCreated = default(System.DateTime?), bool? constrainedMaximumCapacity = default(bool?), ResiliencyPolicy resiliencyPolicy = default(ResiliencyPolicy), string zonalPlatformFaultDomainAlignMode = default(string), SkuProfile skuProfile = default(SkuProfile), string highSpeedInterconnectPlacement = default(string), VirtualMachineScaleSetIdentity identity = default(VirtualMachineScaleSetIdentity), IList zones = default(IList), ExtendedLocation extendedLocation = default(ExtendedLocation), string etag = default(string), Placement placement = default(Placement)) - : base(location, id, name, type, tags) + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// The virtual machine scale set sku. + /// + + /// Specifies information about the marketplace image used to create the + /// virtual machine. This element is only used for marketplace images. Before + /// you can use a marketplace image from an API, you must enable the image for + /// programmatic use. In the Azure portal, find the marketplace image that you + /// want to use and then click **Want to deploy programmatically, Get Started + /// ->**. Enter any required information and then click **Save**. + /// + + /// The identity of the virtual machine scale set, if configured. + /// + + /// The availability zones. + /// + + /// The extended location of the Virtual Machine Scale Set. + /// + + /// Etag is property returned in Create/Update/Get response of the VMSS, so + /// that customer can supply it in the header to ensure optimistic updates + /// + + /// Placement section specifies the user-defined constraints for virtual + /// machine scale set hardware placement. This property cannot be changed once + /// VMSS is provisioned. Minimum api-version: 2025-04-01. + /// + + /// The upgrade policy. + /// + + /// Specifies additional capabilities enabled or disabled on the Virtual + /// Machines in the Virtual Machine Scale Set. For instance: whether the + /// Virtual Machines have the capability to support attaching managed data + /// disks with UltraSSD_LRS storage account type. + /// + + /// Specifies the orchestration mode for the virtual machine scale set. + /// Possible values include: 'Uniform', 'Flexible' + + /// Policy for Resiliency + /// + + /// Specifies the sku profile for the virtual machine scale set. + /// + + /// The ScheduledEventsPolicy. + /// + + /// Policy for automatic repairs. + /// + + /// The virtual machine profile. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// Specifies whether the Virtual Machine Scale Set should be overprovisioned. + /// + + /// When Overprovision is enabled, extensions are launched only on the + /// requested number of VMs which are finally kept. This property will hence + /// ensure that the extensions do not run on the extra overprovisioned VMs. + /// + + /// Specifies the ID which uniquely identifies a Virtual Machine Scale Set. + /// + + /// When true this limits the scale set to a single placement group, of max + /// size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be + /// modified to false. However, if singlePlacementGroup is false, it may not be + /// modified to true. + /// + + /// Whether to force strictly even Virtual Machine distribution cross x-zones + /// in case there is zone outage. zoneBalance property can only be set if the + /// zones property of the scale set contains more than one zone. If there are + /// no zones or only one zone specified, then zoneBalance property should not + /// be set. + /// + + /// Fault Domain count for each placement group. + /// + + /// Specifies information about the proximity placement group that the virtual + /// machine scale set should be assigned to. Minimum api-version: 2018-04-01. + /// + + /// Specifies information about the dedicated host group that the virtual + /// machine scale set resides in. Minimum api-version: 2020-06-01. + /// + + /// Specifies the policies applied when scaling in Virtual Machines in the + /// Virtual Machine Scale Set. + /// + + /// Specifies the Spot Restore properties for the virtual machine scale set. + /// + + /// Specifies the desired targets for mixing Spot and Regular priority VMs + /// within the same VMSS Flex instance. + /// + + /// Specifies the time at which the Virtual Machine Scale Set resource was + /// created. Minimum api-version: 2021-11-01. + /// + + /// Optional property which must either be set to True or omitted. + /// + + /// Specifies the align mode between Virtual Machine Scale Set compute and + /// storage Fault Domain count. + /// Possible values include: 'Aligned', 'Unaligned' + + /// Specifies the high speed interconnect placement for the virtual machine + /// scale set. + /// Possible values include: 'None', 'Trunk' + public VirtualMachineScaleSet(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), Sku sku = default(Sku), Plan plan = default(Plan), VirtualMachineScaleSetIdentity identity = default(VirtualMachineScaleSetIdentity), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), ExtendedLocation extendedLocation = default(ExtendedLocation), string etag = default(string), Placement placement = default(Placement), UpgradePolicy upgradePolicy = default(UpgradePolicy), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), string orchestrationMode = default(string), ResiliencyPolicy resiliencyPolicy = default(ResiliencyPolicy), SkuProfile skuProfile = default(SkuProfile), ScheduledEventsPolicy scheduledEventsPolicy = default(ScheduledEventsPolicy), AutomaticRepairsPolicy automaticRepairsPolicy = default(AutomaticRepairsPolicy), VirtualMachineScaleSetVMProfile virtualMachineProfile = default(VirtualMachineScaleSetVMProfile), string provisioningState = default(string), bool? overprovision = default(bool?), bool? doNotRunExtensionsOnOverprovisionedVms = default(bool?), string uniqueId = default(string), bool? singlePlacementGroup = default(bool?), bool? zoneBalance = default(bool?), int? platformFaultDomainCount = default(int?), SubResource proximityPlacementGroup = default(SubResource), SubResource hostGroup = default(SubResource), ScaleInPolicy scaleInPolicy = default(ScaleInPolicy), SpotRestorePolicy spotRestorePolicy = default(SpotRestorePolicy), PriorityMixPolicy priorityMixPolicy = default(PriorityMixPolicy), System.DateTime? timeCreated = default(System.DateTime?), bool? constrainedMaximumCapacity = default(bool?), string zonalPlatformFaultDomainAlignMode = default(string), string highSpeedInterconnectPlacement = default(string)) + + : base(location, id, name, type, tags) { - Sku = sku; - Plan = plan; - UpgradePolicy = upgradePolicy; - ScheduledEventsPolicy = scheduledEventsPolicy; - AutomaticRepairsPolicy = automaticRepairsPolicy; - VirtualMachineProfile = virtualMachineProfile; - ProvisioningState = provisioningState; - Overprovision = overprovision; - DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; - UniqueId = uniqueId; - SinglePlacementGroup = singlePlacementGroup; - ZoneBalance = zoneBalance; - PlatformFaultDomainCount = platformFaultDomainCount; - ProximityPlacementGroup = proximityPlacementGroup; - HostGroup = hostGroup; - AdditionalCapabilities = additionalCapabilities; - ScaleInPolicy = scaleInPolicy; - OrchestrationMode = orchestrationMode; - SpotRestorePolicy = spotRestorePolicy; - PriorityMixPolicy = priorityMixPolicy; - TimeCreated = timeCreated; - ConstrainedMaximumCapacity = constrainedMaximumCapacity; - ResiliencyPolicy = resiliencyPolicy; - ZonalPlatformFaultDomainAlignMode = zonalPlatformFaultDomainAlignMode; - SkuProfile = skuProfile; - HighSpeedInterconnectPlacement = highSpeedInterconnectPlacement; - Identity = identity; - Zones = zones; - ExtendedLocation = extendedLocation; - Etag = etag; - Placement = placement; + this.Sku = sku; + this.Plan = plan; + this.Identity = identity; + this.Zones = zones; + this.ExtendedLocation = extendedLocation; + this.Etag = etag; + this.Placement = placement; + this.UpgradePolicy = upgradePolicy; + this.AdditionalCapabilities = additionalCapabilities; + this.OrchestrationMode = orchestrationMode; + this.ResiliencyPolicy = resiliencyPolicy; + this.SkuProfile = skuProfile; + this.ScheduledEventsPolicy = scheduledEventsPolicy; + this.AutomaticRepairsPolicy = automaticRepairsPolicy; + this.VirtualMachineProfile = virtualMachineProfile; + this.ProvisioningState = provisioningState; + this.Overprovision = overprovision; + this.DoNotRunExtensionsOnOverprovisionedVms = doNotRunExtensionsOnOverprovisionedVms; + this.UniqueId = uniqueId; + this.SinglePlacementGroup = singlePlacementGroup; + this.ZoneBalance = zoneBalance; + this.PlatformFaultDomainCount = platformFaultDomainCount; + this.ProximityPlacementGroup = proximityPlacementGroup; + this.HostGroup = hostGroup; + this.ScaleInPolicy = scaleInPolicy; + this.SpotRestorePolicy = spotRestorePolicy; + this.PriorityMixPolicy = priorityMixPolicy; + this.TimeCreated = timeCreated; + this.ConstrainedMaximumCapacity = constrainedMaximumCapacity; + this.ZonalPlatformFaultDomainAlignMode = zonalPlatformFaultDomainAlignMode; + this.HighSpeedInterconnectPlacement = highSpeedInterconnectPlacement; CustomInit(); } @@ -169,262 +202,271 @@ public VirtualMachineScaleSet() /// partial void CustomInit(); + /// /// Gets or sets the virtual machine scale set sku. /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public Sku Sku {get; set; } /// - /// Gets or sets specifies information about the marketplace image used - /// to create the virtual machine. This element is only used for - /// marketplace images. Before you can use a marketplace image from an - /// API, you must enable the image for programmatic use. In the Azure - /// portal, find the marketplace image that you want to use and then - /// click **Want to deploy programmatically, Get Started -&gt;**. - /// Enter any required information and then click **Save**. + /// Gets or sets specifies information about the marketplace image used to + /// create the virtual machine. This element is only used for marketplace + /// images. Before you can use a marketplace image from an API, you must enable + /// the image for programmatic use. In the Azure portal, find the marketplace + /// image that you want to use and then click **Want to deploy + /// programmatically, Get Started ->**. Enter any required information and then + /// click **Save**. /// - [JsonProperty(PropertyName = "plan")] - public Plan Plan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "plan")] + public Plan Plan {get; set; } /// - /// Gets or sets the upgrade policy. + /// Gets or sets the identity of the virtual machine scale set, if configured. /// - [JsonProperty(PropertyName = "properties.upgradePolicy")] - public UpgradePolicy UpgradePolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public VirtualMachineScaleSetIdentity Identity {get; set; } /// - /// Gets or sets the ScheduledEventsPolicy. + /// Gets or sets the availability zones. /// - [JsonProperty(PropertyName = "properties.scheduledEventsPolicy")] - public ScheduledEventsPolicy ScheduledEventsPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } /// - /// Gets or sets policy for automatic repairs. + /// Gets or sets the extended location of the Virtual Machine Scale Set. /// - [JsonProperty(PropertyName = "properties.automaticRepairsPolicy")] - public AutomaticRepairsPolicy AutomaticRepairsPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation {get; set; } /// - /// Gets or sets the virtual machine profile. + /// Gets etag is property returned in Create/Update/Get response of the VMSS, + /// so that customer can supply it in the header to ensure optimistic updates /// - [JsonProperty(PropertyName = "properties.virtualMachineProfile")] - public VirtualMachineScaleSetVMProfile VirtualMachineProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets the provisioning state, which only appears in the response. + /// Gets or sets placement section specifies the user-defined constraints for + /// virtual machine scale set hardware placement. This property cannot be + /// changed once VMSS is provisioned. Minimum api-version: 2025-04-01. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "placement")] + public Placement Placement {get; set; } /// - /// Gets or sets specifies whether the Virtual Machine Scale Set should - /// be overprovisioned. + /// Gets or sets the upgrade policy. /// - [JsonProperty(PropertyName = "properties.overprovision")] - public bool? Overprovision { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.upgradePolicy")] + public UpgradePolicy UpgradePolicy {get; set; } /// - /// Gets or sets when Overprovision is enabled, extensions are launched - /// only on the requested number of VMs which are finally kept. This - /// property will hence ensure that the extensions do not run on the - /// extra overprovisioned VMs. + /// Gets or sets specifies additional capabilities enabled or disabled on the + /// Virtual Machines in the Virtual Machine Scale Set. For instance: whether + /// the Virtual Machines have the capability to support attaching managed data + /// disks with UltraSSD_LRS storage account type. /// - [JsonProperty(PropertyName = "properties.doNotRunExtensionsOnOverprovisionedVMs")] - public bool? DoNotRunExtensionsOnOverprovisionedVMs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.additionalCapabilities")] + public AdditionalCapabilities AdditionalCapabilities {get; set; } /// - /// Gets specifies the ID which uniquely identifies a Virtual Machine - /// Scale Set. + /// Gets or sets specifies the orchestration mode for the virtual machine scale + /// set. Possible values include: 'Uniform', 'Flexible' /// - [JsonProperty(PropertyName = "properties.uniqueId")] - public string UniqueId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.orchestrationMode")] + public string OrchestrationMode {get; set; } /// - /// Gets or sets when true this limits the scale set to a single - /// placement group, of max size 100 virtual machines. NOTE: If - /// singlePlacementGroup is true, it may be modified to false. However, - /// if singlePlacementGroup is false, it may not be modified to true. + /// Gets or sets policy for Resiliency /// - [JsonProperty(PropertyName = "properties.singlePlacementGroup")] - public bool? SinglePlacementGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resiliencyPolicy")] + public ResiliencyPolicy ResiliencyPolicy {get; set; } /// - /// Gets or sets whether to force strictly even Virtual Machine - /// distribution cross x-zones in case there is zone outage. - /// zoneBalance property can only be set if the zones property of the - /// scale set contains more than one zone. If there are no zones or - /// only one zone specified, then zoneBalance property should not be - /// set. + /// Gets or sets specifies the sku profile for the virtual machine scale set. /// - [JsonProperty(PropertyName = "properties.zoneBalance")] - public bool? ZoneBalance { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.skuProfile")] + public SkuProfile SkuProfile {get; set; } /// - /// Gets or sets fault Domain count for each placement group. + /// Gets or sets the ScheduledEventsPolicy. /// - [JsonProperty(PropertyName = "properties.platformFaultDomainCount")] - public int? PlatformFaultDomainCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scheduledEventsPolicy")] + public ScheduledEventsPolicy ScheduledEventsPolicy {get; set; } /// - /// Gets or sets specifies information about the proximity placement - /// group that the virtual machine scale set should be assigned to. - /// Minimum api-version: 2018-04-01. + /// Gets or sets policy for automatic repairs. /// - [JsonProperty(PropertyName = "properties.proximityPlacementGroup")] - public SubResource ProximityPlacementGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.automaticRepairsPolicy")] + public AutomaticRepairsPolicy AutomaticRepairsPolicy {get; set; } /// - /// Gets or sets specifies information about the dedicated host group - /// that the virtual machine scale set resides in. Minimum api-version: - /// 2020-06-01. + /// Gets or sets the virtual machine profile. /// - [JsonProperty(PropertyName = "properties.hostGroup")] - public SubResource HostGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachineProfile")] + public VirtualMachineScaleSetVMProfile VirtualMachineProfile {get; set; } /// - /// Gets or sets specifies additional capabilities enabled or disabled - /// on the Virtual Machines in the Virtual Machine Scale Set. For - /// instance: whether the Virtual Machines have the capability to - /// support attaching managed data disks with UltraSSD_LRS storage - /// account type. + /// Gets the provisioning state, which only appears in the response. /// - [JsonProperty(PropertyName = "properties.additionalCapabilities")] - public AdditionalCapabilities AdditionalCapabilities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets specifies the policies applied when scaling in Virtual - /// Machines in the Virtual Machine Scale Set. + /// Gets or sets specifies whether the Virtual Machine Scale Set should be + /// overprovisioned. /// - [JsonProperty(PropertyName = "properties.scaleInPolicy")] - public ScaleInPolicy ScaleInPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.overprovision")] + public bool? Overprovision {get; set; } /// - /// Gets or sets specifies the orchestration mode for the virtual - /// machine scale set. Possible values include: 'Uniform', 'Flexible' + /// Gets or sets when Overprovision is enabled, extensions are launched only on + /// the requested number of VMs which are finally kept. This property will + /// hence ensure that the extensions do not run on the extra overprovisioned + /// VMs. /// - [JsonProperty(PropertyName = "properties.orchestrationMode")] - public string OrchestrationMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.doNotRunExtensionsOnOverprovisionedVMs")] + public bool? DoNotRunExtensionsOnOverprovisionedVms {get; set; } /// - /// Gets or sets specifies the Spot Restore properties for the virtual - /// machine scale set. + /// Gets specifies the ID which uniquely identifies a Virtual Machine Scale + /// Set. /// - [JsonProperty(PropertyName = "properties.spotRestorePolicy")] - public SpotRestorePolicy SpotRestorePolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.uniqueId")] + public string UniqueId {get; private set; } /// - /// Gets or sets specifies the desired targets for mixing Spot and - /// Regular priority VMs within the same VMSS Flex instance. + /// Gets or sets when true this limits the scale set to a single placement + /// group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is + /// true, it may be modified to false. However, if singlePlacementGroup is + /// false, it may not be modified to true. /// - [JsonProperty(PropertyName = "properties.priorityMixPolicy")] - public PriorityMixPolicy PriorityMixPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.singlePlacementGroup")] + public bool? SinglePlacementGroup {get; set; } /// - /// Gets specifies the time at which the Virtual Machine Scale Set - /// resource was created. Minimum api-version: 2021-11-01. + /// Gets or sets whether to force strictly even Virtual Machine distribution + /// cross x-zones in case there is zone outage. zoneBalance property can only + /// be set if the zones property of the scale set contains more than one zone. + /// If there are no zones or only one zone specified, then zoneBalance property + /// should not be set. /// - [JsonProperty(PropertyName = "properties.timeCreated")] - public System.DateTime? TimeCreated { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.zoneBalance")] + public bool? ZoneBalance {get; set; } /// - /// Gets or sets optional property which must either be set to True or - /// omitted. + /// Gets or sets fault Domain count for each placement group. /// - [JsonProperty(PropertyName = "properties.constrainedMaximumCapacity")] - public bool? ConstrainedMaximumCapacity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.platformFaultDomainCount")] + public int? PlatformFaultDomainCount {get; set; } /// - /// Gets or sets policy for Resiliency + /// Gets or sets specifies information about the proximity placement group that + /// the virtual machine scale set should be assigned to. Minimum api-version: + /// 2018-04-01. /// - [JsonProperty(PropertyName = "properties.resiliencyPolicy")] - public ResiliencyPolicy ResiliencyPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.proximityPlacementGroup")] + public SubResource ProximityPlacementGroup {get; set; } /// - /// Gets or sets specifies the align mode between Virtual Machine Scale - /// Set compute and storage Fault Domain count. Possible values - /// include: 'Aligned', 'Unaligned' + /// Gets or sets specifies information about the dedicated host group that the + /// virtual machine scale set resides in. Minimum api-version: 2020-06-01. /// - [JsonProperty(PropertyName = "properties.zonalPlatformFaultDomainAlignMode")] - public string ZonalPlatformFaultDomainAlignMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hostGroup")] + public SubResource HostGroup {get; set; } /// - /// Gets or sets specifies the sku profile for the virtual machine - /// scale set. + /// Gets or sets specifies the policies applied when scaling in Virtual + /// Machines in the Virtual Machine Scale Set. /// - [JsonProperty(PropertyName = "properties.skuProfile")] - public SkuProfile SkuProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scaleInPolicy")] + public ScaleInPolicy ScaleInPolicy {get; set; } /// - /// Gets or sets specifies the high speed interconnect placement for - /// the virtual machine scale set. Possible values include: 'None', - /// 'Trunk' + /// Gets or sets specifies the Spot Restore properties for the virtual machine + /// scale set. /// - [JsonProperty(PropertyName = "properties.highSpeedInterconnectPlacement")] - public string HighSpeedInterconnectPlacement { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.spotRestorePolicy")] + public SpotRestorePolicy SpotRestorePolicy {get; set; } /// - /// Gets or sets the identity of the virtual machine scale set, if - /// configured. + /// Gets or sets specifies the desired targets for mixing Spot and Regular + /// priority VMs within the same VMSS Flex instance. /// - [JsonProperty(PropertyName = "identity")] - public VirtualMachineScaleSetIdentity Identity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priorityMixPolicy")] + public PriorityMixPolicy PriorityMixPolicy {get; set; } /// - /// Gets or sets the availability zones. + /// Gets specifies the time at which the Virtual Machine Scale Set resource was + /// created. Minimum api-version: 2021-11-01. /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeCreated")] + public System.DateTime? TimeCreated {get; private set; } /// - /// Gets or sets the extended location of the Virtual Machine Scale - /// Set. + /// Gets or sets optional property which must either be set to True or omitted. /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.constrainedMaximumCapacity")] + public bool? ConstrainedMaximumCapacity {get; set; } /// - /// Gets etag is property returned in Create/Update/Get response of the - /// VMSS, so that customer can supply it in the header to ensure - /// optimistic updates + /// Gets or sets specifies the align mode between Virtual Machine Scale Set + /// compute and storage Fault Domain count. Possible values include: 'Aligned', 'Unaligned' /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.zonalPlatformFaultDomainAlignMode")] + public string ZonalPlatformFaultDomainAlignMode {get; set; } /// - /// Gets or sets placement section specifies the user-defined - /// constraints for virtual machine scale set hardware placement. This - /// property cannot be changed once VMSS is provisioned. Minimum - /// api-version: 2025-04-01. + /// Gets or sets specifies the high speed interconnect placement for the + /// virtual machine scale set. Possible values include: 'None', 'Trunk' /// - [JsonProperty(PropertyName = "placement")] - public Placement Placement { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.highSpeedInterconnectPlacement")] + public string HighSpeedInterconnectPlacement {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (UpgradePolicy != null) + + + + + + + + if (this.UpgradePolicy != null) { - UpgradePolicy.Validate(); + this.UpgradePolicy.Validate(); } - if (VirtualMachineProfile != null) + + + if (this.ResiliencyPolicy != null) { - VirtualMachineProfile.Validate(); + this.ResiliencyPolicy.Validate(); } - if (PriorityMixPolicy != null) + + + + if (this.VirtualMachineProfile != null) { - PriorityMixPolicy.Validate(); + this.VirtualMachineProfile.Validate(); } - if (ResiliencyPolicy != null) + + + + + + + if (this.PriorityMixPolicy != null) { - ResiliencyPolicy.Validate(); + this.PriorityMixPolicy.Validate(); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetDataDisk.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetDataDisk.cs index 447e9c92ce7b..7f75e40ae2dc 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetDataDisk.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetDataDisk.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetDataDisk { /// - /// Initializes a new instance of the VirtualMachineScaleSetDataDisk - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetDataDisk class. /// public VirtualMachineScaleSetDataDisk() { @@ -29,58 +21,69 @@ public VirtualMachineScaleSetDataDisk() } /// - /// Initializes a new instance of the VirtualMachineScaleSetDataDisk - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetDataDisk class. /// - /// Specifies the logical unit number of the data - /// disk. This value is used to identify data disks within the VM and - /// therefore must be unique for each data disk attached to a - /// VM. - /// The create option. Possible values - /// include: 'FromImage', 'Empty', 'Attach', 'Copy', 'Restore' - /// The disk name. - /// Specifies the caching requirements. Possible - /// values are: **None,** **ReadOnly,** **ReadWrite.** The default - /// values are: **None for Standard storage. ReadOnly for Premium - /// storage.**. Possible values include: 'None', 'ReadOnly', - /// 'ReadWrite' - /// Specifies whether - /// writeAccelerator should be enabled or disabled on the disk. - /// Specifies the size of an empty data disk - /// in gigabytes. This element can be used to overwrite the size of the - /// disk in a virtual machine image. The property diskSizeGB is the - /// number of bytes x 1024^3 for the disk and the value cannot be - /// larger than 1023. - /// The managed disk parameters. - /// Specifies the Read-Write IOPS for - /// the managed disk. Should be used only when StorageAccountType is - /// UltraSSD_LRS. If not specified, a default value would be assigned - /// based on diskSizeGB. - /// Specifies the bandwidth in MB per - /// second for the managed disk. Should be used only when - /// StorageAccountType is UltraSSD_LRS. If not specified, a default - /// value would be assigned based on diskSizeGB. - /// Specifies whether data disk should be - /// deleted or detached upon VMSS Flex deletion (This feature is - /// available for VMSS with Flexible OrchestrationMode - /// only).<br><br> Possible values: <br><br> - /// **Delete** If this value is used, the data disk is deleted when the - /// VMSS Flex VM is deleted.<br><br> **Detach** If this - /// value is used, the data disk is retained after VMSS Flex VM is - /// deleted.<br><br> The default value is set to - /// **Delete**. Possible values include: 'Delete', 'Detach' - public VirtualMachineScaleSetDataDisk(int lun, string createOption, string name = default(string), CachingTypes? caching = default(CachingTypes?), bool? writeAcceleratorEnabled = default(bool?), int? diskSizeGB = default(int?), VirtualMachineScaleSetManagedDiskParameters managedDisk = default(VirtualMachineScaleSetManagedDiskParameters), long? diskIOPSReadWrite = default(long?), long? diskMBpsReadWrite = default(long?), string deleteOption = default(string)) + + /// The disk name. + /// + + /// Specifies the logical unit number of the data disk. This value is used to + /// identify data disks within the VM and therefore must be unique for each + /// data disk attached to a VM. + /// + + /// Specifies the caching requirements. Possible values are: **None,** + /// **ReadOnly,** **ReadWrite.** The default values are: **None for Standard + /// storage. ReadOnly for Premium storage.** + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + + /// Specifies whether writeAccelerator should be enabled or disabled on the + /// disk. + /// + + /// The create option. + /// Possible values include: 'FromImage', 'Empty', 'Attach', 'Copy', 'Restore' + + /// Specifies the size of an empty data disk in gigabytes. This element can be + /// used to overwrite the size of the disk in a virtual machine image. The + /// property diskSizeGB is the number of bytes x 1024^3 for the disk and the + /// value cannot be larger than 1023. + /// + + /// The managed disk parameters. + /// + + /// Specifies the Read-Write IOPS for the managed disk. Should be used only + /// when StorageAccountType is UltraSSD_LRS. If not specified, a default value + /// would be assigned based on diskSizeGB. + /// + + /// Specifies the bandwidth in MB per second for the managed disk. Should be + /// used only when StorageAccountType is UltraSSD_LRS. If not specified, a + /// default value would be assigned based on diskSizeGB. + /// + + /// Specifies whether data disk should be deleted or detached upon VMSS Flex + /// deletion (This feature is available for VMSS with Flexible + /// OrchestrationMode only).<br><br> Possible values: <br><br> **Delete** If + /// this value is used, the data disk is deleted when the VMSS Flex VM is + /// deleted.<br><br> **Detach** If this value is used, the data disk is + /// retained after VMSS Flex VM is deleted.<br><br> The default value is set to + /// **Delete**. + /// Possible values include: 'Delete', 'Detach' + public VirtualMachineScaleSetDataDisk(int lun, string createOption, string name = default(string), CachingTypes? caching = default(CachingTypes?), bool? writeAcceleratorEnabled = default(bool?), int? diskSizeGb = default(int?), VirtualMachineScaleSetManagedDiskParameters managedDisk = default(VirtualMachineScaleSetManagedDiskParameters), long? diskIopsReadWrite = default(long?), long? diskMBpsReadWrite = default(long?), string deleteOption = default(string)) + { - Name = name; - Lun = lun; - Caching = caching; - WriteAcceleratorEnabled = writeAcceleratorEnabled; - CreateOption = createOption; - DiskSizeGB = diskSizeGB; - ManagedDisk = managedDisk; - DiskIOPSReadWrite = diskIOPSReadWrite; - DiskMBpsReadWrite = diskMBpsReadWrite; - DeleteOption = deleteOption; + this.Name = name; + this.Lun = lun; + this.Caching = caching; + this.WriteAcceleratorEnabled = writeAcceleratorEnabled; + this.CreateOption = createOption; + this.DiskSizeGB = diskSizeGb; + this.ManagedDisk = managedDisk; + this.DiskIOPSReadWrite = diskIopsReadWrite; + this.DiskMBpsReadWrite = diskMBpsReadWrite; + this.DeleteOption = deleteOption; CustomInit(); } @@ -89,103 +92,101 @@ public VirtualMachineScaleSetDataDisk() /// partial void CustomInit(); + /// /// Gets or sets the disk name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets specifies the logical unit number of the data disk. - /// This value is used to identify data disks within the VM and - /// therefore must be unique for each data disk attached to a VM. + /// Gets or sets specifies the logical unit number of the data disk. This value + /// is used to identify data disks within the VM and therefore must be unique + /// for each data disk attached to a VM. /// - [JsonProperty(PropertyName = "lun")] - public int Lun { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lun")] + public int Lun {get; set; } /// - /// Gets or sets specifies the caching requirements. Possible values - /// are: **None,** **ReadOnly,** **ReadWrite.** The default values are: - /// **None for Standard storage. ReadOnly for Premium storage.**. - /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + /// Gets or sets specifies the caching requirements. Possible values are: + /// **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for + /// Standard storage. ReadOnly for Premium storage.** Possible values include: 'None', 'ReadOnly', 'ReadWrite' /// - [JsonProperty(PropertyName = "caching")] - public CachingTypes? Caching { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "caching")] + public CachingTypes? Caching {get; set; } /// - /// Gets or sets specifies whether writeAccelerator should be enabled - /// or disabled on the disk. + /// Gets or sets specifies whether writeAccelerator should be enabled or + /// disabled on the disk. /// - [JsonProperty(PropertyName = "writeAcceleratorEnabled")] - public bool? WriteAcceleratorEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "writeAcceleratorEnabled")] + public bool? WriteAcceleratorEnabled {get; set; } /// - /// Gets or sets the create option. Possible values include: - /// 'FromImage', 'Empty', 'Attach', 'Copy', 'Restore' + /// Gets or sets the create option. Possible values include: 'FromImage', 'Empty', 'Attach', 'Copy', 'Restore' /// - [JsonProperty(PropertyName = "createOption")] - public string CreateOption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createOption")] + public string CreateOption {get; set; } /// - /// Gets or sets specifies the size of an empty data disk in gigabytes. - /// This element can be used to overwrite the size of the disk in a - /// virtual machine image. The property diskSizeGB is the number of - /// bytes x 1024^3 for the disk and the value cannot be larger than - /// 1023. + /// Gets or sets specifies the size of an empty data disk in gigabytes. This + /// element can be used to overwrite the size of the disk in a virtual machine + /// image. The property diskSizeGB is the number of bytes x 1024^3 for the disk + /// and the value cannot be larger than 1023. /// - [JsonProperty(PropertyName = "diskSizeGB")] - public int? DiskSizeGB { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeGB")] + public int? DiskSizeGB {get; set; } /// /// Gets or sets the managed disk parameters. /// - [JsonProperty(PropertyName = "managedDisk")] - public VirtualMachineScaleSetManagedDiskParameters ManagedDisk { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managedDisk")] + public VirtualMachineScaleSetManagedDiskParameters ManagedDisk {get; set; } /// - /// Gets or sets specifies the Read-Write IOPS for the managed disk. - /// Should be used only when StorageAccountType is UltraSSD_LRS. If not - /// specified, a default value would be assigned based on diskSizeGB. + /// Gets or sets specifies the Read-Write IOPS for the managed disk. Should be + /// used only when StorageAccountType is UltraSSD_LRS. If not specified, a + /// default value would be assigned based on diskSizeGB. /// - [JsonProperty(PropertyName = "diskIOPSReadWrite")] - public long? DiskIOPSReadWrite { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskIOPSReadWrite")] + public long? DiskIOPSReadWrite {get; set; } /// - /// Gets or sets specifies the bandwidth in MB per second for the - /// managed disk. Should be used only when StorageAccountType is - /// UltraSSD_LRS. If not specified, a default value would be assigned - /// based on diskSizeGB. + /// Gets or sets specifies the bandwidth in MB per second for the managed disk. + /// Should be used only when StorageAccountType is UltraSSD_LRS. If not + /// specified, a default value would be assigned based on diskSizeGB. /// - [JsonProperty(PropertyName = "diskMBpsReadWrite")] - public long? DiskMBpsReadWrite { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskMBpsReadWrite")] + public long? DiskMBpsReadWrite {get; set; } /// - /// Gets or sets specifies whether data disk should be deleted or - /// detached upon VMSS Flex deletion (This feature is available for - /// VMSS with Flexible OrchestrationMode - /// only).&lt;br&gt;&lt;br&gt; Possible values: - /// &lt;br&gt;&lt;br&gt; **Delete** If this value is - /// used, the data disk is deleted when the VMSS Flex VM is - /// deleted.&lt;br&gt;&lt;br&gt; **Detach** If this - /// value is used, the data disk is retained after VMSS Flex VM is - /// deleted.&lt;br&gt;&lt;br&gt; The default value is - /// set to **Delete**. Possible values include: 'Delete', 'Detach' + /// Gets or sets specifies whether data disk should be deleted or detached upon + /// VMSS Flex deletion (This feature is available for VMSS with Flexible + /// OrchestrationMode only).<br><br> Possible values: <br><br> **Delete** If + /// this value is used, the data disk is deleted when the VMSS Flex VM is + /// deleted.<br><br> **Detach** If this value is used, the data disk is + /// retained after VMSS Flex VM is deleted.<br><br> The default value is set to + /// **Delete**. Possible values include: 'Delete', 'Detach' /// - [JsonProperty(PropertyName = "deleteOption")] - public string DeleteOption { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "deleteOption")] + public string DeleteOption {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (CreateOption == null) + if (this.CreateOption == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "CreateOption"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CreateOption"); } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtension.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtension.cs index 496f4b9fe989..819b5a3e885c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtension.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtension.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Describes a Virtual Machine Scale Set Extension. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachineScaleSetExtension : SubResourceReadOnly { /// - /// Initializes a new instance of the VirtualMachineScaleSetExtension - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetExtension class. /// public VirtualMachineScaleSetExtension() { @@ -33,65 +22,82 @@ public VirtualMachineScaleSetExtension() } /// - /// Initializes a new instance of the VirtualMachineScaleSetExtension - /// class. - /// - /// Resource Id - /// If a value is provided and is - /// different from the previous value, the extension handler will be - /// forced to update even if the extension configuration has not - /// changed. - /// The name of the extension handler - /// publisher. - /// Specifies the - /// type of the extension; an example is - /// "CustomScriptExtension". - /// Specifies the version of the - /// script handler. - /// Indicates whether the - /// extension should use a newer minor version if one is available at - /// deployment time. Once deployed, however, the extension will not - /// upgrade minor versions unless redeployed, even with this property - /// set to true. - /// Indicates whether the - /// extension should be automatically upgraded by the platform if there - /// is a newer version of the extension available. - /// Json formatted public settings for the - /// extension. - /// The extension can contain either - /// protectedSettings or protectedSettingsFromKeyVault or no protected - /// settings at all. - /// The provisioning state, which only - /// appears in the response. - /// Collection of extension - /// names after which this extension needs to be provisioned. - /// Indicates whether failures stemming - /// from the extension will be suppressed (Operational failures such as - /// not connecting to the VM will not be suppressed regardless of this - /// value). The default is false. - /// The extensions - /// protected settings that are passed by reference, and consumed from - /// key vault - /// Resource type - /// Resource name - public VirtualMachineScaleSetExtension(string id = default(string), string forceUpdateTag = default(string), string publisher = default(string), string virtualMachineScaleSetExtensionPropertiesType = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object), string provisioningState = default(string), IList provisionAfterExtensions = default(IList), bool? suppressFailures = default(bool?), KeyVaultSecretReference protectedSettingsFromKeyVault = default(KeyVaultSecretReference), string type = default(string), string name = default(string)) - : base(id) + /// Initializes a new instance of the VirtualMachineScaleSetExtension class. + /// + + /// Resource Id + /// + + /// Resource type + /// + + /// Resource name + /// + + /// If a value is provided and is different from the previous value, the + /// extension handler will be forced to update even if the extension + /// configuration has not changed. + /// + + /// The name of the extension handler publisher. + /// + + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// + + /// Specifies the version of the script handler. + /// + + /// Indicates whether the extension should use a newer minor version if one is + /// available at deployment time. Once deployed, however, the extension will + /// not upgrade minor versions unless redeployed, even with this property set + /// to true. + /// + + /// Indicates whether the extension should be automatically upgraded by the + /// platform if there is a newer version of the extension available. + /// + + /// Json formatted public settings for the extension. + /// + + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// Collection of extension names after which this extension needs to be + /// provisioned. + /// + + /// Indicates whether failures stemming from the extension will be suppressed + /// (Operational failures such as not connecting to the VM will not be + /// suppressed regardless of this value). The default is false. + /// + + /// The extensions protected settings that are passed by reference, and + /// consumed from key vault + /// + public VirtualMachineScaleSetExtension(string id = default(string), string type = default(string), string name = default(string), string forceUpdateTag = default(string), string publisher = default(string), string virtualMachineExtensionType = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object), string provisioningState = default(string), System.Collections.Generic.IList provisionAfterExtensions = default(System.Collections.Generic.IList), bool? suppressFailures = default(bool?), KeyVaultSecretReference protectedSettingsFromKeyVault = default(KeyVaultSecretReference)) + + : base(id) { - ForceUpdateTag = forceUpdateTag; - Publisher = publisher; - VirtualMachineScaleSetExtensionPropertiesType = virtualMachineScaleSetExtensionPropertiesType; - TypeHandlerVersion = typeHandlerVersion; - AutoUpgradeMinorVersion = autoUpgradeMinorVersion; - EnableAutomaticUpgrade = enableAutomaticUpgrade; - Settings = settings; - ProtectedSettings = protectedSettings; - ProvisioningState = provisioningState; - ProvisionAfterExtensions = provisionAfterExtensions; - SuppressFailures = suppressFailures; - ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; - Type = type; - Name = name; + this.Type = type; + this.Name = name; + this.ForceUpdateTag = forceUpdateTag; + this.Publisher = publisher; + this.VirtualMachineExtensionType = virtualMachineExtensionType; + this.TypeHandlerVersion = typeHandlerVersion; + this.AutoUpgradeMinorVersion = autoUpgradeMinorVersion; + this.EnableAutomaticUpgrade = enableAutomaticUpgrade; + this.Settings = settings; + this.ProtectedSettings = protectedSettings; + this.ProvisioningState = provisioningState; + this.ProvisionAfterExtensions = provisionAfterExtensions; + this.SuppressFailures = suppressFailures; + this.ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; CustomInit(); } @@ -100,116 +106,125 @@ public VirtualMachineScaleSetExtension() /// partial void CustomInit(); + + /// + /// Gets resource type + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } + /// - /// Gets or sets if a value is provided and is different from the - /// previous value, the extension handler will be forced to update even - /// if the extension configuration has not changed. + /// Gets or sets resource name + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets if a value is provided and is different from the previous + /// value, the extension handler will be forced to update even if the extension + /// configuration has not changed. /// - [JsonProperty(PropertyName = "properties.forceUpdateTag")] - public string ForceUpdateTag { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.forceUpdateTag")] + public string ForceUpdateTag {get; set; } /// /// Gets or sets the name of the extension handler publisher. /// - [JsonProperty(PropertyName = "properties.publisher")] - public string Publisher { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publisher")] + public string Publisher {get; set; } /// /// Gets or sets specifies the type of the extension; an example is - /// "CustomScriptExtension". + /// "CustomScriptExtension". /// - [JsonProperty(PropertyName = "properties.type")] - public string VirtualMachineScaleSetExtensionPropertiesType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.type")] + public string VirtualMachineExtensionType {get; set; } /// /// Gets or sets specifies the version of the script handler. /// - [JsonProperty(PropertyName = "properties.typeHandlerVersion")] - public string TypeHandlerVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.typeHandlerVersion")] + public string TypeHandlerVersion {get; set; } /// - /// Gets or sets indicates whether the extension should use a newer - /// minor version if one is available at deployment time. Once - /// deployed, however, the extension will not upgrade minor versions - /// unless redeployed, even with this property set to true. + /// Gets or sets indicates whether the extension should use a newer minor + /// version if one is available at deployment time. Once deployed, however, the + /// extension will not upgrade minor versions unless redeployed, even with this + /// property set to true. /// - [JsonProperty(PropertyName = "properties.autoUpgradeMinorVersion")] - public bool? AutoUpgradeMinorVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoUpgradeMinorVersion")] + public bool? AutoUpgradeMinorVersion {get; set; } /// - /// Gets or sets indicates whether the extension should be - /// automatically upgraded by the platform if there is a newer version - /// of the extension available. + /// Gets or sets indicates whether the extension should be automatically + /// upgraded by the platform if there is a newer version of the extension + /// available. /// - [JsonProperty(PropertyName = "properties.enableAutomaticUpgrade")] - public bool? EnableAutomaticUpgrade { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableAutomaticUpgrade")] + public bool? EnableAutomaticUpgrade {get; set; } /// /// Gets or sets json formatted public settings for the extension. /// - [JsonProperty(PropertyName = "properties.settings")] - public object Settings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.settings")] + public object Settings {get; set; } /// /// Gets or sets the extension can contain either protectedSettings or /// protectedSettingsFromKeyVault or no protected settings at all. /// - [JsonProperty(PropertyName = "properties.protectedSettings")] - public object ProtectedSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protectedSettings")] + public object ProtectedSettings {get; set; } /// /// Gets the provisioning state, which only appears in the response. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets collection of extension names after which this - /// extension needs to be provisioned. + /// Gets or sets collection of extension names after which this extension needs + /// to be provisioned. /// - [JsonProperty(PropertyName = "properties.provisionAfterExtensions")] - public IList ProvisionAfterExtensions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisionAfterExtensions")] + public System.Collections.Generic.IList ProvisionAfterExtensions {get; set; } /// - /// Gets or sets indicates whether failures stemming from the extension - /// will be suppressed (Operational failures such as not connecting to - /// the VM will not be suppressed regardless of this value). The - /// default is false. + /// Gets or sets indicates whether failures stemming from the extension will be + /// suppressed (Operational failures such as not connecting to the VM will not + /// be suppressed regardless of this value). The default is false. /// - [JsonProperty(PropertyName = "properties.suppressFailures")] - public bool? SuppressFailures { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.suppressFailures")] + public bool? SuppressFailures {get; set; } /// /// Gets or sets the extensions protected settings that are passed by /// reference, and consumed from key vault /// - [JsonProperty(PropertyName = "properties.protectedSettingsFromKeyVault")] - public KeyVaultSecretReference ProtectedSettingsFromKeyVault { get; set; } - - /// - /// Gets resource type - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - /// - /// Gets or sets resource name - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protectedSettingsFromKeyVault")] + public KeyVaultSecretReference ProtectedSettingsFromKeyVault {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ProtectedSettingsFromKeyVault != null) + + + + + + + + + + + if (this.ProtectedSettingsFromKeyVault != null) { - ProtectedSettingsFromKeyVault.Validate(); + this.ProtectedSettingsFromKeyVault.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionProfile.cs index d042d05dd967..f50a4f4ad37d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetExtensionProfile { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetExtensionProfile class. + /// Initializes a new instance of the VirtualMachineScaleSetExtensionProfile class. /// public VirtualMachineScaleSetExtensionProfile() { @@ -30,20 +21,22 @@ public VirtualMachineScaleSetExtensionProfile() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetExtensionProfile class. + /// Initializes a new instance of the VirtualMachineScaleSetExtensionProfile class. /// - /// The virtual machine scale set child - /// extension resources. - /// Specifies the time alloted for - /// all extensions to start. The time duration should be between 15 - /// minutes and 120 minutes (inclusive) and should be specified in ISO - /// 8601 format. The default value is 90 minutes (PT1H30M). Minimum - /// api-version: 2020-06-01. - public VirtualMachineScaleSetExtensionProfile(IList extensions = default(IList), string extensionsTimeBudget = default(string)) + + /// The virtual machine scale set child extension resources. + /// + + /// Specifies the time alloted for all extensions to start. The time duration + /// should be between 15 minutes and 120 minutes (inclusive) and should be + /// specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). + /// Minimum api-version: 2020-06-01. + /// + public VirtualMachineScaleSetExtensionProfile(System.Collections.Generic.IList extensions = default(System.Collections.Generic.IList), string extensionsTimeBudget = default(string)) + { - Extensions = extensions; - ExtensionsTimeBudget = extensionsTimeBudget; + this.Extensions = extensions; + this.ExtensionsTimeBudget = extensionsTimeBudget; CustomInit(); } @@ -52,22 +45,20 @@ public VirtualMachineScaleSetExtensionProfile() /// partial void CustomInit(); + /// - /// Gets or sets the virtual machine scale set child extension - /// resources. + /// Gets or sets the virtual machine scale set child extension resources. /// - [JsonProperty(PropertyName = "extensions")] - public IList Extensions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extensions")] + public System.Collections.Generic.IList Extensions {get; set; } /// - /// Gets or sets specifies the time alloted for all extensions to - /// start. The time duration should be between 15 minutes and 120 - /// minutes (inclusive) and should be specified in ISO 8601 format. The - /// default value is 90 minutes (PT1H30M). Minimum api-version: - /// 2020-06-01. + /// Gets or sets specifies the time alloted for all extensions to start. The + /// time duration should be between 15 minutes and 120 minutes (inclusive) and + /// should be specified in ISO 8601 format. The default value is 90 minutes + /// (PT1H30M). Minimum api-version: 2020-06-01. /// - [JsonProperty(PropertyName = "extensionsTimeBudget")] - public string ExtensionsTimeBudget { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "extensionsTimeBudget")] + public string ExtensionsTimeBudget {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionProperties.cs new file mode 100644 index 000000000000..15384dc1af65 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionProperties.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a Virtual Machine Scale Set Extension. + /// + public partial class VirtualMachineScaleSetExtensionProperties + { + /// + /// Initializes a new instance of the VirtualMachineScaleSetExtensionProperties class. + /// + public VirtualMachineScaleSetExtensionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineScaleSetExtensionProperties class. + /// + + /// If a value is provided and is different from the previous value, the + /// extension handler will be forced to update even if the extension + /// configuration has not changed. + /// + + /// The name of the extension handler publisher. + /// + + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// + + /// Specifies the version of the script handler. + /// + + /// Indicates whether the extension should use a newer minor version if one is + /// available at deployment time. Once deployed, however, the extension will + /// not upgrade minor versions unless redeployed, even with this property set + /// to true. + /// + + /// Indicates whether the extension should be automatically upgraded by the + /// platform if there is a newer version of the extension available. + /// + + /// Json formatted public settings for the extension. + /// + + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// Collection of extension names after which this extension needs to be + /// provisioned. + /// + + /// Indicates whether failures stemming from the extension will be suppressed + /// (Operational failures such as not connecting to the VM will not be + /// suppressed regardless of this value). The default is false. + /// + + /// The extensions protected settings that are passed by reference, and + /// consumed from key vault + /// + public VirtualMachineScaleSetExtensionProperties(string forceUpdateTag = default(string), string publisher = default(string), string type = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object), string provisioningState = default(string), System.Collections.Generic.IList provisionAfterExtensions = default(System.Collections.Generic.IList), bool? suppressFailures = default(bool?), KeyVaultSecretReference protectedSettingsFromKeyVault = default(KeyVaultSecretReference)) + + { + this.ForceUpdateTag = forceUpdateTag; + this.Publisher = publisher; + this.Type = type; + this.TypeHandlerVersion = typeHandlerVersion; + this.AutoUpgradeMinorVersion = autoUpgradeMinorVersion; + this.EnableAutomaticUpgrade = enableAutomaticUpgrade; + this.Settings = settings; + this.ProtectedSettings = protectedSettings; + this.ProvisioningState = provisioningState; + this.ProvisionAfterExtensions = provisionAfterExtensions; + this.SuppressFailures = suppressFailures; + this.ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets if a value is provided and is different from the previous + /// value, the extension handler will be forced to update even if the extension + /// configuration has not changed. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "forceUpdateTag")] + public string ForceUpdateTag {get; set; } + + /// + /// Gets or sets the name of the extension handler publisher. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publisher")] + public string Publisher {get; set; } + + /// + /// Gets or sets specifies the type of the extension; an example is + /// "CustomScriptExtension". + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } + + /// + /// Gets or sets specifies the version of the script handler. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "typeHandlerVersion")] + public string TypeHandlerVersion {get; set; } + + /// + /// Gets or sets indicates whether the extension should use a newer minor + /// version if one is available at deployment time. Once deployed, however, the + /// extension will not upgrade minor versions unless redeployed, even with this + /// property set to true. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "autoUpgradeMinorVersion")] + public bool? AutoUpgradeMinorVersion {get; set; } + + /// + /// Gets or sets indicates whether the extension should be automatically + /// upgraded by the platform if there is a newer version of the extension + /// available. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableAutomaticUpgrade")] + public bool? EnableAutomaticUpgrade {get; set; } + + /// + /// Gets or sets json formatted public settings for the extension. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "settings")] + public object Settings {get; set; } + + /// + /// Gets or sets the extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protectedSettings")] + public object ProtectedSettings {get; set; } + + /// + /// Gets the provisioning state, which only appears in the response. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets collection of extension names after which this extension needs + /// to be provisioned. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisionAfterExtensions")] + public System.Collections.Generic.IList ProvisionAfterExtensions {get; set; } + + /// + /// Gets or sets indicates whether failures stemming from the extension will be + /// suppressed (Operational failures such as not connecting to the VM will not + /// be suppressed regardless of this value). The default is false. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "suppressFailures")] + public bool? SuppressFailures {get; set; } + + /// + /// Gets or sets the extensions protected settings that are passed by + /// reference, and consumed from key vault + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protectedSettingsFromKeyVault")] + public KeyVaultSecretReference ProtectedSettingsFromKeyVault {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + + + + + if (this.ProtectedSettingsFromKeyVault != null) + { + this.ProtectedSettingsFromKeyVault.Validate(); + } + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionUpdate.cs index a100df931865..7954d6ea097d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionUpdate.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Describes a Virtual Machine Scale Set Extension. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachineScaleSetExtensionUpdate : SubResourceReadOnly { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetExtensionUpdate class. + /// Initializes a new instance of the VirtualMachineScaleSetExtensionUpdate class. /// public VirtualMachineScaleSetExtensionUpdate() { @@ -33,63 +22,82 @@ public VirtualMachineScaleSetExtensionUpdate() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetExtensionUpdate class. - /// - /// Resource Id - /// The name of the extension. - /// Resource type - /// If a value is provided and is - /// different from the previous value, the extension handler will be - /// forced to update even if the extension configuration has not - /// changed. - /// The name of the extension handler - /// publisher. - /// Specifies the type of the extension; an example - /// is "CustomScriptExtension". - /// Specifies the version of the - /// script handler. - /// Indicates whether the - /// extension should use a newer minor version if one is available at - /// deployment time. Once deployed, however, the extension will not - /// upgrade minor versions unless redeployed, even with this property - /// set to true. - /// Indicates whether the - /// extension should be automatically upgraded by the platform if there - /// is a newer version of the extension available. - /// Json formatted public settings for the - /// extension. - /// The extension can contain either - /// protectedSettings or protectedSettingsFromKeyVault or no protected - /// settings at all. - /// The provisioning state, which only - /// appears in the response. - /// Collection of extension - /// names after which this extension needs to be provisioned. - /// Indicates whether failures stemming - /// from the extension will be suppressed (Operational failures such as - /// not connecting to the VM will not be suppressed regardless of this - /// value). The default is false. - /// The extensions - /// protected settings that are passed by reference, and consumed from - /// key vault - public VirtualMachineScaleSetExtensionUpdate(string id = default(string), string name = default(string), string type = default(string), string forceUpdateTag = default(string), string publisher = default(string), string type1 = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object), string provisioningState = default(string), IList provisionAfterExtensions = default(IList), bool? suppressFailures = default(bool?), KeyVaultSecretReference protectedSettingsFromKeyVault = default(KeyVaultSecretReference)) - : base(id) + /// Initializes a new instance of the VirtualMachineScaleSetExtensionUpdate class. + /// + + /// Resource Id + /// + + /// The name of the extension. + /// + + /// Resource type + /// + + /// If a value is provided and is different from the previous value, the + /// extension handler will be forced to update even if the extension + /// configuration has not changed. + /// + + /// The name of the extension handler publisher. + /// + + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// + + /// Specifies the version of the script handler. + /// + + /// Indicates whether the extension should use a newer minor version if one is + /// available at deployment time. Once deployed, however, the extension will + /// not upgrade minor versions unless redeployed, even with this property set + /// to true. + /// + + /// Indicates whether the extension should be automatically upgraded by the + /// platform if there is a newer version of the extension available. + /// + + /// Json formatted public settings for the extension. + /// + + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// Collection of extension names after which this extension needs to be + /// provisioned. + /// + + /// Indicates whether failures stemming from the extension will be suppressed + /// (Operational failures such as not connecting to the VM will not be + /// suppressed regardless of this value). The default is false. + /// + + /// The extensions protected settings that are passed by reference, and + /// consumed from key vault + /// + public VirtualMachineScaleSetExtensionUpdate(string id = default(string), string name = default(string), string type = default(string), string forceUpdateTag = default(string), string publisher = default(string), string virtualMachineExtensionType = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object), string provisioningState = default(string), System.Collections.Generic.IList provisionAfterExtensions = default(System.Collections.Generic.IList), bool? suppressFailures = default(bool?), KeyVaultSecretReference protectedSettingsFromKeyVault = default(KeyVaultSecretReference)) + + : base(id) { - Name = name; - Type = type; - ForceUpdateTag = forceUpdateTag; - Publisher = publisher; - Type1 = type1; - TypeHandlerVersion = typeHandlerVersion; - AutoUpgradeMinorVersion = autoUpgradeMinorVersion; - EnableAutomaticUpgrade = enableAutomaticUpgrade; - Settings = settings; - ProtectedSettings = protectedSettings; - ProvisioningState = provisioningState; - ProvisionAfterExtensions = provisionAfterExtensions; - SuppressFailures = suppressFailures; - ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + this.Name = name; + this.Type = type; + this.ForceUpdateTag = forceUpdateTag; + this.Publisher = publisher; + this.VirtualMachineExtensionType = virtualMachineExtensionType; + this.TypeHandlerVersion = typeHandlerVersion; + this.AutoUpgradeMinorVersion = autoUpgradeMinorVersion; + this.EnableAutomaticUpgrade = enableAutomaticUpgrade; + this.Settings = settings; + this.ProtectedSettings = protectedSettings; + this.ProvisioningState = provisioningState; + this.ProvisionAfterExtensions = provisionAfterExtensions; + this.SuppressFailures = suppressFailures; + this.ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; CustomInit(); } @@ -98,116 +106,125 @@ public VirtualMachineScaleSetExtensionUpdate() /// partial void CustomInit(); + /// /// Gets the name of the extension. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets if a value is provided and is different from the - /// previous value, the extension handler will be forced to update even - /// if the extension configuration has not changed. + /// Gets or sets if a value is provided and is different from the previous + /// value, the extension handler will be forced to update even if the extension + /// configuration has not changed. /// - [JsonProperty(PropertyName = "properties.forceUpdateTag")] - public string ForceUpdateTag { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.forceUpdateTag")] + public string ForceUpdateTag {get; set; } /// /// Gets or sets the name of the extension handler publisher. /// - [JsonProperty(PropertyName = "properties.publisher")] - public string Publisher { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publisher")] + public string Publisher {get; set; } /// /// Gets or sets specifies the type of the extension; an example is - /// "CustomScriptExtension". + /// "CustomScriptExtension". /// - [JsonProperty(PropertyName = "properties.type")] - public string Type1 { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.type")] + public string VirtualMachineExtensionType {get; set; } /// /// Gets or sets specifies the version of the script handler. /// - [JsonProperty(PropertyName = "properties.typeHandlerVersion")] - public string TypeHandlerVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.typeHandlerVersion")] + public string TypeHandlerVersion {get; set; } /// - /// Gets or sets indicates whether the extension should use a newer - /// minor version if one is available at deployment time. Once - /// deployed, however, the extension will not upgrade minor versions - /// unless redeployed, even with this property set to true. + /// Gets or sets indicates whether the extension should use a newer minor + /// version if one is available at deployment time. Once deployed, however, the + /// extension will not upgrade minor versions unless redeployed, even with this + /// property set to true. /// - [JsonProperty(PropertyName = "properties.autoUpgradeMinorVersion")] - public bool? AutoUpgradeMinorVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoUpgradeMinorVersion")] + public bool? AutoUpgradeMinorVersion {get; set; } /// - /// Gets or sets indicates whether the extension should be - /// automatically upgraded by the platform if there is a newer version - /// of the extension available. + /// Gets or sets indicates whether the extension should be automatically + /// upgraded by the platform if there is a newer version of the extension + /// available. /// - [JsonProperty(PropertyName = "properties.enableAutomaticUpgrade")] - public bool? EnableAutomaticUpgrade { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableAutomaticUpgrade")] + public bool? EnableAutomaticUpgrade {get; set; } /// /// Gets or sets json formatted public settings for the extension. /// - [JsonProperty(PropertyName = "properties.settings")] - public object Settings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.settings")] + public object Settings {get; set; } /// /// Gets or sets the extension can contain either protectedSettings or /// protectedSettingsFromKeyVault or no protected settings at all. /// - [JsonProperty(PropertyName = "properties.protectedSettings")] - public object ProtectedSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protectedSettings")] + public object ProtectedSettings {get; set; } /// /// Gets the provisioning state, which only appears in the response. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets collection of extension names after which this - /// extension needs to be provisioned. + /// Gets or sets collection of extension names after which this extension needs + /// to be provisioned. /// - [JsonProperty(PropertyName = "properties.provisionAfterExtensions")] - public IList ProvisionAfterExtensions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisionAfterExtensions")] + public System.Collections.Generic.IList ProvisionAfterExtensions {get; set; } /// - /// Gets or sets indicates whether failures stemming from the extension - /// will be suppressed (Operational failures such as not connecting to - /// the VM will not be suppressed regardless of this value). The - /// default is false. + /// Gets or sets indicates whether failures stemming from the extension will be + /// suppressed (Operational failures such as not connecting to the VM will not + /// be suppressed regardless of this value). The default is false. /// - [JsonProperty(PropertyName = "properties.suppressFailures")] - public bool? SuppressFailures { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.suppressFailures")] + public bool? SuppressFailures {get; set; } /// /// Gets or sets the extensions protected settings that are passed by /// reference, and consumed from key vault /// - [JsonProperty(PropertyName = "properties.protectedSettingsFromKeyVault")] - public KeyVaultSecretReference ProtectedSettingsFromKeyVault { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protectedSettingsFromKeyVault")] + public KeyVaultSecretReference ProtectedSettingsFromKeyVault {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ProtectedSettingsFromKeyVault != null) + + + + + + + + + + + if (this.ProtectedSettingsFromKeyVault != null) { - ProtectedSettingsFromKeyVault.Validate(); + this.ProtectedSettingsFromKeyVault.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionsCreateOrUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionsCreateOrUpdateHeaders.cs index 8035501779eb..9fcae2ff11c3 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionsCreateOrUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionsCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class VirtualMachineScaleSetExtensionsCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetExtensionsCreateOrUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetExtensionsCreateOrUpdateHeaders class. /// public VirtualMachineScaleSetExtensionsCreateOrUpdateHeaders() { @@ -28,18 +18,19 @@ public VirtualMachineScaleSetExtensionsCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetExtensionsCreateOrUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetExtensionsCreateOrUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachineScaleSetExtensionsCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachineScaleSetExtensionsCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionsUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionsUpdateHeaders.cs index ab9b625ccfe9..499605bef9ef 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionsUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetExtensionsUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Update operation. - /// public partial class VirtualMachineScaleSetExtensionsUpdateHeaders { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetExtensionsUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetExtensionsUpdateHeaders class. /// public VirtualMachineScaleSetExtensionsUpdateHeaders() { @@ -28,18 +18,19 @@ public VirtualMachineScaleSetExtensionsUpdateHeaders() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetExtensionsUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetExtensionsUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachineScaleSetExtensionsUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachineScaleSetExtensionsUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetHardwareProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetHardwareProfile.cs index f7f3aec32bef..9636a76da897 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetHardwareProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetHardwareProfile.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetHardwareProfile { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetHardwareProfile class. + /// Initializes a new instance of the VirtualMachineScaleSetHardwareProfile class. /// public VirtualMachineScaleSetHardwareProfile() { @@ -28,17 +21,17 @@ public VirtualMachineScaleSetHardwareProfile() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetHardwareProfile class. + /// Initializes a new instance of the VirtualMachineScaleSetHardwareProfile class. /// - /// Specifies the properties for - /// customizing the size of the virtual machine. Minimum api-version: - /// 2021-11-01. Please follow the instructions in [VM - /// Customization](https://aka.ms/vmcustomization) for more - /// details. + + /// Specifies the properties for customizing the size of the virtual machine. + /// Minimum api-version: 2021-11-01. Please follow the instructions in [VM + /// Customization](https://aka.ms/vmcustomization) for more details. + /// public VirtualMachineScaleSetHardwareProfile(VMSizeProperties vmSizeProperties = default(VMSizeProperties)) + { - VmSizeProperties = vmSizeProperties; + this.VmSizeProperties = vmSizeProperties; CustomInit(); } @@ -47,14 +40,14 @@ public VirtualMachineScaleSetHardwareProfile() /// partial void CustomInit(); + /// - /// Gets or sets specifies the properties for customizing the size of - /// the virtual machine. Minimum api-version: 2021-11-01. Please follow - /// the instructions in [VM - /// Customization](https://aka.ms/vmcustomization) for more details. + /// Gets or sets specifies the properties for customizing the size of the + /// virtual machine. Minimum api-version: 2021-11-01. Please follow the + /// instructions in [VM Customization](https://aka.ms/vmcustomization) for more + /// details. /// - [JsonProperty(PropertyName = "vmSizeProperties")] - public VMSizeProperties VmSizeProperties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "vmSizeProperties")] + public VMSizeProperties VmSizeProperties {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetIPConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetIPConfiguration.cs index 9a89b2a68020..790a101cc495 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetIPConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetIPConfiguration.cs @@ -1,32 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Describes a virtual machine scale set network profile's IP - /// configuration. + /// Describes a virtual machine scale set network profile's IP configuration. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachineScaleSetIPConfiguration { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetIPConfiguration class. + /// Initializes a new instance of the VirtualMachineScaleSetIPConfiguration class. /// public VirtualMachineScaleSetIPConfiguration() { @@ -34,49 +22,59 @@ public VirtualMachineScaleSetIPConfiguration() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetIPConfiguration class. + /// Initializes a new instance of the VirtualMachineScaleSetIPConfiguration class. /// - /// The IP configuration name. - /// Specifies the identifier of the - /// subnet. - /// Specifies the primary network interface in - /// case the virtual machine has more than 1 network interface. - /// The - /// publicIPAddressConfiguration. - /// Available from Api-Version - /// 2017-03-30 onwards, it represents whether the specific - /// ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - /// Possible values are: 'IPv4' and 'IPv6'. Possible values include: - /// 'IPv4', 'IPv6' - /// Specifies an - /// array of references to backend address pools of application - /// gateways. A scale set can reference backend address pools of - /// multiple application gateways. Multiple scale sets cannot use the - /// same application gateway. - /// Specifies an array of - /// references to application security group. - /// Specifies an array of - /// references to backend address pools of load balancers. A scale set - /// can reference backend address pools of one public and one internal - /// load balancer. Multiple scale sets cannot use the same basic sku - /// load balancer. - /// Specifies an array of - /// references to inbound Nat pools of the load balancers. A scale set - /// can reference inbound nat pools of one public and one internal load - /// balancer. Multiple scale sets cannot use the same basic sku load - /// balancer. - public VirtualMachineScaleSetIPConfiguration(string name, ApiEntityReference subnet = default(ApiEntityReference), bool? primary = default(bool?), VirtualMachineScaleSetPublicIPAddressConfiguration publicIPAddressConfiguration = default(VirtualMachineScaleSetPublicIPAddressConfiguration), string privateIPAddressVersion = default(string), IList applicationGatewayBackendAddressPools = default(IList), IList applicationSecurityGroups = default(IList), IList loadBalancerBackendAddressPools = default(IList), IList loadBalancerInboundNatPools = default(IList)) + + /// The IP configuration name. + /// + + /// Specifies the identifier of the subnet. + /// + + /// Specifies the primary network interface in case the virtual machine has + /// more than 1 network interface. + /// + + /// The publicIPAddressConfiguration. + /// + + /// Available from Api-Version 2017-03-30 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + /// Possible values are: 'IPv4' and 'IPv6'. + /// Possible values include: 'IPv4', 'IPv6' + + /// Specifies an array of references to backend address pools of application + /// gateways. A scale set can reference backend address pools of multiple + /// application gateways. Multiple scale sets cannot use the same application + /// gateway. + /// + + /// Specifies an array of references to application security group. + /// + + /// Specifies an array of references to backend address pools of load + /// balancers. A scale set can reference backend address pools of one public + /// and one internal load balancer. Multiple scale sets cannot use the same + /// basic sku load balancer. + /// + + /// Specifies an array of references to inbound Nat pools of the load + /// balancers. A scale set can reference inbound nat pools of one public and + /// one internal load balancer. Multiple scale sets cannot use the same basic + /// sku load balancer. + /// + public VirtualMachineScaleSetIPConfiguration(string name, ApiEntityReference subnet = default(ApiEntityReference), bool? primary = default(bool?), VirtualMachineScaleSetPublicIPAddressConfiguration publicIPAddressConfiguration = default(VirtualMachineScaleSetPublicIPAddressConfiguration), string privateIPAddressVersion = default(string), System.Collections.Generic.IList applicationGatewayBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationSecurityGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerInboundNatPools = default(System.Collections.Generic.IList)) + { - Name = name; - Subnet = subnet; - Primary = primary; - PublicIPAddressConfiguration = publicIPAddressConfiguration; - PrivateIPAddressVersion = privateIPAddressVersion; - ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; - ApplicationSecurityGroups = applicationSecurityGroups; - LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; - LoadBalancerInboundNatPools = loadBalancerInboundNatPools; + this.Name = name; + this.Subnet = subnet; + this.Primary = primary; + this.PublicIPAddressConfiguration = publicIPAddressConfiguration; + this.PrivateIPAddressVersion = privateIPAddressVersion; + this.ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + this.ApplicationSecurityGroups = applicationSecurityGroups; + this.LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + this.LoadBalancerInboundNatPools = loadBalancerInboundNatPools; CustomInit(); } @@ -85,90 +83,96 @@ public VirtualMachineScaleSetIPConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the IP configuration name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets specifies the identifier of the subnet. /// - [JsonProperty(PropertyName = "properties.subnet")] - public ApiEntityReference Subnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public ApiEntityReference Subnet {get; set; } /// - /// Gets or sets specifies the primary network interface in case the - /// virtual machine has more than 1 network interface. + /// Gets or sets specifies the primary network interface in case the virtual + /// machine has more than 1 network interface. /// - [JsonProperty(PropertyName = "properties.primary")] - public bool? Primary { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primary")] + public bool? Primary {get; set; } /// /// Gets or sets the publicIPAddressConfiguration. /// - [JsonProperty(PropertyName = "properties.publicIPAddressConfiguration")] - public VirtualMachineScaleSetPublicIPAddressConfiguration PublicIPAddressConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddressConfiguration")] + public VirtualMachineScaleSetPublicIPAddressConfiguration PublicIPAddressConfiguration {get; set; } /// - /// Gets or sets available from Api-Version 2017-03-30 onwards, it - /// represents whether the specific ipconfiguration is IPv4 or IPv6. - /// Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - /// Possible values include: 'IPv4', 'IPv6' + /// Gets or sets available from Api-Version 2017-03-30 onwards, it represents + /// whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as + /// IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' /// - [JsonProperty(PropertyName = "properties.privateIPAddressVersion")] - public string PrivateIPAddressVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddressVersion")] + public string PrivateIPAddressVersion {get; set; } /// - /// Gets or sets specifies an array of references to backend address - /// pools of application gateways. A scale set can reference backend - /// address pools of multiple application gateways. Multiple scale sets - /// cannot use the same application gateway. + /// Gets or sets specifies an array of references to backend address pools of + /// application gateways. A scale set can reference backend address pools of + /// multiple application gateways. Multiple scale sets cannot use the same + /// application gateway. /// - [JsonProperty(PropertyName = "properties.applicationGatewayBackendAddressPools")] - public IList ApplicationGatewayBackendAddressPools { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicationGatewayBackendAddressPools")] + public System.Collections.Generic.IList ApplicationGatewayBackendAddressPools {get; set; } /// - /// Gets or sets specifies an array of references to application - /// security group. + /// Gets or sets specifies an array of references to application security + /// group. /// - [JsonProperty(PropertyName = "properties.applicationSecurityGroups")] - public IList ApplicationSecurityGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicationSecurityGroups")] + public System.Collections.Generic.IList ApplicationSecurityGroups {get; set; } /// - /// Gets or sets specifies an array of references to backend address - /// pools of load balancers. A scale set can reference backend address - /// pools of one public and one internal load balancer. Multiple scale - /// sets cannot use the same basic sku load balancer. + /// Gets or sets specifies an array of references to backend address pools of + /// load balancers. A scale set can reference backend address pools of one + /// public and one internal load balancer. Multiple scale sets cannot use the + /// same basic sku load balancer. /// - [JsonProperty(PropertyName = "properties.loadBalancerBackendAddressPools")] - public IList LoadBalancerBackendAddressPools { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancerBackendAddressPools")] + public System.Collections.Generic.IList LoadBalancerBackendAddressPools {get; set; } /// - /// Gets or sets specifies an array of references to inbound Nat pools - /// of the load balancers. A scale set can reference inbound nat pools - /// of one public and one internal load balancer. Multiple scale sets - /// cannot use the same basic sku load balancer. + /// Gets or sets specifies an array of references to inbound Nat pools of the + /// load balancers. A scale set can reference inbound nat pools of one public + /// and one internal load balancer. Multiple scale sets cannot use the same + /// basic sku load balancer. /// - [JsonProperty(PropertyName = "properties.loadBalancerInboundNatPools")] - public IList LoadBalancerInboundNatPools { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancerInboundNatPools")] + public System.Collections.Generic.IList LoadBalancerInboundNatPools {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (PublicIPAddressConfiguration != null) + + + if (this.PublicIPAddressConfiguration != null) { - PublicIPAddressConfiguration.Validate(); + this.PublicIPAddressConfiguration.Validate(); } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetIPConfigurationProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetIPConfigurationProperties.cs new file mode 100644 index 000000000000..0323e9f0790e --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetIPConfigurationProperties.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes a virtual machine scale set network profile's IP configuration + /// properties. + /// + public partial class VirtualMachineScaleSetIPConfigurationProperties + { + /// + /// Initializes a new instance of the VirtualMachineScaleSetIPConfigurationProperties class. + /// + public VirtualMachineScaleSetIPConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineScaleSetIPConfigurationProperties class. + /// + + /// Specifies the identifier of the subnet. + /// + + /// Specifies the primary network interface in case the virtual machine has + /// more than 1 network interface. + /// + + /// The publicIPAddressConfiguration. + /// + + /// Available from Api-Version 2017-03-30 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + /// Possible values are: 'IPv4' and 'IPv6'. + /// Possible values include: 'IPv4', 'IPv6' + + /// Specifies an array of references to backend address pools of application + /// gateways. A scale set can reference backend address pools of multiple + /// application gateways. Multiple scale sets cannot use the same application + /// gateway. + /// + + /// Specifies an array of references to application security group. + /// + + /// Specifies an array of references to backend address pools of load + /// balancers. A scale set can reference backend address pools of one public + /// and one internal load balancer. Multiple scale sets cannot use the same + /// basic sku load balancer. + /// + + /// Specifies an array of references to inbound Nat pools of the load + /// balancers. A scale set can reference inbound nat pools of one public and + /// one internal load balancer. Multiple scale sets cannot use the same basic + /// sku load balancer. + /// + public VirtualMachineScaleSetIPConfigurationProperties(ApiEntityReference subnet = default(ApiEntityReference), bool? primary = default(bool?), VirtualMachineScaleSetPublicIPAddressConfiguration publicIPAddressConfiguration = default(VirtualMachineScaleSetPublicIPAddressConfiguration), string privateIPAddressVersion = default(string), System.Collections.Generic.IList applicationGatewayBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationSecurityGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerInboundNatPools = default(System.Collections.Generic.IList)) + + { + this.Subnet = subnet; + this.Primary = primary; + this.PublicIPAddressConfiguration = publicIPAddressConfiguration; + this.PrivateIPAddressVersion = privateIPAddressVersion; + this.ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + this.ApplicationSecurityGroups = applicationSecurityGroups; + this.LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + this.LoadBalancerInboundNatPools = loadBalancerInboundNatPools; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets specifies the identifier of the subnet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public ApiEntityReference Subnet {get; set; } + + /// + /// Gets or sets specifies the primary network interface in case the virtual + /// machine has more than 1 network interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primary")] + public bool? Primary {get; set; } + + /// + /// Gets or sets the publicIPAddressConfiguration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddressConfiguration")] + public VirtualMachineScaleSetPublicIPAddressConfiguration PublicIPAddressConfiguration {get; set; } + + /// + /// Gets or sets available from Api-Version 2017-03-30 onwards, it represents + /// whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as + /// IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAddressVersion")] + public string PrivateIPAddressVersion {get; set; } + + /// + /// Gets or sets specifies an array of references to backend address pools of + /// application gateways. A scale set can reference backend address pools of + /// multiple application gateways. Multiple scale sets cannot use the same + /// application gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applicationGatewayBackendAddressPools")] + public System.Collections.Generic.IList ApplicationGatewayBackendAddressPools {get; set; } + + /// + /// Gets or sets specifies an array of references to application security + /// group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applicationSecurityGroups")] + public System.Collections.Generic.IList ApplicationSecurityGroups {get; set; } + + /// + /// Gets or sets specifies an array of references to backend address pools of + /// load balancers. A scale set can reference backend address pools of one + /// public and one internal load balancer. Multiple scale sets cannot use the + /// same basic sku load balancer. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadBalancerBackendAddressPools")] + public System.Collections.Generic.IList LoadBalancerBackendAddressPools {get; set; } + + /// + /// Gets or sets specifies an array of references to inbound Nat pools of the + /// load balancers. A scale set can reference inbound nat pools of one public + /// and one internal load balancer. Multiple scale sets cannot use the same + /// basic sku load balancer. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadBalancerInboundNatPools")] + public System.Collections.Generic.IList LoadBalancerInboundNatPools {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + if (this.PublicIPAddressConfiguration != null) + { + this.PublicIPAddressConfiguration.Validate(); + } + + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetIdentity.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetIdentity.cs index d4c98ce3b702..1c2560382c01 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetIdentity.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetIdentity.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetIdentity { /// - /// Initializes a new instance of the VirtualMachineScaleSetIdentity - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetIdentity class. /// public VirtualMachineScaleSetIdentity() { @@ -30,32 +21,36 @@ public VirtualMachineScaleSetIdentity() } /// - /// Initializes a new instance of the VirtualMachineScaleSetIdentity - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetIdentity class. /// - /// The principal id of virtual machine scale - /// set identity. This property will only be provided for a system - /// assigned identity. - /// The tenant id associated with the virtual - /// machine scale set. This property will only be provided for a system - /// assigned identity. - /// The type of identity used for the virtual - /// machine scale set. The type 'SystemAssigned, UserAssigned' includes - /// both an implicitly created identity and a set of user assigned - /// identities. The type 'None' will remove any identities from the - /// virtual machine scale set. Possible values include: - /// 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - /// 'None' - /// The list of user identities - /// associated with the virtual machine scale set. The user identity - /// dictionary key references will be ARM resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - public VirtualMachineScaleSetIdentity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?), IDictionary userAssignedIdentities = default(IDictionary)) + + /// The principal id of virtual machine scale set identity. This property will + /// only be provided for a system assigned identity. + /// + + /// The tenant id associated with the virtual machine scale set. This property + /// will only be provided for a system assigned identity. + /// + + /// The type of identity used for the virtual machine scale set. The type + /// 'SystemAssigned, UserAssigned' includes both an implicitly created identity + /// and a set of user assigned identities. The type 'None' will remove any + /// identities from the virtual machine scale set. + /// Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + /// UserAssigned', 'None' + + /// The list of user identities associated with the virtual machine scale set. + /// The user identity dictionary key references will be ARM resource ids in the + /// form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + public VirtualMachineScaleSetIdentity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?), System.Collections.Generic.IDictionary userAssignedIdentities = default(System.Collections.Generic.IDictionary)) + { - PrincipalId = principalId; - TenantId = tenantId; - Type = type; - UserAssignedIdentities = userAssignedIdentities; + this.PrincipalId = principalId; + this.TenantId = tenantId; + this.Type = type; + this.UserAssignedIdentities = userAssignedIdentities; CustomInit(); } @@ -64,39 +59,37 @@ public VirtualMachineScaleSetIdentity() /// partial void CustomInit(); + /// - /// Gets the principal id of virtual machine scale set identity. This - /// property will only be provided for a system assigned identity. + /// Gets the principal id of virtual machine scale set identity. This property + /// will only be provided for a system assigned identity. /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; private set; } /// - /// Gets the tenant id associated with the virtual machine scale set. - /// This property will only be provided for a system assigned identity. + /// Gets the tenant id associated with the virtual machine scale set. This + /// property will only be provided for a system assigned identity. /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; private set; } /// - /// Gets or sets the type of identity used for the virtual machine - /// scale set. The type 'SystemAssigned, UserAssigned' includes both an - /// implicitly created identity and a set of user assigned identities. - /// The type 'None' will remove any identities from the virtual machine - /// scale set. Possible values include: 'SystemAssigned', - /// 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + /// Gets or sets the type of identity used for the virtual machine scale set. + /// The type 'SystemAssigned, UserAssigned' includes both an implicitly created + /// identity and a set of user assigned identities. The type 'None' will remove + /// any identities from the virtual machine scale set. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' /// - [JsonProperty(PropertyName = "type")] - public ResourceIdentityType? Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public ResourceIdentityType? Type {get; set; } /// - /// Gets or sets the list of user identities associated with the - /// virtual machine scale set. The user identity dictionary key - /// references will be ARM resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// Gets or sets the list of user identities associated with the virtual + /// machine scale set. The user identity dictionary key references will be ARM + /// resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. /// - [JsonProperty(PropertyName = "userAssignedIdentities")] - public IDictionary UserAssignedIdentities { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "userAssignedIdentities")] + public System.Collections.Generic.IDictionary UserAssignedIdentities {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetInstanceView.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetInstanceView.cs index 0b6757db7d77..cda84ce5d842 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetInstanceView.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetInstanceView.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetInstanceView { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetInstanceView class. + /// Initializes a new instance of the VirtualMachineScaleSetInstanceView class. /// public VirtualMachineScaleSetInstanceView() { @@ -30,21 +21,27 @@ public VirtualMachineScaleSetInstanceView() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetInstanceView class. + /// Initializes a new instance of the VirtualMachineScaleSetInstanceView class. /// - /// The instance view status summary for - /// the virtual machine scale set. - /// The extensions information. - /// The resource status information. - /// The orchestration services - /// information. - public VirtualMachineScaleSetInstanceView(VirtualMachineScaleSetInstanceViewStatusesSummary virtualMachine = default(VirtualMachineScaleSetInstanceViewStatusesSummary), IList extensions = default(IList), IList statuses = default(IList), IList orchestrationServices = default(IList)) + + /// The instance view status summary for the virtual machine scale set. + /// + + /// The extensions information. + /// + + /// The resource status information. + /// + + /// The orchestration services information. + /// + public VirtualMachineScaleSetInstanceView(VirtualMachineScaleSetInstanceViewStatusesSummary virtualMachine = default(VirtualMachineScaleSetInstanceViewStatusesSummary), System.Collections.Generic.IList extensions = default(System.Collections.Generic.IList), System.Collections.Generic.IList statuses = default(System.Collections.Generic.IList), System.Collections.Generic.IList orchestrationServices = default(System.Collections.Generic.IList)) + { - VirtualMachine = virtualMachine; - Extensions = extensions; - Statuses = statuses; - OrchestrationServices = orchestrationServices; + this.VirtualMachine = virtualMachine; + this.Extensions = extensions; + this.Statuses = statuses; + this.OrchestrationServices = orchestrationServices; CustomInit(); } @@ -53,30 +50,29 @@ public VirtualMachineScaleSetInstanceView() /// partial void CustomInit(); + /// - /// Gets the instance view status summary for the virtual machine scale - /// set. + /// Gets the instance view status summary for the virtual machine scale set. /// - [JsonProperty(PropertyName = "virtualMachine")] - public VirtualMachineScaleSetInstanceViewStatusesSummary VirtualMachine { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachine")] + public VirtualMachineScaleSetInstanceViewStatusesSummary VirtualMachine {get; private set; } /// /// Gets the extensions information. /// - [JsonProperty(PropertyName = "extensions")] - public IList Extensions { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extensions")] + public System.Collections.Generic.IList Extensions {get; private set; } /// /// Gets or sets the resource status information. /// - [JsonProperty(PropertyName = "statuses")] - public IList Statuses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "statuses")] + public System.Collections.Generic.IList Statuses {get; set; } /// /// Gets the orchestration services information. /// - [JsonProperty(PropertyName = "orchestrationServices")] - public IList OrchestrationServices { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "orchestrationServices")] + public System.Collections.Generic.IList OrchestrationServices {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetInstanceViewStatusesSummary.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetInstanceViewStatusesSummary.cs index 2d55aefcac5e..6086749417b9 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetInstanceViewStatusesSummary.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetInstanceViewStatusesSummary.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Instance view statuses summary for virtual machines of a virtual - /// machine scale set. + /// Instance view statuses summary for virtual machines of a virtual machine + /// scale set. /// public partial class VirtualMachineScaleSetInstanceViewStatusesSummary { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetInstanceViewStatusesSummary class. + /// Initializes a new instance of the VirtualMachineScaleSetInstanceViewStatusesSummary class. /// public VirtualMachineScaleSetInstanceViewStatusesSummary() { @@ -31,13 +22,15 @@ public VirtualMachineScaleSetInstanceViewStatusesSummary() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetInstanceViewStatusesSummary class. + /// Initializes a new instance of the VirtualMachineScaleSetInstanceViewStatusesSummary class. /// - /// The extensions information. - public VirtualMachineScaleSetInstanceViewStatusesSummary(IList statusesSummary = default(IList)) + + /// The extensions information. + /// + public VirtualMachineScaleSetInstanceViewStatusesSummary(System.Collections.Generic.IList statusesSummary = default(System.Collections.Generic.IList)) + { - StatusesSummary = statusesSummary; + this.StatusesSummary = statusesSummary; CustomInit(); } @@ -46,11 +39,11 @@ public VirtualMachineScaleSetInstanceViewStatusesSummary() /// partial void CustomInit(); + /// /// Gets the extensions information. /// - [JsonProperty(PropertyName = "statusesSummary")] - public IList StatusesSummary { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "statusesSummary")] + public System.Collections.Generic.IList StatusesSummary {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetIpTag.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetIpTag.cs index 2fb2b4a7d812..e5828e31b539 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetIpTag.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetIpTag.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetIpTag { /// - /// Initializes a new instance of the VirtualMachineScaleSetIpTag - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetIpTag class. /// public VirtualMachineScaleSetIpTag() { @@ -28,17 +21,19 @@ public VirtualMachineScaleSetIpTag() } /// - /// Initializes a new instance of the VirtualMachineScaleSetIpTag - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetIpTag class. /// - /// IP tag type. Example: - /// FirstPartyUsage. - /// IP tag associated with the public IP. Example: - /// SQL, Storage etc. + + /// IP tag type. Example: FirstPartyUsage. + /// + + /// IP tag associated with the public IP. Example: SQL, Storage etc. + /// public VirtualMachineScaleSetIpTag(string ipTagType = default(string), string tag = default(string)) + { - IpTagType = ipTagType; - Tag = tag; + this.IpTagType = ipTagType; + this.Tag = tag; CustomInit(); } @@ -47,18 +42,18 @@ public VirtualMachineScaleSetIpTag() /// partial void CustomInit(); + /// - /// Gets or sets IP tag type. Example: FirstPartyUsage. + /// Gets or sets iP tag type. Example: FirstPartyUsage. /// - [JsonProperty(PropertyName = "ipTagType")] - public string IpTagType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ipTagType")] + public string IpTagType {get; set; } /// - /// Gets or sets IP tag associated with the public IP. Example: SQL, - /// Storage etc. + /// Gets or sets iP tag associated with the public IP. Example: SQL, Storage + /// etc. /// - [JsonProperty(PropertyName = "tag")] - public string Tag { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tag")] + public string Tag {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetManagedDiskParameters.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetManagedDiskParameters.cs index db483a29a1ae..e2a50130aa12 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetManagedDiskParameters.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetManagedDiskParameters.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetManagedDiskParameters { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetManagedDiskParameters class. + /// Initializes a new instance of the VirtualMachineScaleSetManagedDiskParameters class. /// public VirtualMachineScaleSetManagedDiskParameters() { @@ -28,23 +21,26 @@ public VirtualMachineScaleSetManagedDiskParameters() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetManagedDiskParameters class. + /// Initializes a new instance of the VirtualMachineScaleSetManagedDiskParameters class. /// - /// Specifies the storage account type - /// for the managed disk. NOTE: UltraSSD_LRS can only be used with data - /// disks, it cannot be used with OS Disk. Possible values include: - /// 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS', - /// 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' - /// Specifies the customer managed disk - /// encryption set resource id for the managed disk. - /// Specifies the security profile for - /// the managed disk. + + /// Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + /// can only be used with data disks, it cannot be used with OS Disk. + /// Possible values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', + /// 'UltraSSD_LRS', 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' + + /// Specifies the customer managed disk encryption set resource id for the + /// managed disk. + /// + + /// Specifies the security profile for the managed disk. + /// public VirtualMachineScaleSetManagedDiskParameters(string storageAccountType = default(string), DiskEncryptionSetParameters diskEncryptionSet = default(DiskEncryptionSetParameters), VMDiskSecurityProfile securityProfile = default(VMDiskSecurityProfile)) + { - StorageAccountType = storageAccountType; - DiskEncryptionSet = diskEncryptionSet; - SecurityProfile = securityProfile; + this.StorageAccountType = storageAccountType; + this.DiskEncryptionSet = diskEncryptionSet; + this.SecurityProfile = securityProfile; CustomInit(); } @@ -53,28 +49,26 @@ public VirtualMachineScaleSetManagedDiskParameters() /// partial void CustomInit(); + /// - /// Gets or sets specifies the storage account type for the managed - /// disk. NOTE: UltraSSD_LRS can only be used with data disks, it - /// cannot be used with OS Disk. Possible values include: - /// 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS', - /// 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' + /// Gets or sets specifies the storage account type for the managed disk. NOTE: + /// UltraSSD_LRS can only be used with data disks, it cannot be used with OS + /// Disk. Possible values include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS', 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS' /// - [JsonProperty(PropertyName = "storageAccountType")] - public string StorageAccountType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountType")] + public string StorageAccountType {get; set; } /// - /// Gets or sets specifies the customer managed disk encryption set - /// resource id for the managed disk. + /// Gets or sets specifies the customer managed disk encryption set resource id + /// for the managed disk. /// - [JsonProperty(PropertyName = "diskEncryptionSet")] - public DiskEncryptionSetParameters DiskEncryptionSet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskEncryptionSet")] + public DiskEncryptionSetParameters DiskEncryptionSet {get; set; } /// /// Gets or sets specifies the security profile for the managed disk. /// - [JsonProperty(PropertyName = "securityProfile")] - public VMDiskSecurityProfile SecurityProfile { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "securityProfile")] + public VMDiskSecurityProfile SecurityProfile {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetMigrationInfo.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetMigrationInfo.cs index effae20710c1..89830188f680 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetMigrationInfo.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetMigrationInfo.cs @@ -1,27 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Describes the Availability Set properties related to migration to - /// Flexible Virtual Machine Scale Set. + /// Describes the Availability Set properties related to migration to Flexible + /// Virtual Machine Scale Set. /// public partial class VirtualMachineScaleSetMigrationInfo { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetMigrationInfo class. + /// Initializes a new instance of the VirtualMachineScaleSetMigrationInfo class. /// public VirtualMachineScaleSetMigrationInfo() { @@ -29,19 +22,22 @@ public VirtualMachineScaleSetMigrationInfo() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetMigrationInfo class. + /// Initializes a new instance of the VirtualMachineScaleSetMigrationInfo class. /// - /// Indicates the - /// target Virtual Machine ScaleSet properties upon triggering a + + /// Indicates the target Virtual Machine ScaleSet properties upon triggering a /// seamless migration without downtime of the VMs via the - /// ConvertToVirtualMachineScaleSet API. - /// Specifies the Virtual - /// Machine Scale Set that the Availability Set is migrated to. + /// ConvertToVirtualMachineScaleSet API. + /// + + /// Specifies the Virtual Machine Scale Set that the Availability Set is + /// migrated to. + /// public VirtualMachineScaleSetMigrationInfo(DefaultVirtualMachineScaleSetInfo defaultVirtualMachineScaleSetInfo = default(DefaultVirtualMachineScaleSetInfo), SubResource migrateToVirtualMachineScaleSet = default(SubResource)) + { - DefaultVirtualMachineScaleSetInfo = defaultVirtualMachineScaleSetInfo; - MigrateToVirtualMachineScaleSet = migrateToVirtualMachineScaleSet; + this.DefaultVirtualMachineScaleSetInfo = defaultVirtualMachineScaleSetInfo; + this.MigrateToVirtualMachineScaleSet = migrateToVirtualMachineScaleSet; CustomInit(); } @@ -50,20 +46,20 @@ public VirtualMachineScaleSetMigrationInfo() /// partial void CustomInit(); + /// /// Gets indicates the target Virtual Machine ScaleSet properties upon /// triggering a seamless migration without downtime of the VMs via the /// ConvertToVirtualMachineScaleSet API. /// - [JsonProperty(PropertyName = "defaultVirtualMachineScaleSetInfo")] - public DefaultVirtualMachineScaleSetInfo DefaultVirtualMachineScaleSetInfo { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultVirtualMachineScaleSetInfo")] + public DefaultVirtualMachineScaleSetInfo DefaultVirtualMachineScaleSetInfo {get; private set; } /// - /// Gets specifies the Virtual Machine Scale Set that the Availability - /// Set is migrated to. + /// Gets specifies the Virtual Machine Scale Set that the Availability Set is + /// migrated to. /// - [JsonProperty(PropertyName = "migrateToVirtualMachineScaleSet")] - public SubResource MigrateToVirtualMachineScaleSet { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "migrateToVirtualMachineScaleSet")] + public SubResource MigrateToVirtualMachineScaleSet {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetNetworkConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetNetworkConfiguration.cs index 6865fa9add6b..98010acbfa8e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetNetworkConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetNetworkConfiguration.cs @@ -1,32 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Describes a virtual machine scale set network profile's network + /// Describes a virtual machine scale set network profile's network /// configurations. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachineScaleSetNetworkConfiguration { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetNetworkConfiguration class. + /// Initializes a new instance of the VirtualMachineScaleSetNetworkConfiguration class. /// public VirtualMachineScaleSetNetworkConfiguration() { @@ -34,52 +23,67 @@ public VirtualMachineScaleSetNetworkConfiguration() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetNetworkConfiguration class. - /// - /// The network configuration name. - /// Specifies the IP configurations of - /// the network interface. - /// Specifies the primary network interface in - /// case the virtual machine has more than 1 network interface. - /// Specifies whether the - /// network interface is accelerated networking-enabled. - /// Specifies whether the network - /// interface is disabled for tcp state tracking. - /// Specifies whether the network interface is - /// FPGA networking-enabled. - /// The network security - /// group. - /// The dns settings to be applied on the - /// network interfaces. - /// Whether IP forwarding enabled on - /// this NIC. - /// Specify what happens to the network - /// interface when the VM is deleted. Possible values include: - /// 'Delete', 'Detach' - /// Specifies whether the Auxiliary mode is - /// enabled for the Network Interface resource. Possible values - /// include: 'None', 'AcceleratedConnections', 'Floating' - /// Specifies whether the Auxiliary sku is - /// enabled for the Network Interface resource. Possible values - /// include: 'None', 'A1', 'A2', 'A4', 'A8' - /// Resource tags applied to the networkInterface - /// address created by this NetworkInterfaceConfiguration - public VirtualMachineScaleSetNetworkConfiguration(string name, IList ipConfigurations, bool? primary = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? disableTcpStateTracking = default(bool?), bool? enableFpga = default(bool?), SubResource networkSecurityGroup = default(SubResource), VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetNetworkConfigurationDnsSettings), bool? enableIPForwarding = default(bool?), string deleteOption = default(string), string auxiliaryMode = default(string), string auxiliarySku = default(string), IDictionary tags = default(IDictionary)) + /// Initializes a new instance of the VirtualMachineScaleSetNetworkConfiguration class. + /// + + /// The network configuration name. + /// + + /// Resource tags applied to the networkInterface address created by this + /// NetworkInterfaceConfiguration + /// + + /// Specifies the primary network interface in case the virtual machine has + /// more than 1 network interface. + /// + + /// Specifies whether the network interface is accelerated networking-enabled. + /// + + /// Specifies whether the network interface is disabled for tcp state tracking. + /// + + /// Specifies whether the network interface is FPGA networking-enabled. + /// + + /// The network security group. + /// + + /// The dns settings to be applied on the network interfaces. + /// + + /// Specifies the IP configurations of the network interface. + /// + + /// Whether IP forwarding enabled on this NIC. + /// + + /// Specify what happens to the network interface when the VM is deleted + /// Possible values include: 'Delete', 'Detach' + + /// Specifies whether the Auxiliary mode is enabled for the Network Interface + /// resource. + /// Possible values include: 'None', 'AcceleratedConnections', 'Floating' + + /// Specifies whether the Auxiliary sku is enabled for the Network Interface + /// resource. + /// Possible values include: 'None', 'A1', 'A2', 'A4', 'A8' + public VirtualMachineScaleSetNetworkConfiguration(string name, System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), bool? primary = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? disableTcpStateTracking = default(bool?), bool? enableFpga = default(bool?), SubResource networkSecurityGroup = default(SubResource), VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetNetworkConfigurationDnsSettings), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), bool? enableIPForwarding = default(bool?), string deleteOption = default(string), string auxiliaryMode = default(string), string auxiliarySku = default(string)) + { - Name = name; - Primary = primary; - EnableAcceleratedNetworking = enableAcceleratedNetworking; - DisableTcpStateTracking = disableTcpStateTracking; - EnableFpga = enableFpga; - NetworkSecurityGroup = networkSecurityGroup; - DnsSettings = dnsSettings; - IpConfigurations = ipConfigurations; - EnableIPForwarding = enableIPForwarding; - DeleteOption = deleteOption; - AuxiliaryMode = auxiliaryMode; - AuxiliarySku = auxiliarySku; - Tags = tags; + this.Name = name; + this.Tags = tags; + this.Primary = primary; + this.EnableAcceleratedNetworking = enableAcceleratedNetworking; + this.DisableTcpStateTracking = disableTcpStateTracking; + this.EnableFpga = enableFpga; + this.NetworkSecurityGroup = networkSecurityGroup; + this.DnsSettings = dnsSettings; + this.IpConfigurations = ipConfigurations; + this.EnableIPForwarding = enableIPForwarding; + this.DeleteOption = deleteOption; + this.AuxiliaryMode = auxiliaryMode; + this.AuxiliarySku = auxiliarySku; CustomInit(); } @@ -88,115 +92,111 @@ public VirtualMachineScaleSetNetworkConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the network configuration name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets specifies the primary network interface in case the - /// virtual machine has more than 1 network interface. + /// Gets or sets resource tags applied to the networkInterface address created + /// by this NetworkInterfaceConfiguration /// - [JsonProperty(PropertyName = "properties.primary")] - public bool? Primary { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets specifies the primary network interface in case the virtual + /// machine has more than 1 network interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primary")] + public bool? Primary {get; set; } /// /// Gets or sets specifies whether the network interface is accelerated /// networking-enabled. /// - [JsonProperty(PropertyName = "properties.enableAcceleratedNetworking")] - public bool? EnableAcceleratedNetworking { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableAcceleratedNetworking")] + public bool? EnableAcceleratedNetworking {get; set; } /// - /// Gets or sets specifies whether the network interface is disabled - /// for tcp state tracking. + /// Gets or sets specifies whether the network interface is disabled for tcp + /// state tracking. /// - [JsonProperty(PropertyName = "properties.disableTcpStateTracking")] - public bool? DisableTcpStateTracking { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disableTcpStateTracking")] + public bool? DisableTcpStateTracking {get; set; } /// /// Gets or sets specifies whether the network interface is FPGA /// networking-enabled. /// - [JsonProperty(PropertyName = "properties.enableFpga")] - public bool? EnableFpga { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableFpga")] + public bool? EnableFpga {get; set; } /// /// Gets or sets the network security group. /// - [JsonProperty(PropertyName = "properties.networkSecurityGroup")] - public SubResource NetworkSecurityGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkSecurityGroup")] + public SubResource NetworkSecurityGroup {get; set; } /// - /// Gets or sets the dns settings to be applied on the network - /// interfaces. + /// Gets or sets the dns settings to be applied on the network interfaces. /// - [JsonProperty(PropertyName = "properties.dnsSettings")] - public VirtualMachineScaleSetNetworkConfigurationDnsSettings DnsSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dnsSettings")] + public VirtualMachineScaleSetNetworkConfigurationDnsSettings DnsSettings {get; set; } /// - /// Gets or sets specifies the IP configurations of the network - /// interface. + /// Gets or sets specifies the IP configurations of the network interface. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IpConfigurations {get; set; } /// /// Gets or sets whether IP forwarding enabled on this NIC. /// - [JsonProperty(PropertyName = "properties.enableIPForwarding")] - public bool? EnableIPForwarding { get; set; } - - /// - /// Gets or sets specify what happens to the network interface when the - /// VM is deleted. Possible values include: 'Delete', 'Detach' - /// - [JsonProperty(PropertyName = "properties.deleteOption")] - public string DeleteOption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableIPForwarding")] + public bool? EnableIPForwarding {get; set; } /// - /// Gets or sets specifies whether the Auxiliary mode is enabled for - /// the Network Interface resource. Possible values include: 'None', - /// 'AcceleratedConnections', 'Floating' + /// Gets or sets specify what happens to the network interface when the VM is + /// deleted Possible values include: 'Delete', 'Detach' /// - [JsonProperty(PropertyName = "properties.auxiliaryMode")] - public string AuxiliaryMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deleteOption")] + public string DeleteOption {get; set; } /// - /// Gets or sets specifies whether the Auxiliary sku is enabled for the - /// Network Interface resource. Possible values include: 'None', 'A1', - /// 'A2', 'A4', 'A8' + /// Gets or sets specifies whether the Auxiliary mode is enabled for the + /// Network Interface resource. Possible values include: 'None', 'AcceleratedConnections', 'Floating' /// - [JsonProperty(PropertyName = "properties.auxiliarySku")] - public string AuxiliarySku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.auxiliaryMode")] + public string AuxiliaryMode {get; set; } /// - /// Gets or sets resource tags applied to the networkInterface address - /// created by this NetworkInterfaceConfiguration + /// Gets or sets specifies whether the Auxiliary sku is enabled for the Network + /// Interface resource. Possible values include: 'None', 'A1', 'A2', 'A4', 'A8' /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.auxiliarySku")] + public string AuxiliarySku {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (IpConfigurations == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "IpConfigurations"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (IpConfigurations != null) + + + + + if (this.IpConfigurations != null) { - foreach (var element in IpConfigurations) + foreach (var element in this.IpConfigurations) { if (element != null) { @@ -204,6 +204,9 @@ public virtual void Validate() } } } + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.cs index 4509c496042d..351efbf5bd6e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Describes a virtual machines scale sets network configuration's DNS + /// Describes a virtual machines scale sets network configuration's DNS /// settings. /// public partial class VirtualMachineScaleSetNetworkConfigurationDnsSettings { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetNetworkConfigurationDnsSettings class. + /// Initializes a new instance of the VirtualMachineScaleSetNetworkConfigurationDnsSettings class. /// public VirtualMachineScaleSetNetworkConfigurationDnsSettings() { @@ -31,13 +22,15 @@ public VirtualMachineScaleSetNetworkConfigurationDnsSettings() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetNetworkConfigurationDnsSettings class. + /// Initializes a new instance of the VirtualMachineScaleSetNetworkConfigurationDnsSettings class. /// - /// List of DNS servers IP addresses - public VirtualMachineScaleSetNetworkConfigurationDnsSettings(IList dnsServers = default(IList)) + + /// List of DNS servers IP addresses + /// + public VirtualMachineScaleSetNetworkConfigurationDnsSettings(System.Collections.Generic.IList dnsServers = default(System.Collections.Generic.IList)) + { - DnsServers = dnsServers; + this.DnsServers = dnsServers; CustomInit(); } @@ -46,11 +39,11 @@ public VirtualMachineScaleSetNetworkConfigurationDnsSettings() /// partial void CustomInit(); + /// /// Gets or sets list of DNS servers IP addresses /// - [JsonProperty(PropertyName = "dnsServers")] - public IList DnsServers { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsServers")] + public System.Collections.Generic.IList DnsServers {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetNetworkConfigurationProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetNetworkConfigurationProperties.cs new file mode 100644 index 000000000000..b1f5939c2b61 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetNetworkConfigurationProperties.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes a virtual machine scale set network profile's IP configuration. + /// + public partial class VirtualMachineScaleSetNetworkConfigurationProperties + { + /// + /// Initializes a new instance of the VirtualMachineScaleSetNetworkConfigurationProperties class. + /// + public VirtualMachineScaleSetNetworkConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineScaleSetNetworkConfigurationProperties class. + /// + + /// Specifies the primary network interface in case the virtual machine has + /// more than 1 network interface. + /// + + /// Specifies whether the network interface is accelerated networking-enabled. + /// + + /// Specifies whether the network interface is disabled for tcp state tracking. + /// + + /// Specifies whether the network interface is FPGA networking-enabled. + /// + + /// The network security group. + /// + + /// The dns settings to be applied on the network interfaces. + /// + + /// Specifies the IP configurations of the network interface. + /// + + /// Whether IP forwarding enabled on this NIC. + /// + + /// Specify what happens to the network interface when the VM is deleted + /// Possible values include: 'Delete', 'Detach' + + /// Specifies whether the Auxiliary mode is enabled for the Network Interface + /// resource. + /// Possible values include: 'None', 'AcceleratedConnections', 'Floating' + + /// Specifies whether the Auxiliary sku is enabled for the Network Interface + /// resource. + /// Possible values include: 'None', 'A1', 'A2', 'A4', 'A8' + public VirtualMachineScaleSetNetworkConfigurationProperties(System.Collections.Generic.IList ipConfigurations, bool? primary = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? disableTcpStateTracking = default(bool?), bool? enableFpga = default(bool?), SubResource networkSecurityGroup = default(SubResource), VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetNetworkConfigurationDnsSettings), bool? enableIPForwarding = default(bool?), string deleteOption = default(string), string auxiliaryMode = default(string), string auxiliarySku = default(string)) + + { + this.Primary = primary; + this.EnableAcceleratedNetworking = enableAcceleratedNetworking; + this.DisableTcpStateTracking = disableTcpStateTracking; + this.EnableFpga = enableFpga; + this.NetworkSecurityGroup = networkSecurityGroup; + this.DnsSettings = dnsSettings; + this.IpConfigurations = ipConfigurations; + this.EnableIPForwarding = enableIPForwarding; + this.DeleteOption = deleteOption; + this.AuxiliaryMode = auxiliaryMode; + this.AuxiliarySku = auxiliarySku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets specifies the primary network interface in case the virtual + /// machine has more than 1 network interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primary")] + public bool? Primary {get; set; } + + /// + /// Gets or sets specifies whether the network interface is accelerated + /// networking-enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableAcceleratedNetworking")] + public bool? EnableAcceleratedNetworking {get; set; } + + /// + /// Gets or sets specifies whether the network interface is disabled for tcp + /// state tracking. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disableTcpStateTracking")] + public bool? DisableTcpStateTracking {get; set; } + + /// + /// Gets or sets specifies whether the network interface is FPGA + /// networking-enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableFpga")] + public bool? EnableFpga {get; set; } + + /// + /// Gets or sets the network security group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkSecurityGroup")] + public SubResource NetworkSecurityGroup {get; set; } + + /// + /// Gets or sets the dns settings to be applied on the network interfaces. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsSettings")] + public VirtualMachineScaleSetNetworkConfigurationDnsSettings DnsSettings {get; set; } + + /// + /// Gets or sets specifies the IP configurations of the network interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurations")] + public System.Collections.Generic.IList IpConfigurations {get; set; } + + /// + /// Gets or sets whether IP forwarding enabled on this NIC. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableIPForwarding")] + public bool? EnableIPForwarding {get; set; } + + /// + /// Gets or sets specify what happens to the network interface when the VM is + /// deleted Possible values include: 'Delete', 'Detach' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "deleteOption")] + public string DeleteOption {get; set; } + + /// + /// Gets or sets specifies whether the Auxiliary mode is enabled for the + /// Network Interface resource. Possible values include: 'None', 'AcceleratedConnections', 'Floating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "auxiliaryMode")] + public string AuxiliaryMode {get; set; } + + /// + /// Gets or sets specifies whether the Auxiliary sku is enabled for the Network + /// Interface resource. Possible values include: 'None', 'A1', 'A2', 'A4', 'A8' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "auxiliarySku")] + public string AuxiliarySku {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.IpConfigurations == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "IpConfigurations"); + } + + + if (this.IpConfigurations != null) + { + foreach (var element in this.IpConfigurations) + { + if (element != null) + { + element.Validate(); + } + } + } + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetNetworkProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetNetworkProfile.cs index 302db710df56..246bf45d990f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetNetworkProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetNetworkProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetNetworkProfile { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetNetworkProfile class. + /// Initializes a new instance of the VirtualMachineScaleSetNetworkProfile class. /// public VirtualMachineScaleSetNetworkProfile() { @@ -30,25 +21,28 @@ public VirtualMachineScaleSetNetworkProfile() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetNetworkProfile class. + /// Initializes a new instance of the VirtualMachineScaleSetNetworkProfile class. /// - /// A reference to a load balancer probe used - /// to determine the health of an instance in the virtual machine scale - /// set. The reference will be in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - /// The list of network - /// configurations. - /// specifies the Microsoft.Network API - /// version used when creating networking resources in the Network - /// Interface Configurations for Virtual Machine Scale Set with - /// orchestration mode 'Flexible'. Possible values include: - /// '2020-11-01', '2022-11-01' - public VirtualMachineScaleSetNetworkProfile(ApiEntityReference healthProbe = default(ApiEntityReference), IList networkInterfaceConfigurations = default(IList), string networkApiVersion = default(string)) + + /// A reference to a load balancer probe used to determine the health of an + /// instance in the virtual machine scale set. The reference will be in the + /// form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + /// + + /// The list of network configurations. + /// + + /// specifies the Microsoft.Network API version used when creating networking + /// resources in the Network Interface Configurations for Virtual Machine Scale + /// Set with orchestration mode 'Flexible' + /// Possible values include: '2020-11-01', '2022-11-01' + public VirtualMachineScaleSetNetworkProfile(ApiEntityReference healthProbe = default(ApiEntityReference), System.Collections.Generic.IList networkInterfaceConfigurations = default(System.Collections.Generic.IList), string networkApiVersion = default(string)) + { - HealthProbe = healthProbe; - NetworkInterfaceConfigurations = networkInterfaceConfigurations; - NetworkApiVersion = networkApiVersion; + this.HealthProbe = healthProbe; + this.NetworkInterfaceConfigurations = networkInterfaceConfigurations; + this.NetworkApiVersion = networkApiVersion; CustomInit(); } @@ -57,30 +51,28 @@ public VirtualMachineScaleSetNetworkProfile() /// partial void CustomInit(); + /// - /// Gets or sets a reference to a load balancer probe used to determine - /// the health of an instance in the virtual machine scale set. The - /// reference will be in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + /// Gets or sets a reference to a load balancer probe used to determine the + /// health of an instance in the virtual machine scale set. The reference will + /// be in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. /// - [JsonProperty(PropertyName = "healthProbe")] - public ApiEntityReference HealthProbe { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "healthProbe")] + public ApiEntityReference HealthProbe {get; set; } /// /// Gets or sets the list of network configurations. /// - [JsonProperty(PropertyName = "networkInterfaceConfigurations")] - public IList NetworkInterfaceConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterfaceConfigurations")] + public System.Collections.Generic.IList NetworkInterfaceConfigurations {get; set; } /// - /// Gets or sets specifies the Microsoft.Network API version used when - /// creating networking resources in the Network Interface - /// Configurations for Virtual Machine Scale Set with orchestration - /// mode 'Flexible'. Possible values include: '2020-11-01', - /// '2022-11-01' + /// Gets or sets specifies the Microsoft.Network API version used when creating + /// networking resources in the Network Interface Configurations for Virtual + /// Machine Scale Set with orchestration mode 'Flexible' Possible values include: '2020-11-01', '2022-11-01' /// - [JsonProperty(PropertyName = "networkApiVersion")] - public string NetworkApiVersion { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "networkApiVersion")] + public string NetworkApiVersion {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetOSDisk.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetOSDisk.cs index a3e077fa16d0..e6f8675ab0af 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetOSDisk.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetOSDisk.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetOSDisk { /// - /// Initializes a new instance of the VirtualMachineScaleSetOSDisk - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetOSDisk class. /// public VirtualMachineScaleSetOSDisk() { @@ -31,66 +21,77 @@ public VirtualMachineScaleSetOSDisk() } /// - /// Initializes a new instance of the VirtualMachineScaleSetOSDisk - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetOSDisk class. /// - /// Specifies how the virtual machines in - /// the scale set should be created. The only allowed value is: - /// **FromImage.** This value is used when you are using an image to - /// create the virtual machine. If you are using a platform image, you - /// also use the imageReference element described above. If you are - /// using a marketplace image, you also use the plan element - /// previously described. Possible values include: 'FromImage', - /// 'Empty', 'Attach', 'Copy', 'Restore' - /// The disk name. - /// Specifies the caching requirements. Possible - /// values are: **None,** **ReadOnly,** **ReadWrite.** The default - /// values are: **None for Standard storage. ReadOnly for Premium - /// storage.**. Possible values include: 'None', 'ReadOnly', - /// 'ReadWrite' - /// Specifies whether - /// writeAccelerator should be enabled or disabled on the disk. - /// Specifies the ephemeral disk - /// Settings for the operating system disk used by the virtual machine - /// scale set. - /// Specifies the size of an empty data disk - /// in gigabytes. This element can be used to overwrite the size of the - /// disk in a virtual machine image. The property 'diskSizeGB' is the - /// number of bytes x 1024^3 for the disk and the value cannot be - /// larger than 1023. - /// This property allows you to specify the type - /// of the OS that is included in the disk if creating a VM from - /// user-image or a specialized VHD. Possible values are: **Windows,** - /// **Linux.**. Possible values include: 'Windows', 'Linux' - /// Specifies information about the unmanaged user - /// image to base the scale set on. - /// Specifies the container urls that are - /// used to store operating system disks for the scale set. - /// The managed disk parameters. - /// Specifies whether OS Disk should be - /// deleted or detached upon VMSS Flex deletion (This feature is - /// available for VMSS with Flexible OrchestrationMode only). - /// <br><br> Possible values: <br><br> - /// **Delete** If this value is used, the OS disk is deleted when VMSS - /// Flex VM is deleted.<br><br> **Detach** If this value is - /// used, the OS disk is retained after VMSS Flex VM is deleted. - /// <br><br> The default value is set to **Delete**. For an - /// Ephemeral OS Disk, the default value is set to **Delete**. User - /// cannot change the delete option for Ephemeral OS Disk. Possible - /// values include: 'Delete', 'Detach' - public VirtualMachineScaleSetOSDisk(string createOption, string name = default(string), CachingTypes? caching = default(CachingTypes?), bool? writeAcceleratorEnabled = default(bool?), DiffDiskSettings diffDiskSettings = default(DiffDiskSettings), int? diskSizeGB = default(int?), OperatingSystemTypes? osType = default(OperatingSystemTypes?), VirtualHardDisk image = default(VirtualHardDisk), IList vhdContainers = default(IList), VirtualMachineScaleSetManagedDiskParameters managedDisk = default(VirtualMachineScaleSetManagedDiskParameters), string deleteOption = default(string)) + + /// The disk name. + /// + + /// Specifies the caching requirements. Possible values are: **None,** + /// **ReadOnly,** **ReadWrite.** The default values are: **None for Standard + /// storage. ReadOnly for Premium storage.** + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + + /// Specifies whether writeAccelerator should be enabled or disabled on the + /// disk. + /// + + /// Specifies how the virtual machines in the scale set should be created. The + /// only allowed value is: **FromImage.** This value is used when you are using + /// an image to create the virtual machine. If you are using a platform image, + /// you also use the imageReference element described above. If you are using a + /// marketplace image, you also use the plan element previously described. + /// Possible values include: 'FromImage', 'Empty', 'Attach', 'Copy', 'Restore' + + /// Specifies the ephemeral disk Settings for the operating system disk used by + /// the virtual machine scale set. + /// + + /// Specifies the size of an empty data disk in gigabytes. This element can be + /// used to overwrite the size of the disk in a virtual machine image. The + /// property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the + /// value cannot be larger than 1023. + /// + + /// This property allows you to specify the type of the OS that is included in + /// the disk if creating a VM from user-image or a specialized VHD. Possible + /// values are: **Windows,** **Linux.** + /// Possible values include: 'Windows', 'Linux' + + /// Specifies information about the unmanaged user image to base the scale set + /// on. + /// + + /// Specifies the container urls that are used to store operating system disks + /// for the scale set. + /// + + /// The managed disk parameters. + /// + + /// Specifies whether OS Disk should be deleted or detached upon VMSS Flex + /// deletion (This feature is available for VMSS with Flexible + /// OrchestrationMode only). <br><br> Possible values: <br><br> **Delete** If + /// this value is used, the OS disk is deleted when VMSS Flex VM is + /// deleted.<br><br> **Detach** If this value is used, the OS disk is retained + /// after VMSS Flex VM is deleted. <br><br> The default value is set to + /// **Delete**. For an Ephemeral OS Disk, the default value is set to + /// **Delete**. User cannot change the delete option for Ephemeral OS Disk. + /// Possible values include: 'Delete', 'Detach' + public VirtualMachineScaleSetOSDisk(string createOption, string name = default(string), CachingTypes? caching = default(CachingTypes?), bool? writeAcceleratorEnabled = default(bool?), DiffDiskSettings diffDiskSettings = default(DiffDiskSettings), int? diskSizeGb = default(int?), OperatingSystemTypes? osType = default(OperatingSystemTypes?), VirtualHardDisk image = default(VirtualHardDisk), System.Collections.Generic.IList vhdContainers = default(System.Collections.Generic.IList), VirtualMachineScaleSetManagedDiskParameters managedDisk = default(VirtualMachineScaleSetManagedDiskParameters), string deleteOption = default(string)) + { - Name = name; - Caching = caching; - WriteAcceleratorEnabled = writeAcceleratorEnabled; - CreateOption = createOption; - DiffDiskSettings = diffDiskSettings; - DiskSizeGB = diskSizeGB; - OsType = osType; - Image = image; - VhdContainers = vhdContainers; - ManagedDisk = managedDisk; - DeleteOption = deleteOption; + this.Name = name; + this.Caching = caching; + this.WriteAcceleratorEnabled = writeAcceleratorEnabled; + this.CreateOption = createOption; + this.DiffDiskSettings = diffDiskSettings; + this.DiskSizeGB = diskSizeGb; + this.OsType = osType; + this.Image = image; + this.VhdContainers = vhdContainers; + this.ManagedDisk = managedDisk; + this.DeleteOption = deleteOption; CustomInit(); } @@ -99,116 +100,116 @@ public VirtualMachineScaleSetOSDisk() /// partial void CustomInit(); + /// /// Gets or sets the disk name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets specifies the caching requirements. Possible values - /// are: **None,** **ReadOnly,** **ReadWrite.** The default values are: - /// **None for Standard storage. ReadOnly for Premium storage.**. - /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + /// Gets or sets specifies the caching requirements. Possible values are: + /// **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for + /// Standard storage. ReadOnly for Premium storage.** Possible values include: 'None', 'ReadOnly', 'ReadWrite' /// - [JsonProperty(PropertyName = "caching")] - public CachingTypes? Caching { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "caching")] + public CachingTypes? Caching {get; set; } /// - /// Gets or sets specifies whether writeAccelerator should be enabled - /// or disabled on the disk. + /// Gets or sets specifies whether writeAccelerator should be enabled or + /// disabled on the disk. /// - [JsonProperty(PropertyName = "writeAcceleratorEnabled")] - public bool? WriteAcceleratorEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "writeAcceleratorEnabled")] + public bool? WriteAcceleratorEnabled {get; set; } /// - /// Gets or sets specifies how the virtual machines in the scale set - /// should be created. The only allowed value is: **FromImage.** This - /// value is used when you are using an image to create the virtual - /// machine. If you are using a platform image, you also use the - /// imageReference element described above. If you are using a - /// marketplace image, you also use the plan element previously - /// described. Possible values include: 'FromImage', 'Empty', 'Attach', - /// 'Copy', 'Restore' + /// Gets or sets specifies how the virtual machines in the scale set should be + /// created. The only allowed value is: **FromImage.** This value is used when + /// you are using an image to create the virtual machine. If you are using a + /// platform image, you also use the imageReference element described above. If + /// you are using a marketplace image, you also use the plan element + /// previously described. Possible values include: 'FromImage', 'Empty', 'Attach', 'Copy', 'Restore' /// - [JsonProperty(PropertyName = "createOption")] - public string CreateOption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createOption")] + public string CreateOption {get; set; } /// - /// Gets or sets specifies the ephemeral disk Settings for the - /// operating system disk used by the virtual machine scale set. + /// Gets or sets specifies the ephemeral disk Settings for the operating system + /// disk used by the virtual machine scale set. /// - [JsonProperty(PropertyName = "diffDiskSettings")] - public DiffDiskSettings DiffDiskSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diffDiskSettings")] + public DiffDiskSettings DiffDiskSettings {get; set; } /// - /// Gets or sets specifies the size of an empty data disk in gigabytes. - /// This element can be used to overwrite the size of the disk in a - /// virtual machine image. The property 'diskSizeGB' is the number of - /// bytes x 1024^3 for the disk and the value cannot be larger than - /// 1023. + /// Gets or sets specifies the size of an empty data disk in gigabytes. This + /// element can be used to overwrite the size of the disk in a virtual machine + /// image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the + /// disk and the value cannot be larger than 1023. /// - [JsonProperty(PropertyName = "diskSizeGB")] - public int? DiskSizeGB { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeGB")] + public int? DiskSizeGB {get; set; } /// - /// Gets or sets this property allows you to specify the type of the OS - /// that is included in the disk if creating a VM from user-image or a - /// specialized VHD. Possible values are: **Windows,** **Linux.**. - /// Possible values include: 'Windows', 'Linux' + /// Gets or sets this property allows you to specify the type of the OS that is + /// included in the disk if creating a VM from user-image or a specialized VHD. + /// Possible values are: **Windows,** **Linux.** Possible values include: 'Windows', 'Linux' /// - [JsonProperty(PropertyName = "osType")] - public OperatingSystemTypes? OsType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osType")] + public OperatingSystemTypes? OsType {get; set; } /// - /// Gets or sets specifies information about the unmanaged user image - /// to base the scale set on. + /// Gets or sets specifies information about the unmanaged user image to base + /// the scale set on. /// - [JsonProperty(PropertyName = "image")] - public VirtualHardDisk Image { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "image")] + public VirtualHardDisk Image {get; set; } /// - /// Gets or sets specifies the container urls that are used to store - /// operating system disks for the scale set. + /// Gets or sets specifies the container urls that are used to store operating + /// system disks for the scale set. /// - [JsonProperty(PropertyName = "vhdContainers")] - public IList VhdContainers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vhdContainers")] + public System.Collections.Generic.IList VhdContainers {get; set; } /// /// Gets or sets the managed disk parameters. /// - [JsonProperty(PropertyName = "managedDisk")] - public VirtualMachineScaleSetManagedDiskParameters ManagedDisk { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managedDisk")] + public VirtualMachineScaleSetManagedDiskParameters ManagedDisk {get; set; } /// - /// Gets or sets specifies whether OS Disk should be deleted or - /// detached upon VMSS Flex deletion (This feature is available for - /// VMSS with Flexible OrchestrationMode only). - /// &lt;br&gt;&lt;br&gt; Possible values: - /// &lt;br&gt;&lt;br&gt; **Delete** If this value is - /// used, the OS disk is deleted when VMSS Flex VM is - /// deleted.&lt;br&gt;&lt;br&gt; **Detach** If this - /// value is used, the OS disk is retained after VMSS Flex VM is - /// deleted. &lt;br&gt;&lt;br&gt; The default value is - /// set to **Delete**. For an Ephemeral OS Disk, the default value is - /// set to **Delete**. User cannot change the delete option for - /// Ephemeral OS Disk. Possible values include: 'Delete', 'Detach' + /// Gets or sets specifies whether OS Disk should be deleted or detached upon + /// VMSS Flex deletion (This feature is available for VMSS with Flexible + /// OrchestrationMode only). <br><br> Possible values: <br><br> **Delete** If + /// this value is used, the OS disk is deleted when VMSS Flex VM is + /// deleted.<br><br> **Detach** If this value is used, the OS disk is retained + /// after VMSS Flex VM is deleted. <br><br> The default value is set to + /// **Delete**. For an Ephemeral OS Disk, the default value is set to + /// **Delete**. User cannot change the delete option for Ephemeral OS Disk. Possible values include: 'Delete', 'Detach' /// - [JsonProperty(PropertyName = "deleteOption")] - public string DeleteOption { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "deleteOption")] + public string DeleteOption {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (CreateOption == null) + if (this.CreateOption == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "CreateOption"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CreateOption"); } + + + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetOSProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetOSProfile.cs index a89473267f38..48b8f6fa89c1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetOSProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetOSProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetOSProfile { /// - /// Initializes a new instance of the VirtualMachineScaleSetOSProfile - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetOSProfile class. /// public VirtualMachineScaleSetOSProfile() { @@ -30,78 +21,84 @@ public VirtualMachineScaleSetOSProfile() } /// - /// Initializes a new instance of the VirtualMachineScaleSetOSProfile - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetOSProfile class. /// - /// Specifies the computer name prefix - /// for all of the virtual machines in the scale set. Computer name - /// prefixes must be 1 to 15 characters long. - /// Specifies the name of the administrator - /// account. <br><br> **Windows-only restriction:** Cannot - /// end in "." <br><br> **Disallowed values:** - /// "administrator", "admin", "user", "user1", "test", "user2", - /// "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", - /// "admin2", "aspnet", "backup", "console", "david", "guest", "john", - /// "owner", "root", "server", "sql", "support", "support_388945a0", - /// "sys", "test2", "test3", "user4", "user5". <br><br> - /// **Minimum-length (Linux):** 1 character <br><br> - /// **Max-length (Linux):** 64 characters <br><br> - /// **Max-length (Windows):** 20 characters - /// Specifies the password of the - /// administrator account. <br><br> **Minimum-length - /// (Windows):** 8 characters <br><br> **Minimum-length - /// (Linux):** 6 characters <br><br> **Max-length - /// (Windows):** 123 characters <br><br> **Max-length - /// (Linux):** 72 characters <br><br> **Complexity - /// requirements:** 3 out of 4 conditions below need to be fulfilled - /// <br> Has lower characters <br>Has upper characters - /// <br> Has a digit <br> Has a special character (Regex - /// match [\W_]) <br><br> **Disallowed values:** "abc@123", - /// "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", - /// "Password!", "Password1", "Password22", "iloveyou!" - /// <br><br> For resetting the password, see [How to reset - /// the Remote Desktop service or its login password in a Windows + + /// Specifies the computer name prefix for all of the virtual machines in the + /// scale set. Computer name prefixes must be 1 to 15 characters long. + /// + + /// Specifies the name of the administrator account. <br><br> **Windows-only + /// restriction:** Cannot end in "." <br><br> **Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", "test1", + /// "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + /// "backup", "console", "david", "guest", "john", "owner", "root", "server", + /// "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", + /// "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> + /// **Max-length (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 + /// characters + /// + + /// Specifies the password of the administrator account. <br><br> + /// **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length + /// (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters + /// <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity + /// requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has + /// lower characters <br>Has upper characters <br> Has a digit <br> Has a + /// special character (Regex match [\W_]) <br><br> **Disallowed values:** + /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", + /// "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting + /// the password, see [How to reset the Remote Desktop service or its login + /// password in a Windows /// VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) - /// <br><br> For resetting root password, see [Manage - /// users, SSH, and check or repair disks on Azure Linux VMs using the - /// VMAccess - /// Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) - /// Specifies a base-64 encoded string of - /// custom data. The base-64 encoded string is decoded to a binary - /// array that is saved as a file on the Virtual Machine. The maximum - /// length of the binary array is 65535 bytes. For using cloud-init for - /// your VM, see [Using cloud-init to customize a Linux VM during - /// creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init) - /// Specifies Windows operating - /// system settings on the virtual machine. - /// Specifies the Linux operating - /// system settings on the virtual machine. For a list of supported - /// Linux distributions, see [Linux on Azure-Endorsed - /// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). - /// Specifies set of certificates that should be - /// installed onto the virtual machines in the scale set. To install - /// certificates on a virtual machine it is recommended to use the - /// [Azure Key Vault virtual machine extension for + /// <br><br> For resetting root password, see [Manage users, SSH, and check or + /// repair disks on Azure Linux VMs using the VMAccess + /// Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) + /// + + /// Specifies a base-64 encoded string of custom data. The base-64 encoded + /// string is decoded to a binary array that is saved as a file on the Virtual + /// Machine. The maximum length of the binary array is 65535 bytes. For using + /// cloud-init for your VM, see [Using cloud-init to customize a Linux VM + /// during + /// creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init) + /// + + /// Specifies Windows operating system settings on the virtual machine. + /// + + /// Specifies the Linux operating system settings on the virtual machine. For a + /// list of supported Linux distributions, see [Linux on Azure-Endorsed + /// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + /// + + /// Specifies set of certificates that should be installed onto the virtual + /// machines in the scale set. To install certificates on a virtual machine it + /// is recommended to use the [Azure Key Vault virtual machine extension for /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) /// or the [Azure Key Vault virtual machine extension for - /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). - /// Specifies whether extension - /// operations should be allowed on the virtual machine scale set. This - /// may only be set to False when no extensions are present on the - /// virtual machine scale set. - /// Optional property which - /// must either be set to True or omitted. - public VirtualMachineScaleSetOSProfile(string computerNamePrefix = default(string), string adminUsername = default(string), string adminPassword = default(string), string customData = default(string), WindowsConfiguration windowsConfiguration = default(WindowsConfiguration), LinuxConfiguration linuxConfiguration = default(LinuxConfiguration), IList secrets = default(IList), bool? allowExtensionOperations = default(bool?), bool? requireGuestProvisionSignal = default(bool?)) + /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + /// + + /// Specifies whether extension operations should be allowed on the virtual + /// machine scale set. This may only be set to False when no extensions are + /// present on the virtual machine scale set. + /// + + /// Optional property which must either be set to True or omitted. + /// + public VirtualMachineScaleSetOSProfile(string computerNamePrefix = default(string), string adminUsername = default(string), string adminPassword = default(string), string customData = default(string), WindowsConfiguration windowsConfiguration = default(WindowsConfiguration), LinuxConfiguration linuxConfiguration = default(LinuxConfiguration), System.Collections.Generic.IList secrets = default(System.Collections.Generic.IList), bool? allowExtensionOperations = default(bool?), bool? requireGuestProvisionSignal = default(bool?)) + { - ComputerNamePrefix = computerNamePrefix; - AdminUsername = adminUsername; - AdminPassword = adminPassword; - CustomData = customData; - WindowsConfiguration = windowsConfiguration; - LinuxConfiguration = linuxConfiguration; - Secrets = secrets; - AllowExtensionOperations = allowExtensionOperations; - RequireGuestProvisionSignal = requireGuestProvisionSignal; + this.ComputerNamePrefix = computerNamePrefix; + this.AdminUsername = adminUsername; + this.AdminPassword = adminPassword; + this.CustomData = customData; + this.WindowsConfiguration = windowsConfiguration; + this.LinuxConfiguration = linuxConfiguration; + this.Secrets = secrets; + this.AllowExtensionOperations = allowExtensionOperations; + this.RequireGuestProvisionSignal = requireGuestProvisionSignal; CustomInit(); } @@ -110,112 +107,100 @@ public VirtualMachineScaleSetOSProfile() /// partial void CustomInit(); + /// - /// Gets or sets specifies the computer name prefix for all of the - /// virtual machines in the scale set. Computer name prefixes must be 1 - /// to 15 characters long. + /// Gets or sets specifies the computer name prefix for all of the virtual + /// machines in the scale set. Computer name prefixes must be 1 to 15 + /// characters long. /// - [JsonProperty(PropertyName = "computerNamePrefix")] - public string ComputerNamePrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "computerNamePrefix")] + public string ComputerNamePrefix {get; set; } /// - /// Gets or sets specifies the name of the administrator account. - /// &lt;br&gt;&lt;br&gt; **Windows-only restriction:** - /// Cannot end in "." &lt;br&gt;&lt;br&gt; **Disallowed - /// values:** "administrator", "admin", "user", "user1", "test", - /// "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", - /// "adm", "admin2", "aspnet", "backup", "console", "david", "guest", - /// "john", "owner", "root", "server", "sql", "support", - /// "support_388945a0", "sys", "test2", "test3", "user4", "user5". - /// &lt;br&gt;&lt;br&gt; **Minimum-length (Linux):** 1 - /// character &lt;br&gt;&lt;br&gt; **Max-length - /// (Linux):** 64 characters &lt;br&gt;&lt;br&gt; - /// **Max-length (Windows):** 20 characters + /// Gets or sets specifies the name of the administrator account. <br><br> + /// **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed + /// values:** "administrator", "admin", "user", "user1", "test", "user2", + /// "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", + /// "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", + /// "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", + /// "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character + /// <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length + /// (Windows):** 20 characters /// - [JsonProperty(PropertyName = "adminUsername")] - public string AdminUsername { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "adminUsername")] + public string AdminUsername {get; set; } /// - /// Gets or sets specifies the password of the administrator account. - /// &lt;br&gt;&lt;br&gt; **Minimum-length (Windows):** - /// 8 characters &lt;br&gt;&lt;br&gt; **Minimum-length - /// (Linux):** 6 characters &lt;br&gt;&lt;br&gt; - /// **Max-length (Windows):** 123 characters - /// &lt;br&gt;&lt;br&gt; **Max-length (Linux):** 72 - /// characters &lt;br&gt;&lt;br&gt; **Complexity - /// requirements:** 3 out of 4 conditions below need to be fulfilled - /// &lt;br&gt; Has lower characters &lt;br&gt;Has upper - /// characters &lt;br&gt; Has a digit &lt;br&gt; Has a - /// special character (Regex match [\W_]) - /// &lt;br&gt;&lt;br&gt; **Disallowed values:** - /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", - /// "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" - /// &lt;br&gt;&lt;br&gt; For resetting the password, - /// see [How to reset the Remote Desktop service or its login password - /// in a Windows + /// Gets or sets specifies the password of the administrator account. <br><br> + /// **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length + /// (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters + /// <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity + /// requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has + /// lower characters <br>Has upper characters <br> Has a digit <br> Has a + /// special character (Regex match [\W_]) <br><br> **Disallowed values:** + /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", + /// "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting + /// the password, see [How to reset the Remote Desktop service or its login + /// password in a Windows /// VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) - /// &lt;br&gt;&lt;br&gt; For resetting root password, - /// see [Manage users, SSH, and check or repair disks on Azure Linux - /// VMs using the VMAccess + /// <br><br> For resetting root password, see [Manage users, SSH, and check or + /// repair disks on Azure Linux VMs using the VMAccess /// Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) /// - [JsonProperty(PropertyName = "adminPassword")] - public string AdminPassword { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "adminPassword")] + public string AdminPassword {get; set; } /// - /// Gets or sets specifies a base-64 encoded string of custom data. The - /// base-64 encoded string is decoded to a binary array that is saved - /// as a file on the Virtual Machine. The maximum length of the binary - /// array is 65535 bytes. For using cloud-init for your VM, see [Using - /// cloud-init to customize a Linux VM during + /// Gets or sets specifies a base-64 encoded string of custom data. The base-64 + /// encoded string is decoded to a binary array that is saved as a file on the + /// Virtual Machine. The maximum length of the binary array is 65535 bytes. For + /// using cloud-init for your VM, see [Using cloud-init to customize a Linux VM + /// during /// creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init) /// - [JsonProperty(PropertyName = "customData")] - public string CustomData { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "customData")] + public string CustomData {get; set; } /// - /// Gets or sets specifies Windows operating system settings on the - /// virtual machine. + /// Gets or sets specifies Windows operating system settings on the virtual + /// machine. /// - [JsonProperty(PropertyName = "windowsConfiguration")] - public WindowsConfiguration WindowsConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "windowsConfiguration")] + public WindowsConfiguration WindowsConfiguration {get; set; } /// - /// Gets or sets specifies the Linux operating system settings on the - /// virtual machine. For a list of supported Linux distributions, see - /// [Linux on Azure-Endorsed + /// Gets or sets specifies the Linux operating system settings on the virtual + /// machine. For a list of supported Linux distributions, see [Linux on + /// Azure-Endorsed /// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). /// - [JsonProperty(PropertyName = "linuxConfiguration")] - public LinuxConfiguration LinuxConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "linuxConfiguration")] + public LinuxConfiguration LinuxConfiguration {get; set; } /// - /// Gets or sets specifies set of certificates that should be installed - /// onto the virtual machines in the scale set. To install certificates - /// on a virtual machine it is recommended to use the [Azure Key Vault - /// virtual machine extension for + /// Gets or sets specifies set of certificates that should be installed onto + /// the virtual machines in the scale set. To install certificates on a virtual + /// machine it is recommended to use the [Azure Key Vault virtual machine + /// extension for /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) /// or the [Azure Key Vault virtual machine extension for /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). /// - [JsonProperty(PropertyName = "secrets")] - public IList Secrets { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "secrets")] + public System.Collections.Generic.IList Secrets {get; set; } /// - /// Gets or sets specifies whether extension operations should be - /// allowed on the virtual machine scale set. This may only be set to - /// False when no extensions are present on the virtual machine scale - /// set. + /// Gets or sets specifies whether extension operations should be allowed on + /// the virtual machine scale set. This may only be set to False when no + /// extensions are present on the virtual machine scale set. /// - [JsonProperty(PropertyName = "allowExtensionOperations")] - public bool? AllowExtensionOperations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "allowExtensionOperations")] + public bool? AllowExtensionOperations {get; set; } /// - /// Gets or sets optional property which must either be set to True or - /// omitted. + /// Gets or sets optional property which must either be set to True or omitted. /// - [JsonProperty(PropertyName = "requireGuestProvisionSignal")] - public bool? RequireGuestProvisionSignal { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "requireGuestProvisionSignal")] + public bool? RequireGuestProvisionSignal {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetProperties.cs new file mode 100644 index 000000000000..09b6e4c64a78 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetProperties.cs @@ -0,0 +1,360 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a Virtual Machine Scale Set. + /// + public partial class VirtualMachineScaleSetProperties + { + /// + /// Initializes a new instance of the VirtualMachineScaleSetProperties class. + /// + public VirtualMachineScaleSetProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineScaleSetProperties class. + /// + + /// The upgrade policy. + /// + + /// The ScheduledEventsPolicy. + /// + + /// Policy for automatic repairs. + /// + + /// The virtual machine profile. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// Specifies whether the Virtual Machine Scale Set should be overprovisioned. + /// + + /// When Overprovision is enabled, extensions are launched only on the + /// requested number of VMs which are finally kept. This property will hence + /// ensure that the extensions do not run on the extra overprovisioned VMs. + /// + + /// Specifies the ID which uniquely identifies a Virtual Machine Scale Set. + /// + + /// When true this limits the scale set to a single placement group, of max + /// size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be + /// modified to false. However, if singlePlacementGroup is false, it may not be + /// modified to true. + /// + + /// Whether to force strictly even Virtual Machine distribution cross x-zones + /// in case there is zone outage. zoneBalance property can only be set if the + /// zones property of the scale set contains more than one zone. If there are + /// no zones or only one zone specified, then zoneBalance property should not + /// be set. + /// + + /// Fault Domain count for each placement group. + /// + + /// Specifies information about the proximity placement group that the virtual + /// machine scale set should be assigned to. Minimum api-version: 2018-04-01. + /// + + /// Specifies information about the dedicated host group that the virtual + /// machine scale set resides in. Minimum api-version: 2020-06-01. + /// + + /// Specifies additional capabilities enabled or disabled on the Virtual + /// Machines in the Virtual Machine Scale Set. For instance: whether the + /// Virtual Machines have the capability to support attaching managed data + /// disks with UltraSSD_LRS storage account type. + /// + + /// Specifies the policies applied when scaling in Virtual Machines in the + /// Virtual Machine Scale Set. + /// + + /// Specifies the orchestration mode for the virtual machine scale set. + /// Possible values include: 'Uniform', 'Flexible' + + /// Specifies the Spot Restore properties for the virtual machine scale set. + /// + + /// Specifies the desired targets for mixing Spot and Regular priority VMs + /// within the same VMSS Flex instance. + /// + + /// Specifies the time at which the Virtual Machine Scale Set resource was + /// created. Minimum api-version: 2021-11-01. + /// + + /// Optional property which must either be set to True or omitted. + /// + + /// Policy for Resiliency + /// + + /// Specifies the align mode between Virtual Machine Scale Set compute and + /// storage Fault Domain count. + /// Possible values include: 'Aligned', 'Unaligned' + + /// Specifies the sku profile for the virtual machine scale set. + /// + + /// Specifies the high speed interconnect placement for the virtual machine + /// scale set. + /// Possible values include: 'None', 'Trunk' + public VirtualMachineScaleSetProperties(UpgradePolicy upgradePolicy = default(UpgradePolicy), ScheduledEventsPolicy scheduledEventsPolicy = default(ScheduledEventsPolicy), AutomaticRepairsPolicy automaticRepairsPolicy = default(AutomaticRepairsPolicy), VirtualMachineScaleSetVMProfile virtualMachineProfile = default(VirtualMachineScaleSetVMProfile), string provisioningState = default(string), bool? overprovision = default(bool?), bool? doNotRunExtensionsOnOverprovisionedVms = default(bool?), string uniqueId = default(string), bool? singlePlacementGroup = default(bool?), bool? zoneBalance = default(bool?), int? platformFaultDomainCount = default(int?), SubResource proximityPlacementGroup = default(SubResource), SubResource hostGroup = default(SubResource), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), ScaleInPolicy scaleInPolicy = default(ScaleInPolicy), string orchestrationMode = default(string), SpotRestorePolicy spotRestorePolicy = default(SpotRestorePolicy), PriorityMixPolicy priorityMixPolicy = default(PriorityMixPolicy), System.DateTime? timeCreated = default(System.DateTime?), bool? constrainedMaximumCapacity = default(bool?), ResiliencyPolicy resiliencyPolicy = default(ResiliencyPolicy), string zonalPlatformFaultDomainAlignMode = default(string), SkuProfile skuProfile = default(SkuProfile), string highSpeedInterconnectPlacement = default(string)) + + { + this.UpgradePolicy = upgradePolicy; + this.ScheduledEventsPolicy = scheduledEventsPolicy; + this.AutomaticRepairsPolicy = automaticRepairsPolicy; + this.VirtualMachineProfile = virtualMachineProfile; + this.ProvisioningState = provisioningState; + this.Overprovision = overprovision; + this.DoNotRunExtensionsOnOverprovisionedVMS = doNotRunExtensionsOnOverprovisionedVms; + this.UniqueId = uniqueId; + this.SinglePlacementGroup = singlePlacementGroup; + this.ZoneBalance = zoneBalance; + this.PlatformFaultDomainCount = platformFaultDomainCount; + this.ProximityPlacementGroup = proximityPlacementGroup; + this.HostGroup = hostGroup; + this.AdditionalCapabilities = additionalCapabilities; + this.ScaleInPolicy = scaleInPolicy; + this.OrchestrationMode = orchestrationMode; + this.SpotRestorePolicy = spotRestorePolicy; + this.PriorityMixPolicy = priorityMixPolicy; + this.TimeCreated = timeCreated; + this.ConstrainedMaximumCapacity = constrainedMaximumCapacity; + this.ResiliencyPolicy = resiliencyPolicy; + this.ZonalPlatformFaultDomainAlignMode = zonalPlatformFaultDomainAlignMode; + this.SkuProfile = skuProfile; + this.HighSpeedInterconnectPlacement = highSpeedInterconnectPlacement; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the upgrade policy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "upgradePolicy")] + public UpgradePolicy UpgradePolicy {get; set; } + + /// + /// Gets or sets the ScheduledEventsPolicy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scheduledEventsPolicy")] + public ScheduledEventsPolicy ScheduledEventsPolicy {get; set; } + + /// + /// Gets or sets policy for automatic repairs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "automaticRepairsPolicy")] + public AutomaticRepairsPolicy AutomaticRepairsPolicy {get; set; } + + /// + /// Gets or sets the virtual machine profile. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachineProfile")] + public VirtualMachineScaleSetVMProfile VirtualMachineProfile {get; set; } + + /// + /// Gets the provisioning state, which only appears in the response. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets specifies whether the Virtual Machine Scale Set should be + /// overprovisioned. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "overprovision")] + public bool? Overprovision {get; set; } + + /// + /// Gets or sets when Overprovision is enabled, extensions are launched only on + /// the requested number of VMs which are finally kept. This property will + /// hence ensure that the extensions do not run on the extra overprovisioned + /// VMs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "doNotRunExtensionsOnOverprovisionedVMs")] + public bool? DoNotRunExtensionsOnOverprovisionedVMS {get; set; } + + /// + /// Gets specifies the ID which uniquely identifies a Virtual Machine Scale + /// Set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueId")] + public string UniqueId {get; private set; } + + /// + /// Gets or sets when true this limits the scale set to a single placement + /// group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is + /// true, it may be modified to false. However, if singlePlacementGroup is + /// false, it may not be modified to true. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "singlePlacementGroup")] + public bool? SinglePlacementGroup {get; set; } + + /// + /// Gets or sets whether to force strictly even Virtual Machine distribution + /// cross x-zones in case there is zone outage. zoneBalance property can only + /// be set if the zones property of the scale set contains more than one zone. + /// If there are no zones or only one zone specified, then zoneBalance property + /// should not be set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "zoneBalance")] + public bool? ZoneBalance {get; set; } + + /// + /// Gets or sets fault Domain count for each placement group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "platformFaultDomainCount")] + public int? PlatformFaultDomainCount {get; set; } + + /// + /// Gets or sets specifies information about the proximity placement group that + /// the virtual machine scale set should be assigned to. Minimum api-version: + /// 2018-04-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "proximityPlacementGroup")] + public SubResource ProximityPlacementGroup {get; set; } + + /// + /// Gets or sets specifies information about the dedicated host group that the + /// virtual machine scale set resides in. Minimum api-version: 2020-06-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hostGroup")] + public SubResource HostGroup {get; set; } + + /// + /// Gets or sets specifies additional capabilities enabled or disabled on the + /// Virtual Machines in the Virtual Machine Scale Set. For instance: whether + /// the Virtual Machines have the capability to support attaching managed data + /// disks with UltraSSD_LRS storage account type. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalCapabilities")] + public AdditionalCapabilities AdditionalCapabilities {get; set; } + + /// + /// Gets or sets specifies the policies applied when scaling in Virtual + /// Machines in the Virtual Machine Scale Set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scaleInPolicy")] + public ScaleInPolicy ScaleInPolicy {get; set; } + + /// + /// Gets or sets specifies the orchestration mode for the virtual machine scale + /// set. Possible values include: 'Uniform', 'Flexible' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "orchestrationMode")] + public string OrchestrationMode {get; set; } + + /// + /// Gets or sets specifies the Spot Restore properties for the virtual machine + /// scale set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "spotRestorePolicy")] + public SpotRestorePolicy SpotRestorePolicy {get; set; } + + /// + /// Gets or sets specifies the desired targets for mixing Spot and Regular + /// priority VMs within the same VMSS Flex instance. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "priorityMixPolicy")] + public PriorityMixPolicy PriorityMixPolicy {get; set; } + + /// + /// Gets specifies the time at which the Virtual Machine Scale Set resource was + /// created. Minimum api-version: 2021-11-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeCreated")] + public System.DateTime? TimeCreated {get; private set; } + + /// + /// Gets or sets optional property which must either be set to True or omitted. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "constrainedMaximumCapacity")] + public bool? ConstrainedMaximumCapacity {get; set; } + + /// + /// Gets or sets policy for Resiliency + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resiliencyPolicy")] + public ResiliencyPolicy ResiliencyPolicy {get; set; } + + /// + /// Gets or sets specifies the align mode between Virtual Machine Scale Set + /// compute and storage Fault Domain count. Possible values include: 'Aligned', 'Unaligned' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "zonalPlatformFaultDomainAlignMode")] + public string ZonalPlatformFaultDomainAlignMode {get; set; } + + /// + /// Gets or sets specifies the sku profile for the virtual machine scale set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "skuProfile")] + public SkuProfile SkuProfile {get; set; } + + /// + /// Gets or sets specifies the high speed interconnect placement for the + /// virtual machine scale set. Possible values include: 'None', 'Trunk' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "highSpeedInterconnectPlacement")] + public string HighSpeedInterconnectPlacement {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.UpgradePolicy != null) + { + this.UpgradePolicy.Validate(); + } + + + if (this.VirtualMachineProfile != null) + { + this.VirtualMachineProfile.Validate(); + } + + + + + + + + + if (this.PriorityMixPolicy != null) + { + this.PriorityMixPolicy.Validate(); + } + if (this.ResiliencyPolicy != null) + { + this.ResiliencyPolicy.Validate(); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetPublicIPAddressConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetPublicIPAddressConfiguration.cs index d1fbf03a166a..27a2d16633b2 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetPublicIPAddressConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetPublicIPAddressConfiguration.cs @@ -1,32 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Describes a virtual machines scale set IP Configuration's - /// PublicIPAddress configuration + /// Describes a virtual machines scale set IP Configuration's PublicIPAddress + /// configuration /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachineScaleSetPublicIPAddressConfiguration { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetPublicIPAddressConfiguration class. + /// Initializes a new instance of the VirtualMachineScaleSetPublicIPAddressConfiguration class. /// public VirtualMachineScaleSetPublicIPAddressConfiguration() { @@ -34,41 +23,51 @@ public VirtualMachineScaleSetPublicIPAddressConfiguration() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetPublicIPAddressConfiguration class. + /// Initializes a new instance of the VirtualMachineScaleSetPublicIPAddressConfiguration class. /// - /// The publicIP address configuration name. - /// The idle timeout of the public - /// IP address. - /// The dns settings to be applied on the - /// publicIP addresses . - /// The list of IP tags associated with the public - /// IP address. - /// The PublicIPPrefix from which to - /// allocate publicIP addresses. - /// Available from Api-Version - /// 2019-07-01 onwards, it represents whether the specific - /// ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible - /// values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - /// 'IPv6' - /// Specify what happens to the public IP - /// when the VM is deleted. Possible values include: 'Delete', - /// 'Detach' - /// Describes the public IP Sku. It can only be set - /// with OrchestrationMode as Flexible. - /// Resource tags applied to the publicIP address - /// created by this PublicIPAddressConfiguration - public VirtualMachineScaleSetPublicIPAddressConfiguration(string name, int? idleTimeoutInMinutes = default(int?), VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings), IList ipTags = default(IList), SubResource publicIPPrefix = default(SubResource), string publicIPAddressVersion = default(string), string deleteOption = default(string), PublicIPAddressSku sku = default(PublicIPAddressSku), IDictionary tags = default(IDictionary)) + + /// The publicIP address configuration name. + /// + + /// Describes the public IP Sku. It can only be set with OrchestrationMode as + /// Flexible. + /// + + /// Resource tags applied to the publicIP address created by this + /// PublicIPAddressConfiguration + /// + + /// The idle timeout of the public IP address. + /// + + /// The dns settings to be applied on the publicIP addresses . + /// + + /// The list of IP tags associated with the public IP address. + /// + + /// The PublicIPPrefix from which to allocate publicIP addresses. + /// + + /// Available from Api-Version 2019-07-01 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + /// Possible values are: 'IPv4' and 'IPv6'. + /// Possible values include: 'IPv4', 'IPv6' + + /// Specify what happens to the public IP when the VM is deleted + /// Possible values include: 'Delete', 'Detach' + public VirtualMachineScaleSetPublicIPAddressConfiguration(string name, PublicIPAddressSku sku = default(PublicIPAddressSku), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), int? idleTimeoutInMinutes = default(int?), VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings), System.Collections.Generic.IList ipTags = default(System.Collections.Generic.IList), SubResource publicIPPrefix = default(SubResource), string publicIPAddressVersion = default(string), string deleteOption = default(string)) + { - Name = name; - IdleTimeoutInMinutes = idleTimeoutInMinutes; - DnsSettings = dnsSettings; - IpTags = ipTags; - PublicIPPrefix = publicIPPrefix; - PublicIPAddressVersion = publicIPAddressVersion; - DeleteOption = deleteOption; - Sku = sku; - Tags = tags; + this.Name = name; + this.Sku = sku; + this.Tags = tags; + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; + this.DnsSettings = dnsSettings; + this.IpTags = ipTags; + this.PublicIPPrefix = publicIPPrefix; + this.PublicIPAddressVersion = publicIPAddressVersion; + this.DeleteOption = deleteOption; CustomInit(); } @@ -77,85 +76,87 @@ public VirtualMachineScaleSetPublicIPAddressConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the publicIP address configuration name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the idle timeout of the public IP address. + /// Gets or sets describes the public IP Sku. It can only be set with + /// OrchestrationMode as Flexible. /// - [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] - public int? IdleTimeoutInMinutes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public PublicIPAddressSku Sku {get; set; } /// - /// Gets or sets the dns settings to be applied on the publicIP - /// addresses . + /// Gets or sets resource tags applied to the publicIP address created by this + /// PublicIPAddressConfiguration /// - [JsonProperty(PropertyName = "properties.dnsSettings")] - public VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings DnsSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets or sets the list of IP tags associated with the public IP - /// address. + /// Gets or sets the idle timeout of the public IP address. /// - [JsonProperty(PropertyName = "properties.ipTags")] - public IList IpTags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } /// - /// Gets or sets the PublicIPPrefix from which to allocate publicIP - /// addresses. + /// Gets or sets the dns settings to be applied on the publicIP addresses . /// - [JsonProperty(PropertyName = "properties.publicIPPrefix")] - public SubResource PublicIPPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dnsSettings")] + public VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings DnsSettings {get; set; } /// - /// Gets or sets available from Api-Version 2019-07-01 onwards, it - /// represents whether the specific ipconfiguration is IPv4 or IPv6. - /// Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - /// Possible values include: 'IPv4', 'IPv6' + /// Gets or sets the list of IP tags associated with the public IP address. /// - [JsonProperty(PropertyName = "properties.publicIPAddressVersion")] - public string PublicIPAddressVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipTags")] + public System.Collections.Generic.IList IpTags {get; set; } /// - /// Gets or sets specify what happens to the public IP when the VM is - /// deleted. Possible values include: 'Delete', 'Detach' + /// Gets or sets the PublicIPPrefix from which to allocate publicIP addresses. /// - [JsonProperty(PropertyName = "properties.deleteOption")] - public string DeleteOption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPPrefix")] + public SubResource PublicIPPrefix {get; set; } /// - /// Gets or sets describes the public IP Sku. It can only be set with - /// OrchestrationMode as Flexible. + /// Gets or sets available from Api-Version 2019-07-01 onwards, it represents + /// whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as + /// IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' /// - [JsonProperty(PropertyName = "sku")] - public PublicIPAddressSku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddressVersion")] + public string PublicIPAddressVersion {get; set; } /// - /// Gets or sets resource tags applied to the publicIP address created - /// by this PublicIPAddressConfiguration + /// Gets or sets specify what happens to the public IP when the VM is deleted Possible values include: 'Delete', 'Detach' /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deleteOption")] + public string DeleteOption {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (DnsSettings != null) + + + + if (this.DnsSettings != null) { - DnsSettings.Validate(); + this.DnsSettings.Validate(); } + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings.cs index b62d2eacd133..18ec8b1e26fd 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// - /// Describes a virtual machines scale sets network configuration's DNS + /// Describes a virtual machines scale sets network configuration's DNS /// settings. /// public partial class VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings class. /// public VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings() { @@ -31,24 +22,25 @@ public VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings class. /// - /// The Domain name label.The - /// concatenation of the domain name label and vm index will be the - /// domain name labels of the PublicIPAddress resources that will be - /// created - /// The Domain name label scope.The - /// concatenation of the hashed domain name label that generated - /// according to the policy from domain name label scope and vm index - /// will be the domain name labels of the PublicIPAddress resources - /// that will be created. Possible values include: 'TenantReuse', - /// 'SubscriptionReuse', 'ResourceGroupReuse', 'NoReuse' + + /// The Domain name label.The concatenation of the domain name label and vm + /// index will be the domain name labels of the PublicIPAddress resources that + /// will be created + /// + + /// The Domain name label scope.The concatenation of the hashed domain name + /// label that generated according to the policy from domain name label scope + /// and vm index will be the domain name labels of the PublicIPAddress + /// resources that will be created + /// Possible values include: 'TenantReuse', 'SubscriptionReuse', + /// 'ResourceGroupReuse', 'NoReuse' public VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings(string domainNameLabel, string domainNameLabelScope = default(string)) + { - DomainNameLabel = domainNameLabel; - DomainNameLabelScope = domainNameLabelScope; + this.DomainNameLabel = domainNameLabel; + this.DomainNameLabelScope = domainNameLabelScope; CustomInit(); } @@ -57,37 +49,37 @@ public VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings() /// partial void CustomInit(); + /// - /// Gets or sets the Domain name label.The concatenation of the domain - /// name label and vm index will be the domain name labels of the - /// PublicIPAddress resources that will be created + /// Gets or sets the Domain name label.The concatenation of the domain name + /// label and vm index will be the domain name labels of the PublicIPAddress + /// resources that will be created /// - [JsonProperty(PropertyName = "domainNameLabel")] - public string DomainNameLabel { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "domainNameLabel")] + public string DomainNameLabel {get; set; } /// - /// Gets or sets the Domain name label scope.The concatenation of the - /// hashed domain name label that generated according to the policy - /// from domain name label scope and vm index will be the domain name - /// labels of the PublicIPAddress resources that will be created. - /// Possible values include: 'TenantReuse', 'SubscriptionReuse', - /// 'ResourceGroupReuse', 'NoReuse' + /// Gets or sets the Domain name label scope.The concatenation of the hashed + /// domain name label that generated according to the policy from domain name + /// label scope and vm index will be the domain name labels of the + /// PublicIPAddress resources that will be created Possible values include: 'TenantReuse', 'SubscriptionReuse', 'ResourceGroupReuse', 'NoReuse' /// - [JsonProperty(PropertyName = "domainNameLabelScope")] - public string DomainNameLabelScope { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "domainNameLabelScope")] + public string DomainNameLabelScope {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (DomainNameLabel == null) + if (this.DomainNameLabel == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "DomainNameLabel"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DomainNameLabel"); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetPublicIPAddressConfigurationProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetPublicIPAddressConfigurationProperties.cs new file mode 100644 index 000000000000..15066c234034 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetPublicIPAddressConfigurationProperties.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes a virtual machines scale set IP Configuration's PublicIPAddress + /// configuration + /// + public partial class VirtualMachineScaleSetPublicIPAddressConfigurationProperties + { + /// + /// Initializes a new instance of the VirtualMachineScaleSetPublicIPAddressConfigurationProperties class. + /// + public VirtualMachineScaleSetPublicIPAddressConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineScaleSetPublicIPAddressConfigurationProperties class. + /// + + /// The idle timeout of the public IP address. + /// + + /// The dns settings to be applied on the publicIP addresses . + /// + + /// The list of IP tags associated with the public IP address. + /// + + /// The PublicIPPrefix from which to allocate publicIP addresses. + /// + + /// Available from Api-Version 2019-07-01 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + /// Possible values are: 'IPv4' and 'IPv6'. + /// Possible values include: 'IPv4', 'IPv6' + + /// Specify what happens to the public IP when the VM is deleted + /// Possible values include: 'Delete', 'Detach' + public VirtualMachineScaleSetPublicIPAddressConfigurationProperties(int? idleTimeoutInMinutes = default(int?), VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings), System.Collections.Generic.IList ipTags = default(System.Collections.Generic.IList), SubResource publicIPPrefix = default(SubResource), string publicIPAddressVersion = default(string), string deleteOption = default(string)) + + { + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; + this.DnsSettings = dnsSettings; + this.IpTags = ipTags; + this.PublicIPPrefix = publicIPPrefix; + this.PublicIPAddressVersion = publicIPAddressVersion; + this.DeleteOption = deleteOption; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the idle timeout of the public IP address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } + + /// + /// Gets or sets the dns settings to be applied on the publicIP addresses . + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsSettings")] + public VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings DnsSettings {get; set; } + + /// + /// Gets or sets the list of IP tags associated with the public IP address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipTags")] + public System.Collections.Generic.IList IpTags {get; set; } + + /// + /// Gets or sets the PublicIPPrefix from which to allocate publicIP addresses. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPPrefix")] + public SubResource PublicIPPrefix {get; set; } + + /// + /// Gets or sets available from Api-Version 2019-07-01 onwards, it represents + /// whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as + /// IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddressVersion")] + public string PublicIPAddressVersion {get; set; } + + /// + /// Gets or sets specify what happens to the public IP when the VM is deleted Possible values include: 'Delete', 'Detach' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "deleteOption")] + public string DeleteOption {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.DnsSettings != null) + { + this.DnsSettings.Validate(); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetReimageParameters.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetReimageParameters.cs index 80dc822441ab..01ac17349eee 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetReimageParameters.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetReimageParameters.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetReimageParameters : VirtualMachineScaleSetVMReimageParameters { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetReimageParameters class. + /// Initializes a new instance of the VirtualMachineScaleSetReimageParameters class. /// public VirtualMachineScaleSetReimageParameters() { @@ -30,28 +21,35 @@ public VirtualMachineScaleSetReimageParameters() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetReimageParameters class. + /// Initializes a new instance of the VirtualMachineScaleSetReimageParameters class. /// - /// Specifies whether to reimage temp disk. - /// Default value: false. Note: This temp disk reimage parameter is - /// only supported for VM/VMSS with Ephemeral OS disk. - /// Specifies in decimal number, the version - /// the OS disk should be reimaged to. If exact version is not - /// provided, the OS disk is reimaged to the existing version of OS - /// Disk. - /// Specifies information required for - /// reimaging the non-ephemeral OS disk. - /// Parameter to force - /// update ephemeral OS disk for a virtual machine scale set VM - /// The virtual machine scale set instance - /// ids. Omitting the virtual machine scale set instance ids will - /// result in the operation being performed on all virtual machines in - /// the virtual machine scale set. - public VirtualMachineScaleSetReimageParameters(bool? tempDisk = default(bool?), string exactVersion = default(string), OSProfileProvisioningData osProfile = default(OSProfileProvisioningData), bool? forceUpdateOSDiskForEphemeral = default(bool?), IList instanceIds = default(IList)) - : base(tempDisk, exactVersion, osProfile, forceUpdateOSDiskForEphemeral) + + /// Specifies whether to reimage temp disk. Default value: false. Note: This + /// temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS + /// disk. + /// + + /// Specifies in decimal number, the version the OS disk should be reimaged to. + /// If exact version is not provided, the OS disk is reimaged to the existing + /// version of OS Disk. + /// + + /// Specifies information required for reimaging the non-ephemeral OS disk. + /// + + /// Parameter to force update ephemeral OS disk for a virtual machine scale set + /// VM + /// + + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. + /// + public VirtualMachineScaleSetReimageParameters(bool? tempDisk = default(bool?), string exactVersion = default(string), OSProfileProvisioningData osProfile = default(OSProfileProvisioningData), bool? forceUpdateOSDiskForEphemeral = default(bool?), System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList)) + + : base(tempDisk, exactVersion, osProfile, forceUpdateOSDiskForEphemeral) { - InstanceIds = instanceIds; + this.InstanceIds = instanceIds; CustomInit(); } @@ -60,14 +58,13 @@ public VirtualMachineScaleSetReimageParameters() /// partial void CustomInit(); + /// - /// Gets or sets the virtual machine scale set instance ids. Omitting - /// the virtual machine scale set instance ids will result in the - /// operation being performed on all virtual machines in the virtual - /// machine scale set. + /// Gets or sets the virtual machine scale set instance ids. Omitting the + /// virtual machine scale set instance ids will result in the operation being + /// performed on all virtual machines in the virtual machine scale set. /// - [JsonProperty(PropertyName = "instanceIds")] - public IList InstanceIds { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "instanceIds")] + public System.Collections.Generic.IList InstanceIds {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetScaleInRules.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetScaleInRules.cs index bbe4bf22bc33..5c15df459554 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetScaleInRules.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetScaleInRules.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for VirtualMachineScaleSetScaleInRules. /// + + public static class VirtualMachineScaleSetScaleInRules { public const string Default = "Default"; public const string OldestVM = "OldestVM"; public const string NewestVM = "NewestVM"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetSku.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetSku.cs index 8aa58b7d8474..779beaf59bda 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetSku.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetSku.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,16 +23,21 @@ public VirtualMachineScaleSetSku() /// /// Initializes a new instance of the VirtualMachineScaleSetSku class. /// - /// The type of resource the sku applies - /// to. - /// The Sku. - /// Specifies the number of virtual machines in - /// the scale set. + + /// The type of resource the sku applies to. + /// + + /// The Sku. + /// + + /// Specifies the number of virtual machines in the scale set. + /// public VirtualMachineScaleSetSku(string resourceType = default(string), Sku sku = default(Sku), VirtualMachineScaleSetSkuCapacity capacity = default(VirtualMachineScaleSetSkuCapacity)) + { - ResourceType = resourceType; - Sku = sku; - Capacity = capacity; + this.ResourceType = resourceType; + this.Sku = sku; + this.Capacity = capacity; CustomInit(); } @@ -47,23 +46,23 @@ public VirtualMachineScaleSetSku() /// partial void CustomInit(); + /// /// Gets the type of resource the sku applies to. /// - [JsonProperty(PropertyName = "resourceType")] - public string ResourceType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceType")] + public string ResourceType {get; private set; } /// /// Gets the Sku. /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public Sku Sku {get; private set; } /// /// Gets specifies the number of virtual machines in the scale set. /// - [JsonProperty(PropertyName = "capacity")] - public VirtualMachineScaleSetSkuCapacity Capacity { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "capacity")] + public VirtualMachineScaleSetSkuCapacity Capacity {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetSkuCapacity.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetSkuCapacity.cs index 769672d81222..8f0c1c4a05e0 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetSkuCapacity.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetSkuCapacity.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetSkuCapacity { /// - /// Initializes a new instance of the VirtualMachineScaleSetSkuCapacity - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetSkuCapacity class. /// public VirtualMachineScaleSetSkuCapacity() { @@ -28,20 +21,27 @@ public VirtualMachineScaleSetSkuCapacity() } /// - /// Initializes a new instance of the VirtualMachineScaleSetSkuCapacity - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetSkuCapacity class. /// - /// The minimum capacity. - /// The maximum capacity that can be set. - /// The default capacity. + + /// The minimum capacity. + /// + + /// The maximum capacity that can be set. + /// + + /// The default capacity. + /// + /// The scale type applicable to the sku. - /// Possible values include: 'Automatic', 'None' + /// Possible values include: 'Automatic', 'None' public VirtualMachineScaleSetSkuCapacity(long? minimum = default(long?), long? maximum = default(long?), long? defaultCapacity = default(long?), VirtualMachineScaleSetSkuScaleType? scaleType = default(VirtualMachineScaleSetSkuScaleType?)) + { - Minimum = minimum; - Maximum = maximum; - DefaultCapacity = defaultCapacity; - ScaleType = scaleType; + this.Minimum = minimum; + this.Maximum = maximum; + this.DefaultCapacity = defaultCapacity; + this.ScaleType = scaleType; CustomInit(); } @@ -50,30 +50,29 @@ public VirtualMachineScaleSetSkuCapacity() /// partial void CustomInit(); + /// /// Gets the minimum capacity. /// - [JsonProperty(PropertyName = "minimum")] - public long? Minimum { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "minimum")] + public long? Minimum {get; private set; } /// /// Gets the maximum capacity that can be set. /// - [JsonProperty(PropertyName = "maximum")] - public long? Maximum { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maximum")] + public long? Maximum {get; private set; } /// /// Gets the default capacity. /// - [JsonProperty(PropertyName = "defaultCapacity")] - public long? DefaultCapacity { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultCapacity")] + public long? DefaultCapacity {get; private set; } /// - /// Gets the scale type applicable to the sku. Possible values include: - /// 'Automatic', 'None' + /// Gets the scale type applicable to the sku. Possible values include: 'Automatic', 'None' /// - [JsonProperty(PropertyName = "scaleType")] - public VirtualMachineScaleSetSkuScaleType? ScaleType { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "scaleType")] + public VirtualMachineScaleSetSkuScaleType? ScaleType {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetSkuScaleType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetSkuScaleType.cs index 37eb1dcb7da7..2d7c478ddd9b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetSkuScaleType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetSkuScaleType.cs @@ -1,29 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for VirtualMachineScaleSetSkuScaleType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum VirtualMachineScaleSetSkuScaleType { - [EnumMember(Value = "Automatic")] + [System.Runtime.Serialization.EnumMember(Value = "Automatic")] Automatic, - [EnumMember(Value = "None")] + [System.Runtime.Serialization.EnumMember(Value = "None")] None } internal static class VirtualMachineScaleSetSkuScaleTypeEnumExtension @@ -32,7 +25,6 @@ internal static string ToSerializedValue(this VirtualMachineScaleSetSkuScaleType { return value == null ? null : ((VirtualMachineScaleSetSkuScaleType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this VirtualMachineScaleSetSkuScaleType value) { switch( value ) @@ -44,7 +36,6 @@ internal static string ToSerializedValue(this VirtualMachineScaleSetSkuScaleType } return null; } - internal static VirtualMachineScaleSetSkuScaleType? ParseVirtualMachineScaleSetSkuScaleType(this string value) { switch( value ) @@ -57,4 +48,4 @@ internal static string ToSerializedValue(this VirtualMachineScaleSetSkuScaleType return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetStorageProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetStorageProfile.cs index 5bfd97599f7c..24802b73b10b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetStorageProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetStorageProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetStorageProfile { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetStorageProfile class. + /// Initializes a new instance of the VirtualMachineScaleSetStorageProfile class. /// public VirtualMachineScaleSetStorageProfile() { @@ -30,35 +21,38 @@ public VirtualMachineScaleSetStorageProfile() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetStorageProfile class. + /// Initializes a new instance of the VirtualMachineScaleSetStorageProfile class. /// - /// Specifies information about the image - /// to use. You can specify information about platform images, - /// marketplace images, or virtual machine images. This element is - /// required when you want to use a platform image, marketplace image, - /// or virtual machine image, but is not used in other creation - /// operations. - /// Specifies information about the operating - /// system disk used by the virtual machines in the scale set. For more - /// information about disks, see [About disks and VHDs for Azure - /// virtual - /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). - /// Specifies the parameters that are used to - /// add data disks to the virtual machines in the scale set. For more - /// information about disks, see [About disks and VHDs for Azure - /// virtual - /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). - /// Specifies the disk controller type - /// configured for the virtual machines in the scale set. Minimum - /// api-version: 2022-08-01. Possible values include: 'SCSI', - /// 'NVMe' - public VirtualMachineScaleSetStorageProfile(ImageReference imageReference = default(ImageReference), VirtualMachineScaleSetOSDisk osDisk = default(VirtualMachineScaleSetOSDisk), IList dataDisks = default(IList), string diskControllerType = default(string)) + + /// Specifies information about the image to use. You can specify information + /// about platform images, marketplace images, or virtual machine images. This + /// element is required when you want to use a platform image, marketplace + /// image, or virtual machine image, but is not used in other creation + /// operations. + /// + + /// Specifies information about the operating system disk used by the virtual + /// machines in the scale set. For more information about disks, see [About + /// disks and VHDs for Azure virtual + /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + /// + + /// Specifies the parameters that are used to add data disks to the virtual + /// machines in the scale set. For more information about disks, see [About + /// disks and VHDs for Azure virtual + /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + /// + + /// Specifies the disk controller type configured for the virtual machines in + /// the scale set. Minimum api-version: 2022-08-01 + /// Possible values include: 'SCSI', 'NVMe' + public VirtualMachineScaleSetStorageProfile(ImageReference imageReference = default(ImageReference), VirtualMachineScaleSetOSDisk osDisk = default(VirtualMachineScaleSetOSDisk), System.Collections.Generic.IList dataDisks = default(System.Collections.Generic.IList), string diskControllerType = default(string)) + { - ImageReference = imageReference; - OsDisk = osDisk; - DataDisks = dataDisks; - DiskControllerType = diskControllerType; + this.ImageReference = imageReference; + this.OsDisk = osDisk; + this.DataDisks = dataDisks; + this.DiskControllerType = diskControllerType; CustomInit(); } @@ -67,58 +61,57 @@ public VirtualMachineScaleSetStorageProfile() /// partial void CustomInit(); + /// - /// Gets or sets specifies information about the image to use. You can - /// specify information about platform images, marketplace images, or - /// virtual machine images. This element is required when you want to - /// use a platform image, marketplace image, or virtual machine image, - /// but is not used in other creation operations. + /// Gets or sets specifies information about the image to use. You can specify + /// information about platform images, marketplace images, or virtual machine + /// images. This element is required when you want to use a platform image, + /// marketplace image, or virtual machine image, but is not used in other + /// creation operations. /// - [JsonProperty(PropertyName = "imageReference")] - public ImageReference ImageReference { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "imageReference")] + public ImageReference ImageReference {get; set; } /// - /// Gets or sets specifies information about the operating system disk - /// used by the virtual machines in the scale set. For more information - /// about disks, see [About disks and VHDs for Azure virtual + /// Gets or sets specifies information about the operating system disk used by + /// the virtual machines in the scale set. For more information about disks, + /// see [About disks and VHDs for Azure virtual /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). /// - [JsonProperty(PropertyName = "osDisk")] - public VirtualMachineScaleSetOSDisk OsDisk { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osDisk")] + public VirtualMachineScaleSetOSDisk OsDisk {get; set; } /// - /// Gets or sets specifies the parameters that are used to add data - /// disks to the virtual machines in the scale set. For more - /// information about disks, see [About disks and VHDs for Azure - /// virtual + /// Gets or sets specifies the parameters that are used to add data disks to + /// the virtual machines in the scale set. For more information about disks, + /// see [About disks and VHDs for Azure virtual /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). /// - [JsonProperty(PropertyName = "dataDisks")] - public IList DataDisks { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDisks")] + public System.Collections.Generic.IList DataDisks {get; set; } /// - /// Gets or sets specifies the disk controller type configured for the - /// virtual machines in the scale set. Minimum api-version: 2022-08-01. - /// Possible values include: 'SCSI', 'NVMe' + /// Gets or sets specifies the disk controller type configured for the virtual + /// machines in the scale set. Minimum api-version: 2022-08-01 Possible values include: 'SCSI', 'NVMe' /// - [JsonProperty(PropertyName = "diskControllerType")] - public string DiskControllerType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "diskControllerType")] + public string DiskControllerType {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (OsDisk != null) + + if (this.OsDisk != null) { - OsDisk.Validate(); + this.OsDisk.Validate(); } - if (DataDisks != null) + if (this.DataDisks != null) { - foreach (var element in DataDisks) + foreach (var element in this.DataDisks) { if (element != null) { @@ -126,6 +119,7 @@ public virtual void Validate() } } } + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdate.cs index 4b835a0b2773..e2ae35d0ae5b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdate.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Describes a Virtual Machine Scale Set. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachineScaleSetUpdate : UpdateResource { /// - /// Initializes a new instance of the VirtualMachineScaleSetUpdate - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetUpdate class. /// public VirtualMachineScaleSetUpdate() { @@ -33,78 +22,101 @@ public VirtualMachineScaleSetUpdate() } /// - /// Initializes a new instance of the VirtualMachineScaleSetUpdate - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetUpdate class. /// - /// Resource tags - /// The virtual machine scale set sku. - /// The purchase plan when deploying a virtual - /// machine scale set from VM Marketplace images. - /// The upgrade policy. - /// Policy for automatic - /// repairs. - /// The virtual machine - /// profile. - /// Specifies whether the Virtual Machine - /// Scale Set should be overprovisioned. - /// When - /// Overprovision is enabled, extensions are launched only on the - /// requested number of VMs which are finally kept. This property will - /// hence ensure that the extensions do not run on the extra - /// overprovisioned VMs. - /// When true this limits the scale - /// set to a single placement group, of max size 100 virtual machines. - /// NOTE: If singlePlacementGroup is true, it may be modified to false. - /// However, if singlePlacementGroup is false, it may not be modified - /// to true. - /// Specifies additional - /// capabilities enabled or disabled on the Virtual Machines in the - /// Virtual Machine Scale Set. For instance: whether the Virtual - /// Machines have the capability to support attaching managed data - /// disks with UltraSSD_LRS storage account type. - /// Specifies the policies applied when - /// scaling in Virtual Machines in the Virtual Machine Scale - /// Set. - /// Specifies information about - /// the proximity placement group that the virtual machine scale set - /// should be assigned to. <br><br>Minimum api-version: - /// 2018-04-01. - /// Specifies the desired targets for - /// mixing Spot and Regular priority VMs within the same VMSS Flex - /// instance. - /// Specifies the Spot Restore - /// properties for the virtual machine scale set. - /// Policy for Resiliency - /// Specifies the align - /// mode between Virtual Machine Scale Set compute and storage Fault - /// Domain count. Possible values include: 'Aligned', - /// 'Unaligned' - /// Specifies the sku profile for the virtual - /// machine scale set. - /// The identity of the virtual machine scale - /// set, if configured. - /// The virtual machine scale set zones. - public VirtualMachineScaleSetUpdate(IDictionary tags = default(IDictionary), Sku sku = default(Sku), Plan plan = default(Plan), UpgradePolicy upgradePolicy = default(UpgradePolicy), AutomaticRepairsPolicy automaticRepairsPolicy = default(AutomaticRepairsPolicy), VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile = default(VirtualMachineScaleSetUpdateVMProfile), bool? overprovision = default(bool?), bool? doNotRunExtensionsOnOverprovisionedVMs = default(bool?), bool? singlePlacementGroup = default(bool?), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), ScaleInPolicy scaleInPolicy = default(ScaleInPolicy), SubResource proximityPlacementGroup = default(SubResource), PriorityMixPolicy priorityMixPolicy = default(PriorityMixPolicy), SpotRestorePolicy spotRestorePolicy = default(SpotRestorePolicy), ResiliencyPolicy resiliencyPolicy = default(ResiliencyPolicy), string zonalPlatformFaultDomainAlignMode = default(string), SkuProfile skuProfile = default(SkuProfile), VirtualMachineScaleSetIdentity identity = default(VirtualMachineScaleSetIdentity), IList zones = default(IList)) - : base(tags) + + /// Resource tags + /// + + /// The virtual machine scale set sku. + /// + + /// The purchase plan when deploying a virtual machine scale set from VM + /// Marketplace images. + /// + + /// The identity of the virtual machine scale set, if configured. + /// + + /// The virtual machine scale set zones. + /// + + /// The upgrade policy. + /// + + /// Specifies additional capabilities enabled or disabled on the Virtual + /// Machines in the Virtual Machine Scale Set. For instance: whether the + /// Virtual Machines have the capability to support attaching managed data + /// disks with UltraSSD_LRS storage account type. + /// + + /// Policy for Resiliency + /// + + /// Specifies the sku profile for the virtual machine scale set. + /// + + /// Policy for automatic repairs. + /// + + /// The virtual machine profile. + /// + + /// Specifies whether the Virtual Machine Scale Set should be overprovisioned. + /// + + /// When Overprovision is enabled, extensions are launched only on the + /// requested number of VMs which are finally kept. This property will hence + /// ensure that the extensions do not run on the extra overprovisioned VMs. + /// + + /// When true this limits the scale set to a single placement group, of max + /// size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be + /// modified to false. However, if singlePlacementGroup is false, it may not be + /// modified to true. + /// + + /// Specifies the policies applied when scaling in Virtual Machines in the + /// Virtual Machine Scale Set. + /// + + /// Specifies information about the proximity placement group that the virtual + /// machine scale set should be assigned to. <br><br>Minimum api-version: + /// 2018-04-01. + /// + + /// Specifies the desired targets for mixing Spot and Regular priority VMs + /// within the same VMSS Flex instance. + /// + + /// Specifies the Spot Restore properties for the virtual machine scale set. + /// + + /// Specifies the align mode between Virtual Machine Scale Set compute and + /// storage Fault Domain count. + /// Possible values include: 'Aligned', 'Unaligned' + public VirtualMachineScaleSetUpdate(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), Sku sku = default(Sku), Plan plan = default(Plan), VirtualMachineScaleSetIdentity identity = default(VirtualMachineScaleSetIdentity), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), UpgradePolicy upgradePolicy = default(UpgradePolicy), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), ResiliencyPolicy resiliencyPolicy = default(ResiliencyPolicy), SkuProfile skuProfile = default(SkuProfile), AutomaticRepairsPolicy automaticRepairsPolicy = default(AutomaticRepairsPolicy), VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile = default(VirtualMachineScaleSetUpdateVMProfile), bool? overprovision = default(bool?), bool? doNotRunExtensionsOnOverprovisionedVms = default(bool?), bool? singlePlacementGroup = default(bool?), ScaleInPolicy scaleInPolicy = default(ScaleInPolicy), SubResource proximityPlacementGroup = default(SubResource), PriorityMixPolicy priorityMixPolicy = default(PriorityMixPolicy), SpotRestorePolicy spotRestorePolicy = default(SpotRestorePolicy), string zonalPlatformFaultDomainAlignMode = default(string)) + + : base(tags) { - Sku = sku; - Plan = plan; - UpgradePolicy = upgradePolicy; - AutomaticRepairsPolicy = automaticRepairsPolicy; - VirtualMachineProfile = virtualMachineProfile; - Overprovision = overprovision; - DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; - SinglePlacementGroup = singlePlacementGroup; - AdditionalCapabilities = additionalCapabilities; - ScaleInPolicy = scaleInPolicy; - ProximityPlacementGroup = proximityPlacementGroup; - PriorityMixPolicy = priorityMixPolicy; - SpotRestorePolicy = spotRestorePolicy; - ResiliencyPolicy = resiliencyPolicy; - ZonalPlatformFaultDomainAlignMode = zonalPlatformFaultDomainAlignMode; - SkuProfile = skuProfile; - Identity = identity; - Zones = zones; + this.Sku = sku; + this.Plan = plan; + this.Identity = identity; + this.Zones = zones; + this.UpgradePolicy = upgradePolicy; + this.AdditionalCapabilities = additionalCapabilities; + this.ResiliencyPolicy = resiliencyPolicy; + this.SkuProfile = skuProfile; + this.AutomaticRepairsPolicy = automaticRepairsPolicy; + this.VirtualMachineProfile = virtualMachineProfile; + this.Overprovision = overprovision; + this.DoNotRunExtensionsOnOverprovisionedVms = doNotRunExtensionsOnOverprovisionedVms; + this.SinglePlacementGroup = singlePlacementGroup; + this.ScaleInPolicy = scaleInPolicy; + this.ProximityPlacementGroup = proximityPlacementGroup; + this.PriorityMixPolicy = priorityMixPolicy; + this.SpotRestorePolicy = spotRestorePolicy; + this.ZonalPlatformFaultDomainAlignMode = zonalPlatformFaultDomainAlignMode; CustomInit(); } @@ -113,156 +125,163 @@ public VirtualMachineScaleSetUpdate() /// partial void CustomInit(); + /// /// Gets or sets the virtual machine scale set sku. /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public Sku Sku {get; set; } /// - /// Gets or sets the purchase plan when deploying a virtual machine - /// scale set from VM Marketplace images. + /// Gets or sets the purchase plan when deploying a virtual machine scale set + /// from VM Marketplace images. /// - [JsonProperty(PropertyName = "plan")] - public Plan Plan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "plan")] + public Plan Plan {get; set; } /// - /// Gets or sets the upgrade policy. + /// Gets or sets the identity of the virtual machine scale set, if configured. /// - [JsonProperty(PropertyName = "properties.upgradePolicy")] - public UpgradePolicy UpgradePolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public VirtualMachineScaleSetIdentity Identity {get; set; } /// - /// Gets or sets policy for automatic repairs. + /// Gets or sets the virtual machine scale set zones. /// - [JsonProperty(PropertyName = "properties.automaticRepairsPolicy")] - public AutomaticRepairsPolicy AutomaticRepairsPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } /// - /// Gets or sets the virtual machine profile. + /// Gets or sets the upgrade policy. /// - [JsonProperty(PropertyName = "properties.virtualMachineProfile")] - public VirtualMachineScaleSetUpdateVMProfile VirtualMachineProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.upgradePolicy")] + public UpgradePolicy UpgradePolicy {get; set; } /// - /// Gets or sets specifies whether the Virtual Machine Scale Set should - /// be overprovisioned. + /// Gets or sets specifies additional capabilities enabled or disabled on the + /// Virtual Machines in the Virtual Machine Scale Set. For instance: whether + /// the Virtual Machines have the capability to support attaching managed data + /// disks with UltraSSD_LRS storage account type. /// - [JsonProperty(PropertyName = "properties.overprovision")] - public bool? Overprovision { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.additionalCapabilities")] + public AdditionalCapabilities AdditionalCapabilities {get; set; } /// - /// Gets or sets when Overprovision is enabled, extensions are launched - /// only on the requested number of VMs which are finally kept. This - /// property will hence ensure that the extensions do not run on the - /// extra overprovisioned VMs. + /// Gets or sets policy for Resiliency /// - [JsonProperty(PropertyName = "properties.doNotRunExtensionsOnOverprovisionedVMs")] - public bool? DoNotRunExtensionsOnOverprovisionedVMs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resiliencyPolicy")] + public ResiliencyPolicy ResiliencyPolicy {get; set; } /// - /// Gets or sets when true this limits the scale set to a single - /// placement group, of max size 100 virtual machines. NOTE: If - /// singlePlacementGroup is true, it may be modified to false. However, - /// if singlePlacementGroup is false, it may not be modified to true. + /// Gets or sets specifies the sku profile for the virtual machine scale set. /// - [JsonProperty(PropertyName = "properties.singlePlacementGroup")] - public bool? SinglePlacementGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.skuProfile")] + public SkuProfile SkuProfile {get; set; } /// - /// Gets or sets specifies additional capabilities enabled or disabled - /// on the Virtual Machines in the Virtual Machine Scale Set. For - /// instance: whether the Virtual Machines have the capability to - /// support attaching managed data disks with UltraSSD_LRS storage - /// account type. + /// Gets or sets policy for automatic repairs. /// - [JsonProperty(PropertyName = "properties.additionalCapabilities")] - public AdditionalCapabilities AdditionalCapabilities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.automaticRepairsPolicy")] + public AutomaticRepairsPolicy AutomaticRepairsPolicy {get; set; } /// - /// Gets or sets specifies the policies applied when scaling in Virtual - /// Machines in the Virtual Machine Scale Set. + /// Gets or sets the virtual machine profile. /// - [JsonProperty(PropertyName = "properties.scaleInPolicy")] - public ScaleInPolicy ScaleInPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachineProfile")] + public VirtualMachineScaleSetUpdateVMProfile VirtualMachineProfile {get; set; } /// - /// Gets or sets specifies information about the proximity placement - /// group that the virtual machine scale set should be assigned to. - /// &lt;br&gt;&lt;br&gt;Minimum api-version: - /// 2018-04-01. + /// Gets or sets specifies whether the Virtual Machine Scale Set should be + /// overprovisioned. /// - [JsonProperty(PropertyName = "properties.proximityPlacementGroup")] - public SubResource ProximityPlacementGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.overprovision")] + public bool? Overprovision {get; set; } /// - /// Gets or sets specifies the desired targets for mixing Spot and - /// Regular priority VMs within the same VMSS Flex instance. + /// Gets or sets when Overprovision is enabled, extensions are launched only on + /// the requested number of VMs which are finally kept. This property will + /// hence ensure that the extensions do not run on the extra overprovisioned + /// VMs. /// - [JsonProperty(PropertyName = "properties.priorityMixPolicy")] - public PriorityMixPolicy PriorityMixPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.doNotRunExtensionsOnOverprovisionedVMs")] + public bool? DoNotRunExtensionsOnOverprovisionedVms {get; set; } /// - /// Gets or sets specifies the Spot Restore properties for the virtual - /// machine scale set. + /// Gets or sets when true this limits the scale set to a single placement + /// group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is + /// true, it may be modified to false. However, if singlePlacementGroup is + /// false, it may not be modified to true. /// - [JsonProperty(PropertyName = "properties.spotRestorePolicy")] - public SpotRestorePolicy SpotRestorePolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.singlePlacementGroup")] + public bool? SinglePlacementGroup {get; set; } /// - /// Gets or sets policy for Resiliency + /// Gets or sets specifies the policies applied when scaling in Virtual + /// Machines in the Virtual Machine Scale Set. /// - [JsonProperty(PropertyName = "properties.resiliencyPolicy")] - public ResiliencyPolicy ResiliencyPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scaleInPolicy")] + public ScaleInPolicy ScaleInPolicy {get; set; } /// - /// Gets or sets specifies the align mode between Virtual Machine Scale - /// Set compute and storage Fault Domain count. Possible values - /// include: 'Aligned', 'Unaligned' + /// Gets or sets specifies information about the proximity placement group that + /// the virtual machine scale set should be assigned to. <br><br>Minimum + /// api-version: 2018-04-01. /// - [JsonProperty(PropertyName = "properties.zonalPlatformFaultDomainAlignMode")] - public string ZonalPlatformFaultDomainAlignMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.proximityPlacementGroup")] + public SubResource ProximityPlacementGroup {get; set; } /// - /// Gets or sets specifies the sku profile for the virtual machine - /// scale set. + /// Gets or sets specifies the desired targets for mixing Spot and Regular + /// priority VMs within the same VMSS Flex instance. /// - [JsonProperty(PropertyName = "properties.skuProfile")] - public SkuProfile SkuProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priorityMixPolicy")] + public PriorityMixPolicy PriorityMixPolicy {get; set; } /// - /// Gets or sets the identity of the virtual machine scale set, if - /// configured. + /// Gets or sets specifies the Spot Restore properties for the virtual machine + /// scale set. /// - [JsonProperty(PropertyName = "identity")] - public VirtualMachineScaleSetIdentity Identity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.spotRestorePolicy")] + public SpotRestorePolicy SpotRestorePolicy {get; set; } /// - /// Gets or sets the virtual machine scale set zones. + /// Gets or sets specifies the align mode between Virtual Machine Scale Set + /// compute and storage Fault Domain count. Possible values include: 'Aligned', 'Unaligned' /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.zonalPlatformFaultDomainAlignMode")] + public string ZonalPlatformFaultDomainAlignMode {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (UpgradePolicy != null) + + + + + if (this.UpgradePolicy != null) { - UpgradePolicy.Validate(); + this.UpgradePolicy.Validate(); } - if (PriorityMixPolicy != null) + + if (this.ResiliencyPolicy != null) { - PriorityMixPolicy.Validate(); + this.ResiliencyPolicy.Validate(); } - if (ResiliencyPolicy != null) + + + + + + if (this.PriorityMixPolicy != null) { - ResiliencyPolicy.Validate(); + this.PriorityMixPolicy.Validate(); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateIPConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateIPConfiguration.cs index 121e6bb1b8a5..d259a3b9ee96 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateIPConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateIPConfiguration.cs @@ -1,34 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Describes a virtual machine scale set network profile's IP - /// configuration. NOTE: The subnet of a scale set may be modified as long - /// as the original subnet and the new subnet are in the same virtual - /// network + /// Describes a virtual machine scale set network profile's IP configuration. + /// NOTE: The subnet of a scale set may be modified as long as the original + /// subnet and the new subnet are in the same virtual network /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachineScaleSetUpdateIPConfiguration { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetUpdateIPConfiguration class. + /// Initializes a new instance of the VirtualMachineScaleSetUpdateIPConfiguration class. /// public VirtualMachineScaleSetUpdateIPConfiguration() { @@ -36,40 +24,50 @@ public VirtualMachineScaleSetUpdateIPConfiguration() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetUpdateIPConfiguration class. + /// Initializes a new instance of the VirtualMachineScaleSetUpdateIPConfiguration class. /// - /// The IP configuration name. - /// The subnet. - /// Specifies the primary IP Configuration in - /// case the network interface has more than one IP - /// Configuration. - /// The - /// publicIPAddressConfiguration. - /// Available from Api-Version - /// 2017-03-30 onwards, it represents whether the specific - /// ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - /// Possible values are: 'IPv4' and 'IPv6'. Possible values include: - /// 'IPv4', 'IPv6' - /// The application - /// gateway backend address pools. - /// Specifies an array of - /// references to application security group. - /// The load balancer - /// backend address pools. - /// The load balancer inbound - /// nat pools. - public VirtualMachineScaleSetUpdateIPConfiguration(string name = default(string), ApiEntityReference subnet = default(ApiEntityReference), bool? primary = default(bool?), VirtualMachineScaleSetUpdatePublicIPAddressConfiguration publicIPAddressConfiguration = default(VirtualMachineScaleSetUpdatePublicIPAddressConfiguration), string privateIPAddressVersion = default(string), IList applicationGatewayBackendAddressPools = default(IList), IList applicationSecurityGroups = default(IList), IList loadBalancerBackendAddressPools = default(IList), IList loadBalancerInboundNatPools = default(IList)) + + /// The IP configuration name. + /// + + /// The subnet. + /// + + /// Specifies the primary IP Configuration in case the network interface has + /// more than one IP Configuration. + /// + + /// The publicIPAddressConfiguration. + /// + + /// Available from Api-Version 2017-03-30 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + /// Possible values are: 'IPv4' and 'IPv6'. + /// Possible values include: 'IPv4', 'IPv6' + + /// The application gateway backend address pools. + /// + + /// Specifies an array of references to application security group. + /// + + /// The load balancer backend address pools. + /// + + /// The load balancer inbound nat pools. + /// + public VirtualMachineScaleSetUpdateIPConfiguration(string name = default(string), ApiEntityReference subnet = default(ApiEntityReference), bool? primary = default(bool?), VirtualMachineScaleSetUpdatePublicIPAddressConfiguration publicIPAddressConfiguration = default(VirtualMachineScaleSetUpdatePublicIPAddressConfiguration), string privateIPAddressVersion = default(string), System.Collections.Generic.IList applicationGatewayBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationSecurityGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerInboundNatPools = default(System.Collections.Generic.IList)) + { - Name = name; - Subnet = subnet; - Primary = primary; - PublicIPAddressConfiguration = publicIPAddressConfiguration; - PrivateIPAddressVersion = privateIPAddressVersion; - ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; - ApplicationSecurityGroups = applicationSecurityGroups; - LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; - LoadBalancerInboundNatPools = loadBalancerInboundNatPools; + this.Name = name; + this.Subnet = subnet; + this.Primary = primary; + this.PublicIPAddressConfiguration = publicIPAddressConfiguration; + this.PrivateIPAddressVersion = privateIPAddressVersion; + this.ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + this.ApplicationSecurityGroups = applicationSecurityGroups; + this.LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + this.LoadBalancerInboundNatPools = loadBalancerInboundNatPools; CustomInit(); } @@ -78,77 +76,83 @@ public VirtualMachineScaleSetUpdateIPConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the IP configuration name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the subnet. /// - [JsonProperty(PropertyName = "properties.subnet")] - public ApiEntityReference Subnet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnet")] + public ApiEntityReference Subnet {get; set; } /// - /// Gets or sets specifies the primary IP Configuration in case the - /// network interface has more than one IP Configuration. + /// Gets or sets specifies the primary IP Configuration in case the network + /// interface has more than one IP Configuration. /// - [JsonProperty(PropertyName = "properties.primary")] - public bool? Primary { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primary")] + public bool? Primary {get; set; } /// /// Gets or sets the publicIPAddressConfiguration. /// - [JsonProperty(PropertyName = "properties.publicIPAddressConfiguration")] - public VirtualMachineScaleSetUpdatePublicIPAddressConfiguration PublicIPAddressConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPAddressConfiguration")] + public VirtualMachineScaleSetUpdatePublicIPAddressConfiguration PublicIPAddressConfiguration {get; set; } /// - /// Gets or sets available from Api-Version 2017-03-30 onwards, it - /// represents whether the specific ipconfiguration is IPv4 or IPv6. - /// Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - /// Possible values include: 'IPv4', 'IPv6' + /// Gets or sets available from Api-Version 2017-03-30 onwards, it represents + /// whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as + /// IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' /// - [JsonProperty(PropertyName = "properties.privateIPAddressVersion")] - public string PrivateIPAddressVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateIPAddressVersion")] + public string PrivateIPAddressVersion {get; set; } /// /// Gets or sets the application gateway backend address pools. /// - [JsonProperty(PropertyName = "properties.applicationGatewayBackendAddressPools")] - public IList ApplicationGatewayBackendAddressPools { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicationGatewayBackendAddressPools")] + public System.Collections.Generic.IList ApplicationGatewayBackendAddressPools {get; set; } /// - /// Gets or sets specifies an array of references to application - /// security group. + /// Gets or sets specifies an array of references to application security + /// group. /// - [JsonProperty(PropertyName = "properties.applicationSecurityGroups")] - public IList ApplicationSecurityGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicationSecurityGroups")] + public System.Collections.Generic.IList ApplicationSecurityGroups {get; set; } /// /// Gets or sets the load balancer backend address pools. /// - [JsonProperty(PropertyName = "properties.loadBalancerBackendAddressPools")] - public IList LoadBalancerBackendAddressPools { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancerBackendAddressPools")] + public System.Collections.Generic.IList LoadBalancerBackendAddressPools {get; set; } /// /// Gets or sets the load balancer inbound nat pools. /// - [JsonProperty(PropertyName = "properties.loadBalancerInboundNatPools")] - public IList LoadBalancerInboundNatPools { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.loadBalancerInboundNatPools")] + public System.Collections.Generic.IList LoadBalancerInboundNatPools {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (PublicIPAddressConfiguration != null) + + + if (this.PublicIPAddressConfiguration != null) { - PublicIPAddressConfiguration.Validate(); + this.PublicIPAddressConfiguration.Validate(); } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateIPConfigurationProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateIPConfigurationProperties.cs new file mode 100644 index 000000000000..994c155a26ab --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateIPConfigurationProperties.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes a virtual machine scale set network profile's IP configuration + /// properties. + /// + public partial class VirtualMachineScaleSetUpdateIPConfigurationProperties + { + /// + /// Initializes a new instance of the VirtualMachineScaleSetUpdateIPConfigurationProperties class. + /// + public VirtualMachineScaleSetUpdateIPConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineScaleSetUpdateIPConfigurationProperties class. + /// + + /// The subnet. + /// + + /// Specifies the primary IP Configuration in case the network interface has + /// more than one IP Configuration. + /// + + /// The publicIPAddressConfiguration. + /// + + /// Available from Api-Version 2017-03-30 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + /// Possible values are: 'IPv4' and 'IPv6'. + /// Possible values include: 'IPv4', 'IPv6' + + /// The application gateway backend address pools. + /// + + /// Specifies an array of references to application security group. + /// + + /// The load balancer backend address pools. + /// + + /// The load balancer inbound nat pools. + /// + public VirtualMachineScaleSetUpdateIPConfigurationProperties(ApiEntityReference subnet = default(ApiEntityReference), bool? primary = default(bool?), VirtualMachineScaleSetUpdatePublicIPAddressConfiguration publicIPAddressConfiguration = default(VirtualMachineScaleSetUpdatePublicIPAddressConfiguration), string privateIPAddressVersion = default(string), System.Collections.Generic.IList applicationGatewayBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList applicationSecurityGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerBackendAddressPools = default(System.Collections.Generic.IList), System.Collections.Generic.IList loadBalancerInboundNatPools = default(System.Collections.Generic.IList)) + + { + this.Subnet = subnet; + this.Primary = primary; + this.PublicIPAddressConfiguration = publicIPAddressConfiguration; + this.PrivateIPAddressVersion = privateIPAddressVersion; + this.ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + this.ApplicationSecurityGroups = applicationSecurityGroups; + this.LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + this.LoadBalancerInboundNatPools = loadBalancerInboundNatPools; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the subnet. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnet")] + public ApiEntityReference Subnet {get; set; } + + /// + /// Gets or sets specifies the primary IP Configuration in case the network + /// interface has more than one IP Configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primary")] + public bool? Primary {get; set; } + + /// + /// Gets or sets the publicIPAddressConfiguration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPAddressConfiguration")] + public VirtualMachineScaleSetUpdatePublicIPAddressConfiguration PublicIPAddressConfiguration {get; set; } + + /// + /// Gets or sets available from Api-Version 2017-03-30 onwards, it represents + /// whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as + /// IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateIPAddressVersion")] + public string PrivateIPAddressVersion {get; set; } + + /// + /// Gets or sets the application gateway backend address pools. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applicationGatewayBackendAddressPools")] + public System.Collections.Generic.IList ApplicationGatewayBackendAddressPools {get; set; } + + /// + /// Gets or sets specifies an array of references to application security + /// group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "applicationSecurityGroups")] + public System.Collections.Generic.IList ApplicationSecurityGroups {get; set; } + + /// + /// Gets or sets the load balancer backend address pools. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadBalancerBackendAddressPools")] + public System.Collections.Generic.IList LoadBalancerBackendAddressPools {get; set; } + + /// + /// Gets or sets the load balancer inbound nat pools. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "loadBalancerInboundNatPools")] + public System.Collections.Generic.IList LoadBalancerInboundNatPools {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + if (this.PublicIPAddressConfiguration != null) + { + this.PublicIPAddressConfiguration.Validate(); + } + + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateNetworkConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateNetworkConfiguration.cs index 8eebde807973..b67ae92f058d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateNetworkConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateNetworkConfiguration.cs @@ -1,32 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Describes a virtual machine scale set network profile's network + /// Describes a virtual machine scale set network profile's network /// configurations. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachineScaleSetUpdateNetworkConfiguration { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetUpdateNetworkConfiguration class. + /// Initializes a new instance of the VirtualMachineScaleSetUpdateNetworkConfiguration class. /// public VirtualMachineScaleSetUpdateNetworkConfiguration() { @@ -34,52 +23,66 @@ public VirtualMachineScaleSetUpdateNetworkConfiguration() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetUpdateNetworkConfiguration class. - /// - /// The network configuration name. - /// Whether this is a primary NIC on a virtual - /// machine. - /// Specifies whether the - /// network interface is accelerated networking-enabled. - /// Specifies whether the network - /// interface is disabled for tcp state tracking. - /// Specifies whether the network interface is - /// FPGA networking-enabled. - /// The network security - /// group. - /// The dns settings to be applied on the - /// network interfaces. - /// The virtual machine scale set IP - /// Configuration. - /// Whether IP forwarding enabled on - /// this NIC. - /// Specify what happens to the network - /// interface when the VM is deleted. Possible values include: - /// 'Delete', 'Detach' - /// Specifies whether the Auxiliary mode is - /// enabled for the Network Interface resource. Possible values - /// include: 'None', 'AcceleratedConnections', 'Floating' - /// Specifies whether the Auxiliary sku is - /// enabled for the Network Interface resource. Possible values - /// include: 'None', 'A1', 'A2', 'A4', 'A8' - /// Resource tags applied to the networkInterface - /// address created by this NetworkInterfaceConfiguration - public VirtualMachineScaleSetUpdateNetworkConfiguration(string name = default(string), bool? primary = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? disableTcpStateTracking = default(bool?), bool? enableFpga = default(bool?), SubResource networkSecurityGroup = default(SubResource), VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetNetworkConfigurationDnsSettings), IList ipConfigurations = default(IList), bool? enableIPForwarding = default(bool?), string deleteOption = default(string), string auxiliaryMode = default(string), string auxiliarySku = default(string), IDictionary tags = default(IDictionary)) + /// Initializes a new instance of the VirtualMachineScaleSetUpdateNetworkConfiguration class. + /// + + /// The network configuration name. + /// + + /// Resource tags applied to the networkInterface address created by this + /// NetworkInterfaceConfiguration + /// + + /// Whether this is a primary NIC on a virtual machine. + /// + + /// Specifies whether the network interface is accelerated networking-enabled. + /// + + /// Specifies whether the network interface is disabled for tcp state tracking. + /// + + /// Specifies whether the network interface is FPGA networking-enabled. + /// + + /// The network security group. + /// + + /// The dns settings to be applied on the network interfaces. + /// + + /// The virtual machine scale set IP Configuration. + /// + + /// Whether IP forwarding enabled on this NIC. + /// + + /// Specify what happens to the network interface when the VM is deleted + /// Possible values include: 'Delete', 'Detach' + + /// Specifies whether the Auxiliary mode is enabled for the Network Interface + /// resource. + /// Possible values include: 'None', 'AcceleratedConnections', 'Floating' + + /// Specifies whether the Auxiliary sku is enabled for the Network Interface + /// resource. + /// Possible values include: 'None', 'A1', 'A2', 'A4', 'A8' + public VirtualMachineScaleSetUpdateNetworkConfiguration(string name = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), bool? primary = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? disableTcpStateTracking = default(bool?), bool? enableFpga = default(bool?), SubResource networkSecurityGroup = default(SubResource), VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetNetworkConfigurationDnsSettings), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), bool? enableIPForwarding = default(bool?), string deleteOption = default(string), string auxiliaryMode = default(string), string auxiliarySku = default(string)) + { - Name = name; - Primary = primary; - EnableAcceleratedNetworking = enableAcceleratedNetworking; - DisableTcpStateTracking = disableTcpStateTracking; - EnableFpga = enableFpga; - NetworkSecurityGroup = networkSecurityGroup; - DnsSettings = dnsSettings; - IpConfigurations = ipConfigurations; - EnableIPForwarding = enableIPForwarding; - DeleteOption = deleteOption; - AuxiliaryMode = auxiliaryMode; - AuxiliarySku = auxiliarySku; - Tags = tags; + this.Name = name; + this.Tags = tags; + this.Primary = primary; + this.EnableAcceleratedNetworking = enableAcceleratedNetworking; + this.DisableTcpStateTracking = disableTcpStateTracking; + this.EnableFpga = enableFpga; + this.NetworkSecurityGroup = networkSecurityGroup; + this.DnsSettings = dnsSettings; + this.IpConfigurations = ipConfigurations; + this.EnableIPForwarding = enableIPForwarding; + this.DeleteOption = deleteOption; + this.AuxiliaryMode = auxiliaryMode; + this.AuxiliarySku = auxiliarySku; CustomInit(); } @@ -88,93 +91,90 @@ public VirtualMachineScaleSetUpdateNetworkConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the network configuration name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets resource tags applied to the networkInterface address created + /// by this NetworkInterfaceConfiguration + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// /// Gets or sets whether this is a primary NIC on a virtual machine. /// - [JsonProperty(PropertyName = "properties.primary")] - public bool? Primary { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.primary")] + public bool? Primary {get; set; } /// /// Gets or sets specifies whether the network interface is accelerated /// networking-enabled. /// - [JsonProperty(PropertyName = "properties.enableAcceleratedNetworking")] - public bool? EnableAcceleratedNetworking { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableAcceleratedNetworking")] + public bool? EnableAcceleratedNetworking {get; set; } /// - /// Gets or sets specifies whether the network interface is disabled - /// for tcp state tracking. + /// Gets or sets specifies whether the network interface is disabled for tcp + /// state tracking. /// - [JsonProperty(PropertyName = "properties.disableTcpStateTracking")] - public bool? DisableTcpStateTracking { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disableTcpStateTracking")] + public bool? DisableTcpStateTracking {get; set; } /// /// Gets or sets specifies whether the network interface is FPGA /// networking-enabled. /// - [JsonProperty(PropertyName = "properties.enableFpga")] - public bool? EnableFpga { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableFpga")] + public bool? EnableFpga {get; set; } /// /// Gets or sets the network security group. /// - [JsonProperty(PropertyName = "properties.networkSecurityGroup")] - public SubResource NetworkSecurityGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkSecurityGroup")] + public SubResource NetworkSecurityGroup {get; set; } /// - /// Gets or sets the dns settings to be applied on the network - /// interfaces. + /// Gets or sets the dns settings to be applied on the network interfaces. /// - [JsonProperty(PropertyName = "properties.dnsSettings")] - public VirtualMachineScaleSetNetworkConfigurationDnsSettings DnsSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dnsSettings")] + public VirtualMachineScaleSetNetworkConfigurationDnsSettings DnsSettings {get; set; } /// /// Gets or sets the virtual machine scale set IP Configuration. /// - [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipConfigurations")] + public System.Collections.Generic.IList IpConfigurations {get; set; } /// /// Gets or sets whether IP forwarding enabled on this NIC. /// - [JsonProperty(PropertyName = "properties.enableIPForwarding")] - public bool? EnableIPForwarding { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableIPForwarding")] + public bool? EnableIPForwarding {get; set; } /// - /// Gets or sets specify what happens to the network interface when the - /// VM is deleted. Possible values include: 'Delete', 'Detach' + /// Gets or sets specify what happens to the network interface when the VM is + /// deleted Possible values include: 'Delete', 'Detach' /// - [JsonProperty(PropertyName = "properties.deleteOption")] - public string DeleteOption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deleteOption")] + public string DeleteOption {get; set; } /// - /// Gets or sets specifies whether the Auxiliary mode is enabled for - /// the Network Interface resource. Possible values include: 'None', - /// 'AcceleratedConnections', 'Floating' + /// Gets or sets specifies whether the Auxiliary mode is enabled for the + /// Network Interface resource. Possible values include: 'None', 'AcceleratedConnections', 'Floating' /// - [JsonProperty(PropertyName = "properties.auxiliaryMode")] - public string AuxiliaryMode { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.auxiliaryMode")] + public string AuxiliaryMode {get; set; } /// - /// Gets or sets specifies whether the Auxiliary sku is enabled for the - /// Network Interface resource. Possible values include: 'None', 'A1', - /// 'A2', 'A4', 'A8' + /// Gets or sets specifies whether the Auxiliary sku is enabled for the Network + /// Interface resource. Possible values include: 'None', 'A1', 'A2', 'A4', 'A8' /// - [JsonProperty(PropertyName = "properties.auxiliarySku")] - public string AuxiliarySku { get; set; } - - /// - /// Gets or sets resource tags applied to the networkInterface address - /// created by this NetworkInterfaceConfiguration - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.auxiliarySku")] + public string AuxiliarySku {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateNetworkConfigurationProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateNetworkConfigurationProperties.cs new file mode 100644 index 000000000000..fb7a685221a7 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateNetworkConfigurationProperties.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes a virtual machine scale set updatable network profile's IP + /// configuration.Use this object for updating network profile's IP + /// Configuration. + /// + public partial class VirtualMachineScaleSetUpdateNetworkConfigurationProperties + { + /// + /// Initializes a new instance of the VirtualMachineScaleSetUpdateNetworkConfigurationProperties class. + /// + public VirtualMachineScaleSetUpdateNetworkConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineScaleSetUpdateNetworkConfigurationProperties class. + /// + + /// Whether this is a primary NIC on a virtual machine. + /// + + /// Specifies whether the network interface is accelerated networking-enabled. + /// + + /// Specifies whether the network interface is disabled for tcp state tracking. + /// + + /// Specifies whether the network interface is FPGA networking-enabled. + /// + + /// The network security group. + /// + + /// The dns settings to be applied on the network interfaces. + /// + + /// The virtual machine scale set IP Configuration. + /// + + /// Whether IP forwarding enabled on this NIC. + /// + + /// Specify what happens to the network interface when the VM is deleted + /// Possible values include: 'Delete', 'Detach' + + /// Specifies whether the Auxiliary mode is enabled for the Network Interface + /// resource. + /// Possible values include: 'None', 'AcceleratedConnections', 'Floating' + + /// Specifies whether the Auxiliary sku is enabled for the Network Interface + /// resource. + /// Possible values include: 'None', 'A1', 'A2', 'A4', 'A8' + public VirtualMachineScaleSetUpdateNetworkConfigurationProperties(bool? primary = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? disableTcpStateTracking = default(bool?), bool? enableFpga = default(bool?), SubResource networkSecurityGroup = default(SubResource), VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetNetworkConfigurationDnsSettings), System.Collections.Generic.IList ipConfigurations = default(System.Collections.Generic.IList), bool? enableIPForwarding = default(bool?), string deleteOption = default(string), string auxiliaryMode = default(string), string auxiliarySku = default(string)) + + { + this.Primary = primary; + this.EnableAcceleratedNetworking = enableAcceleratedNetworking; + this.DisableTcpStateTracking = disableTcpStateTracking; + this.EnableFpga = enableFpga; + this.NetworkSecurityGroup = networkSecurityGroup; + this.DnsSettings = dnsSettings; + this.IpConfigurations = ipConfigurations; + this.EnableIPForwarding = enableIPForwarding; + this.DeleteOption = deleteOption; + this.AuxiliaryMode = auxiliaryMode; + this.AuxiliarySku = auxiliarySku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets whether this is a primary NIC on a virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primary")] + public bool? Primary {get; set; } + + /// + /// Gets or sets specifies whether the network interface is accelerated + /// networking-enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableAcceleratedNetworking")] + public bool? EnableAcceleratedNetworking {get; set; } + + /// + /// Gets or sets specifies whether the network interface is disabled for tcp + /// state tracking. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disableTcpStateTracking")] + public bool? DisableTcpStateTracking {get; set; } + + /// + /// Gets or sets specifies whether the network interface is FPGA + /// networking-enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableFpga")] + public bool? EnableFpga {get; set; } + + /// + /// Gets or sets the network security group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkSecurityGroup")] + public SubResource NetworkSecurityGroup {get; set; } + + /// + /// Gets or sets the dns settings to be applied on the network interfaces. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsSettings")] + public VirtualMachineScaleSetNetworkConfigurationDnsSettings DnsSettings {get; set; } + + /// + /// Gets or sets the virtual machine scale set IP Configuration. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ipConfigurations")] + public System.Collections.Generic.IList IpConfigurations {get; set; } + + /// + /// Gets or sets whether IP forwarding enabled on this NIC. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableIPForwarding")] + public bool? EnableIPForwarding {get; set; } + + /// + /// Gets or sets specify what happens to the network interface when the VM is + /// deleted Possible values include: 'Delete', 'Detach' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "deleteOption")] + public string DeleteOption {get; set; } + + /// + /// Gets or sets specifies whether the Auxiliary mode is enabled for the + /// Network Interface resource. Possible values include: 'None', 'AcceleratedConnections', 'Floating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "auxiliaryMode")] + public string AuxiliaryMode {get; set; } + + /// + /// Gets or sets specifies whether the Auxiliary sku is enabled for the Network + /// Interface resource. Possible values include: 'None', 'A1', 'A2', 'A4', 'A8' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "auxiliarySku")] + public string AuxiliarySku {get; set; } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateNetworkProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateNetworkProfile.cs index da19ccd2b575..519f0a67f3be 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateNetworkProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateNetworkProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetUpdateNetworkProfile { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetUpdateNetworkProfile class. + /// Initializes a new instance of the VirtualMachineScaleSetUpdateNetworkProfile class. /// public VirtualMachineScaleSetUpdateNetworkProfile() { @@ -30,25 +21,28 @@ public VirtualMachineScaleSetUpdateNetworkProfile() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetUpdateNetworkProfile class. + /// Initializes a new instance of the VirtualMachineScaleSetUpdateNetworkProfile class. /// - /// A reference to a load balancer probe used - /// to determine the health of an instance in the virtual machine scale - /// set. The reference will be in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - /// The list of network - /// configurations. - /// specifies the Microsoft.Network API - /// version used when creating networking resources in the Network - /// Interface Configurations for Virtual Machine Scale Set with - /// orchestration mode 'Flexible'. Possible values include: - /// '2020-11-01', '2022-11-01' - public VirtualMachineScaleSetUpdateNetworkProfile(ApiEntityReference healthProbe = default(ApiEntityReference), IList networkInterfaceConfigurations = default(IList), string networkApiVersion = default(string)) + + /// A reference to a load balancer probe used to determine the health of an + /// instance in the virtual machine scale set. The reference will be in the + /// form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + /// + + /// The list of network configurations. + /// + + /// specifies the Microsoft.Network API version used when creating networking + /// resources in the Network Interface Configurations for Virtual Machine Scale + /// Set with orchestration mode 'Flexible' + /// Possible values include: '2020-11-01', '2022-11-01' + public VirtualMachineScaleSetUpdateNetworkProfile(ApiEntityReference healthProbe = default(ApiEntityReference), System.Collections.Generic.IList networkInterfaceConfigurations = default(System.Collections.Generic.IList), string networkApiVersion = default(string)) + { - HealthProbe = healthProbe; - NetworkInterfaceConfigurations = networkInterfaceConfigurations; - NetworkApiVersion = networkApiVersion; + this.HealthProbe = healthProbe; + this.NetworkInterfaceConfigurations = networkInterfaceConfigurations; + this.NetworkApiVersion = networkApiVersion; CustomInit(); } @@ -57,30 +51,28 @@ public VirtualMachineScaleSetUpdateNetworkProfile() /// partial void CustomInit(); + /// - /// Gets or sets a reference to a load balancer probe used to determine - /// the health of an instance in the virtual machine scale set. The - /// reference will be in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + /// Gets or sets a reference to a load balancer probe used to determine the + /// health of an instance in the virtual machine scale set. The reference will + /// be in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. /// - [JsonProperty(PropertyName = "healthProbe")] - public ApiEntityReference HealthProbe { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "healthProbe")] + public ApiEntityReference HealthProbe {get; set; } /// /// Gets or sets the list of network configurations. /// - [JsonProperty(PropertyName = "networkInterfaceConfigurations")] - public IList NetworkInterfaceConfigurations { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterfaceConfigurations")] + public System.Collections.Generic.IList NetworkInterfaceConfigurations {get; set; } /// - /// Gets or sets specifies the Microsoft.Network API version used when - /// creating networking resources in the Network Interface - /// Configurations for Virtual Machine Scale Set with orchestration - /// mode 'Flexible'. Possible values include: '2020-11-01', - /// '2022-11-01' + /// Gets or sets specifies the Microsoft.Network API version used when creating + /// networking resources in the Network Interface Configurations for Virtual + /// Machine Scale Set with orchestration mode 'Flexible' Possible values include: '2020-11-01', '2022-11-01' /// - [JsonProperty(PropertyName = "networkApiVersion")] - public string NetworkApiVersion { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "networkApiVersion")] + public string NetworkApiVersion {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateOSDisk.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateOSDisk.cs index b68faffac5d1..938cae683a0f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateOSDisk.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateOSDisk.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Describes virtual machine scale set operating system disk Update - /// Object. This should be used for Updating VMSS OS Disk. + /// Describes virtual machine scale set operating system disk Update Object. + /// This should be used for Updating VMSS OS Disk. /// public partial class VirtualMachineScaleSetUpdateOSDisk { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetUpdateOSDisk class. + /// Initializes a new instance of the VirtualMachineScaleSetUpdateOSDisk class. /// public VirtualMachineScaleSetUpdateOSDisk() { @@ -31,49 +22,57 @@ public VirtualMachineScaleSetUpdateOSDisk() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetUpdateOSDisk class. + /// Initializes a new instance of the VirtualMachineScaleSetUpdateOSDisk class. /// - /// The caching type. Possible values include: - /// 'None', 'ReadOnly', 'ReadWrite' - /// Specifies whether - /// writeAccelerator should be enabled or disabled on the disk. - /// Specifies the ephemeral disk - /// Settings for the operating system disk used by the virtual machine - /// scale set. - /// Specifies the size of an empty data disk - /// in gigabytes. This element can be used to overwrite the size of the - /// disk in a virtual machine image. <br><br> diskSizeGB is - /// the number of bytes x 1024^3 for the disk and the value cannot be - /// larger than 1023 - /// The Source User Image VirtualHardDisk. This - /// VirtualHardDisk will be copied before using it to attach to the - /// Virtual Machine. If SourceImage is provided, the destination - /// VirtualHardDisk should not exist. - /// The list of virtual hard disk container - /// uris. - /// The managed disk parameters. - /// Specifies whether OS Disk should be - /// deleted or detached upon VMSS Flex deletion (This feature is - /// available for VMSS with Flexible OrchestrationMode only). - /// <br><br> Possible values: <br><br> - /// **Delete** If this value is used, the OS disk is deleted when VMSS - /// Flex VM is deleted.<br><br> **Detach** If this value is - /// used, the OS disk is retained after VMSS Flex VM is deleted. - /// <br><br> The default value is set to **Delete**. For an - /// Ephemeral OS Disk, the default value is set to **Delete**. User - /// cannot change the delete option for Ephemeral OS Disk. Possible - /// values include: 'Delete', 'Detach' - public VirtualMachineScaleSetUpdateOSDisk(CachingTypes? caching = default(CachingTypes?), bool? writeAcceleratorEnabled = default(bool?), DiffDiskSettings diffDiskSettings = default(DiffDiskSettings), int? diskSizeGB = default(int?), VirtualHardDisk image = default(VirtualHardDisk), IList vhdContainers = default(IList), VirtualMachineScaleSetManagedDiskParameters managedDisk = default(VirtualMachineScaleSetManagedDiskParameters), string deleteOption = default(string)) + + /// The caching type. + /// Possible values include: 'None', 'ReadOnly', 'ReadWrite' + + /// Specifies whether writeAccelerator should be enabled or disabled on the + /// disk. + /// + + /// Specifies the ephemeral disk Settings for the operating system disk used by + /// the virtual machine scale set. + /// + + /// Specifies the size of an empty data disk in gigabytes. This element can be + /// used to overwrite the size of the disk in a virtual machine image. <br><br> + /// diskSizeGB is the number of bytes x 1024^3 for the disk and the value + /// cannot be larger than 1023 + /// + + /// The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied + /// before using it to attach to the Virtual Machine. If SourceImage is + /// provided, the destination VirtualHardDisk should not exist. + /// + + /// The list of virtual hard disk container uris. + /// + + /// The managed disk parameters. + /// + + /// Specifies whether OS Disk should be deleted or detached upon VMSS Flex + /// deletion (This feature is available for VMSS with Flexible + /// OrchestrationMode only). <br><br> Possible values: <br><br> **Delete** If + /// this value is used, the OS disk is deleted when VMSS Flex VM is + /// deleted.<br><br> **Detach** If this value is used, the OS disk is retained + /// after VMSS Flex VM is deleted. <br><br> The default value is set to + /// **Delete**. For an Ephemeral OS Disk, the default value is set to + /// **Delete**. User cannot change the delete option for Ephemeral OS Disk. + /// Possible values include: 'Delete', 'Detach' + public VirtualMachineScaleSetUpdateOSDisk(CachingTypes? caching = default(CachingTypes?), bool? writeAcceleratorEnabled = default(bool?), DiffDiskSettings diffDiskSettings = default(DiffDiskSettings), int? diskSizeGb = default(int?), VirtualHardDisk image = default(VirtualHardDisk), System.Collections.Generic.IList vhdContainers = default(System.Collections.Generic.IList), VirtualMachineScaleSetManagedDiskParameters managedDisk = default(VirtualMachineScaleSetManagedDiskParameters), string deleteOption = default(string)) + { - Caching = caching; - WriteAcceleratorEnabled = writeAcceleratorEnabled; - DiffDiskSettings = diffDiskSettings; - DiskSizeGB = diskSizeGB; - Image = image; - VhdContainers = vhdContainers; - ManagedDisk = managedDisk; - DeleteOption = deleteOption; + this.Caching = caching; + this.WriteAcceleratorEnabled = writeAcceleratorEnabled; + this.DiffDiskSettings = diffDiskSettings; + this.DiskSizeGB = diskSizeGb; + this.Image = image; + this.VhdContainers = vhdContainers; + this.ManagedDisk = managedDisk; + this.DeleteOption = deleteOption; CustomInit(); } @@ -82,74 +81,67 @@ public VirtualMachineScaleSetUpdateOSDisk() /// partial void CustomInit(); + /// - /// Gets or sets the caching type. Possible values include: 'None', - /// 'ReadOnly', 'ReadWrite' + /// Gets or sets the caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' /// - [JsonProperty(PropertyName = "caching")] - public CachingTypes? Caching { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "caching")] + public CachingTypes? Caching {get; set; } /// - /// Gets or sets specifies whether writeAccelerator should be enabled - /// or disabled on the disk. + /// Gets or sets specifies whether writeAccelerator should be enabled or + /// disabled on the disk. /// - [JsonProperty(PropertyName = "writeAcceleratorEnabled")] - public bool? WriteAcceleratorEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "writeAcceleratorEnabled")] + public bool? WriteAcceleratorEnabled {get; set; } /// - /// Gets or sets specifies the ephemeral disk Settings for the - /// operating system disk used by the virtual machine scale set. + /// Gets or sets specifies the ephemeral disk Settings for the operating system + /// disk used by the virtual machine scale set. /// - [JsonProperty(PropertyName = "diffDiskSettings")] - public DiffDiskSettings DiffDiskSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diffDiskSettings")] + public DiffDiskSettings DiffDiskSettings {get; set; } /// - /// Gets or sets specifies the size of an empty data disk in gigabytes. - /// This element can be used to overwrite the size of the disk in a - /// virtual machine image. &lt;br&gt;&lt;br&gt; - /// diskSizeGB is the number of bytes x 1024^3 for the disk and the - /// value cannot be larger than 1023 + /// Gets or sets specifies the size of an empty data disk in gigabytes. This + /// element can be used to overwrite the size of the disk in a virtual machine + /// image. <br><br> diskSizeGB is the number of bytes x 1024^3 for the disk and + /// the value cannot be larger than 1023 /// - [JsonProperty(PropertyName = "diskSizeGB")] - public int? DiskSizeGB { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diskSizeGB")] + public int? DiskSizeGB {get; set; } /// - /// Gets or sets the Source User Image VirtualHardDisk. This - /// VirtualHardDisk will be copied before using it to attach to the - /// Virtual Machine. If SourceImage is provided, the destination - /// VirtualHardDisk should not exist. + /// Gets or sets the Source User Image VirtualHardDisk. This VirtualHardDisk + /// will be copied before using it to attach to the Virtual Machine. If + /// SourceImage is provided, the destination VirtualHardDisk should not exist. /// - [JsonProperty(PropertyName = "image")] - public VirtualHardDisk Image { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "image")] + public VirtualHardDisk Image {get; set; } /// /// Gets or sets the list of virtual hard disk container uris. /// - [JsonProperty(PropertyName = "vhdContainers")] - public IList VhdContainers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vhdContainers")] + public System.Collections.Generic.IList VhdContainers {get; set; } /// /// Gets or sets the managed disk parameters. /// - [JsonProperty(PropertyName = "managedDisk")] - public VirtualMachineScaleSetManagedDiskParameters ManagedDisk { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "managedDisk")] + public VirtualMachineScaleSetManagedDiskParameters ManagedDisk {get; set; } /// - /// Gets or sets specifies whether OS Disk should be deleted or - /// detached upon VMSS Flex deletion (This feature is available for - /// VMSS with Flexible OrchestrationMode only). - /// &lt;br&gt;&lt;br&gt; Possible values: - /// &lt;br&gt;&lt;br&gt; **Delete** If this value is - /// used, the OS disk is deleted when VMSS Flex VM is - /// deleted.&lt;br&gt;&lt;br&gt; **Detach** If this - /// value is used, the OS disk is retained after VMSS Flex VM is - /// deleted. &lt;br&gt;&lt;br&gt; The default value is - /// set to **Delete**. For an Ephemeral OS Disk, the default value is - /// set to **Delete**. User cannot change the delete option for - /// Ephemeral OS Disk. Possible values include: 'Delete', 'Detach' + /// Gets or sets specifies whether OS Disk should be deleted or detached upon + /// VMSS Flex deletion (This feature is available for VMSS with Flexible + /// OrchestrationMode only). <br><br> Possible values: <br><br> **Delete** If + /// this value is used, the OS disk is deleted when VMSS Flex VM is + /// deleted.<br><br> **Detach** If this value is used, the OS disk is retained + /// after VMSS Flex VM is deleted. <br><br> The default value is set to + /// **Delete**. For an Ephemeral OS Disk, the default value is set to + /// **Delete**. User cannot change the delete option for Ephemeral OS Disk. Possible values include: 'Delete', 'Detach' /// - [JsonProperty(PropertyName = "deleteOption")] - public string DeleteOption { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "deleteOption")] + public string DeleteOption {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateOSProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateOSProfile.cs index 48d6b2034fef..9c1c52c2d37d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateOSProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateOSProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetUpdateOSProfile { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetUpdateOSProfile class. + /// Initializes a new instance of the VirtualMachineScaleSetUpdateOSProfile class. /// public VirtualMachineScaleSetUpdateOSProfile() { @@ -30,23 +21,27 @@ public VirtualMachineScaleSetUpdateOSProfile() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetUpdateOSProfile class. + /// Initializes a new instance of the VirtualMachineScaleSetUpdateOSProfile class. /// - /// A base-64 encoded string of custom - /// data. - /// The Windows Configuration of the - /// OS profile. - /// The Linux Configuration of the OS - /// profile. - /// The List of certificates for addition to the - /// VM. - public VirtualMachineScaleSetUpdateOSProfile(string customData = default(string), WindowsConfiguration windowsConfiguration = default(WindowsConfiguration), LinuxConfiguration linuxConfiguration = default(LinuxConfiguration), IList secrets = default(IList)) + + /// A base-64 encoded string of custom data. + /// + + /// The Windows Configuration of the OS profile. + /// + + /// The Linux Configuration of the OS profile. + /// + + /// The List of certificates for addition to the VM. + /// + public VirtualMachineScaleSetUpdateOSProfile(string customData = default(string), WindowsConfiguration windowsConfiguration = default(WindowsConfiguration), LinuxConfiguration linuxConfiguration = default(LinuxConfiguration), System.Collections.Generic.IList secrets = default(System.Collections.Generic.IList)) + { - CustomData = customData; - WindowsConfiguration = windowsConfiguration; - LinuxConfiguration = linuxConfiguration; - Secrets = secrets; + this.CustomData = customData; + this.WindowsConfiguration = windowsConfiguration; + this.LinuxConfiguration = linuxConfiguration; + this.Secrets = secrets; CustomInit(); } @@ -55,29 +50,29 @@ public VirtualMachineScaleSetUpdateOSProfile() /// partial void CustomInit(); + /// /// Gets or sets a base-64 encoded string of custom data. /// - [JsonProperty(PropertyName = "customData")] - public string CustomData { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "customData")] + public string CustomData {get; set; } /// /// Gets or sets the Windows Configuration of the OS profile. /// - [JsonProperty(PropertyName = "windowsConfiguration")] - public WindowsConfiguration WindowsConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "windowsConfiguration")] + public WindowsConfiguration WindowsConfiguration {get; set; } /// /// Gets or sets the Linux Configuration of the OS profile. /// - [JsonProperty(PropertyName = "linuxConfiguration")] - public LinuxConfiguration LinuxConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "linuxConfiguration")] + public LinuxConfiguration LinuxConfiguration {get; set; } /// /// Gets or sets the List of certificates for addition to the VM. /// - [JsonProperty(PropertyName = "secrets")] - public IList Secrets { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "secrets")] + public System.Collections.Generic.IList Secrets {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateProperties.cs new file mode 100644 index 000000000000..ae78b7308282 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateProperties.cs @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a Virtual Machine Scale Set. + /// + public partial class VirtualMachineScaleSetUpdateProperties + { + /// + /// Initializes a new instance of the VirtualMachineScaleSetUpdateProperties class. + /// + public VirtualMachineScaleSetUpdateProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineScaleSetUpdateProperties class. + /// + + /// The upgrade policy. + /// + + /// Policy for automatic repairs. + /// + + /// The virtual machine profile. + /// + + /// Specifies whether the Virtual Machine Scale Set should be overprovisioned. + /// + + /// When Overprovision is enabled, extensions are launched only on the + /// requested number of VMs which are finally kept. This property will hence + /// ensure that the extensions do not run on the extra overprovisioned VMs. + /// + + /// When true this limits the scale set to a single placement group, of max + /// size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be + /// modified to false. However, if singlePlacementGroup is false, it may not be + /// modified to true. + /// + + /// Specifies additional capabilities enabled or disabled on the Virtual + /// Machines in the Virtual Machine Scale Set. For instance: whether the + /// Virtual Machines have the capability to support attaching managed data + /// disks with UltraSSD_LRS storage account type. + /// + + /// Specifies the policies applied when scaling in Virtual Machines in the + /// Virtual Machine Scale Set. + /// + + /// Specifies information about the proximity placement group that the virtual + /// machine scale set should be assigned to. <br><br>Minimum api-version: + /// 2018-04-01. + /// + + /// Specifies the desired targets for mixing Spot and Regular priority VMs + /// within the same VMSS Flex instance. + /// + + /// Specifies the Spot Restore properties for the virtual machine scale set. + /// + + /// Policy for Resiliency + /// + + /// Specifies the align mode between Virtual Machine Scale Set compute and + /// storage Fault Domain count. + /// Possible values include: 'Aligned', 'Unaligned' + + /// Specifies the sku profile for the virtual machine scale set. + /// + public VirtualMachineScaleSetUpdateProperties(UpgradePolicy upgradePolicy = default(UpgradePolicy), AutomaticRepairsPolicy automaticRepairsPolicy = default(AutomaticRepairsPolicy), VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile = default(VirtualMachineScaleSetUpdateVMProfile), bool? overprovision = default(bool?), bool? doNotRunExtensionsOnOverprovisionedVms = default(bool?), bool? singlePlacementGroup = default(bool?), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), ScaleInPolicy scaleInPolicy = default(ScaleInPolicy), SubResource proximityPlacementGroup = default(SubResource), PriorityMixPolicy priorityMixPolicy = default(PriorityMixPolicy), SpotRestorePolicy spotRestorePolicy = default(SpotRestorePolicy), ResiliencyPolicy resiliencyPolicy = default(ResiliencyPolicy), string zonalPlatformFaultDomainAlignMode = default(string), SkuProfile skuProfile = default(SkuProfile)) + + { + this.UpgradePolicy = upgradePolicy; + this.AutomaticRepairsPolicy = automaticRepairsPolicy; + this.VirtualMachineProfile = virtualMachineProfile; + this.Overprovision = overprovision; + this.DoNotRunExtensionsOnOverprovisionedVMS = doNotRunExtensionsOnOverprovisionedVms; + this.SinglePlacementGroup = singlePlacementGroup; + this.AdditionalCapabilities = additionalCapabilities; + this.ScaleInPolicy = scaleInPolicy; + this.ProximityPlacementGroup = proximityPlacementGroup; + this.PriorityMixPolicy = priorityMixPolicy; + this.SpotRestorePolicy = spotRestorePolicy; + this.ResiliencyPolicy = resiliencyPolicy; + this.ZonalPlatformFaultDomainAlignMode = zonalPlatformFaultDomainAlignMode; + this.SkuProfile = skuProfile; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the upgrade policy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "upgradePolicy")] + public UpgradePolicy UpgradePolicy {get; set; } + + /// + /// Gets or sets policy for automatic repairs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "automaticRepairsPolicy")] + public AutomaticRepairsPolicy AutomaticRepairsPolicy {get; set; } + + /// + /// Gets or sets the virtual machine profile. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "virtualMachineProfile")] + public VirtualMachineScaleSetUpdateVMProfile VirtualMachineProfile {get; set; } + + /// + /// Gets or sets specifies whether the Virtual Machine Scale Set should be + /// overprovisioned. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "overprovision")] + public bool? Overprovision {get; set; } + + /// + /// Gets or sets when Overprovision is enabled, extensions are launched only on + /// the requested number of VMs which are finally kept. This property will + /// hence ensure that the extensions do not run on the extra overprovisioned + /// VMs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "doNotRunExtensionsOnOverprovisionedVMs")] + public bool? DoNotRunExtensionsOnOverprovisionedVMS {get; set; } + + /// + /// Gets or sets when true this limits the scale set to a single placement + /// group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is + /// true, it may be modified to false. However, if singlePlacementGroup is + /// false, it may not be modified to true. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "singlePlacementGroup")] + public bool? SinglePlacementGroup {get; set; } + + /// + /// Gets or sets specifies additional capabilities enabled or disabled on the + /// Virtual Machines in the Virtual Machine Scale Set. For instance: whether + /// the Virtual Machines have the capability to support attaching managed data + /// disks with UltraSSD_LRS storage account type. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalCapabilities")] + public AdditionalCapabilities AdditionalCapabilities {get; set; } + + /// + /// Gets or sets specifies the policies applied when scaling in Virtual + /// Machines in the Virtual Machine Scale Set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scaleInPolicy")] + public ScaleInPolicy ScaleInPolicy {get; set; } + + /// + /// Gets or sets specifies information about the proximity placement group that + /// the virtual machine scale set should be assigned to. <br><br>Minimum + /// api-version: 2018-04-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "proximityPlacementGroup")] + public SubResource ProximityPlacementGroup {get; set; } + + /// + /// Gets or sets specifies the desired targets for mixing Spot and Regular + /// priority VMs within the same VMSS Flex instance. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "priorityMixPolicy")] + public PriorityMixPolicy PriorityMixPolicy {get; set; } + + /// + /// Gets or sets specifies the Spot Restore properties for the virtual machine + /// scale set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "spotRestorePolicy")] + public SpotRestorePolicy SpotRestorePolicy {get; set; } + + /// + /// Gets or sets policy for Resiliency + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resiliencyPolicy")] + public ResiliencyPolicy ResiliencyPolicy {get; set; } + + /// + /// Gets or sets specifies the align mode between Virtual Machine Scale Set + /// compute and storage Fault Domain count. Possible values include: 'Aligned', 'Unaligned' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "zonalPlatformFaultDomainAlignMode")] + public string ZonalPlatformFaultDomainAlignMode {get; set; } + + /// + /// Gets or sets specifies the sku profile for the virtual machine scale set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "skuProfile")] + public SkuProfile SkuProfile {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.UpgradePolicy != null) + { + this.UpgradePolicy.Validate(); + } + + + + + + if (this.PriorityMixPolicy != null) + { + this.PriorityMixPolicy.Validate(); + } + + if (this.ResiliencyPolicy != null) + { + this.ResiliencyPolicy.Validate(); + } + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdatePublicIPAddressConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdatePublicIPAddressConfiguration.cs index ee7ab7273eae..4c6851ea01d9 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdatePublicIPAddressConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdatePublicIPAddressConfiguration.cs @@ -1,32 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Describes a virtual machines scale set IP Configuration's - /// PublicIPAddress configuration + /// Describes a virtual machines scale set IP Configuration's PublicIPAddress + /// configuration /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachineScaleSetUpdatePublicIPAddressConfiguration { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration class. + /// Initializes a new instance of the VirtualMachineScaleSetUpdatePublicIPAddressConfiguration class. /// public VirtualMachineScaleSetUpdatePublicIPAddressConfiguration() { @@ -34,29 +23,36 @@ public VirtualMachineScaleSetUpdatePublicIPAddressConfiguration() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration class. + /// Initializes a new instance of the VirtualMachineScaleSetUpdatePublicIPAddressConfiguration class. /// - /// The publicIP address configuration name. - /// The idle timeout of the public - /// IP address. - /// The dns settings to be applied on the - /// publicIP addresses . - /// The PublicIPPrefix from which to - /// allocate publicIP addresses. - /// Specify what happens to the public IP - /// when the VM is deleted. Possible values include: 'Delete', - /// 'Detach' - /// Resource tags applied to the publicIP address - /// created by this PublicIPAddressConfiguration - public VirtualMachineScaleSetUpdatePublicIPAddressConfiguration(string name = default(string), int? idleTimeoutInMinutes = default(int?), VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings), SubResource publicIPPrefix = default(SubResource), string deleteOption = default(string), IDictionary tags = default(IDictionary)) + + /// The publicIP address configuration name. + /// + + /// Resource tags applied to the publicIP address created by this + /// PublicIPAddressConfiguration + /// + + /// The idle timeout of the public IP address. + /// + + /// The dns settings to be applied on the publicIP addresses . + /// + + /// The PublicIPPrefix from which to allocate publicIP addresses. + /// + + /// Specify what happens to the public IP when the VM is deleted + /// Possible values include: 'Delete', 'Detach' + public VirtualMachineScaleSetUpdatePublicIPAddressConfiguration(string name = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), int? idleTimeoutInMinutes = default(int?), VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings), SubResource publicIPPrefix = default(SubResource), string deleteOption = default(string)) + { - Name = name; - IdleTimeoutInMinutes = idleTimeoutInMinutes; - DnsSettings = dnsSettings; - PublicIPPrefix = publicIPPrefix; - DeleteOption = deleteOption; - Tags = tags; + this.Name = name; + this.Tags = tags; + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; + this.DnsSettings = dnsSettings; + this.PublicIPPrefix = publicIPPrefix; + this.DeleteOption = deleteOption; CustomInit(); } @@ -65,58 +61,59 @@ public VirtualMachineScaleSetUpdatePublicIPAddressConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the publicIP address configuration name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the idle timeout of the public IP address. + /// Gets or sets resource tags applied to the publicIP address created by this + /// PublicIPAddressConfiguration /// - [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] - public int? IdleTimeoutInMinutes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets or sets the dns settings to be applied on the publicIP - /// addresses . + /// Gets or sets the idle timeout of the public IP address. /// - [JsonProperty(PropertyName = "properties.dnsSettings")] - public VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings DnsSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } /// - /// Gets or sets the PublicIPPrefix from which to allocate publicIP - /// addresses. + /// Gets or sets the dns settings to be applied on the publicIP addresses . /// - [JsonProperty(PropertyName = "properties.publicIPPrefix")] - public SubResource PublicIPPrefix { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dnsSettings")] + public VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings DnsSettings {get; set; } /// - /// Gets or sets specify what happens to the public IP when the VM is - /// deleted. Possible values include: 'Delete', 'Detach' + /// Gets or sets the PublicIPPrefix from which to allocate publicIP addresses. /// - [JsonProperty(PropertyName = "properties.deleteOption")] - public string DeleteOption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicIPPrefix")] + public SubResource PublicIPPrefix {get; set; } /// - /// Gets or sets resource tags applied to the publicIP address created - /// by this PublicIPAddressConfiguration + /// Gets or sets specify what happens to the public IP when the VM is deleted Possible values include: 'Delete', 'Detach' /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deleteOption")] + public string DeleteOption {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (DnsSettings != null) + + + if (this.DnsSettings != null) { - DnsSettings.Validate(); + this.DnsSettings.Validate(); } + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties.cs new file mode 100644 index 000000000000..a1ecd31d19ee --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes a virtual machines scale set IP Configuration's PublicIPAddress + /// configuration + /// + public partial class VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties + { + /// + /// Initializes a new instance of the VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties class. + /// + public VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties class. + /// + + /// The idle timeout of the public IP address. + /// + + /// The dns settings to be applied on the publicIP addresses . + /// + + /// The PublicIPPrefix from which to allocate publicIP addresses. + /// + + /// Specify what happens to the public IP when the VM is deleted + /// Possible values include: 'Delete', 'Detach' + public VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties(int? idleTimeoutInMinutes = default(int?), VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings), SubResource publicIPPrefix = default(SubResource), string deleteOption = default(string)) + + { + this.IdleTimeoutInMinutes = idleTimeoutInMinutes; + this.DnsSettings = dnsSettings; + this.PublicIPPrefix = publicIPPrefix; + this.DeleteOption = deleteOption; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the idle timeout of the public IP address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes {get; set; } + + /// + /// Gets or sets the dns settings to be applied on the publicIP addresses . + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dnsSettings")] + public VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings DnsSettings {get; set; } + + /// + /// Gets or sets the PublicIPPrefix from which to allocate publicIP addresses. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicIPPrefix")] + public SubResource PublicIPPrefix {get; set; } + + /// + /// Gets or sets specify what happens to the public IP when the VM is deleted Possible values include: 'Delete', 'Detach' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "deleteOption")] + public string DeleteOption {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.DnsSettings != null) + { + this.DnsSettings.Validate(); + } + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateStorageProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateStorageProfile.cs index 5cfa9a4cb5bd..3ed2f408c3c8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateStorageProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateStorageProfile.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetUpdateStorageProfile { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetUpdateStorageProfile class. + /// Initializes a new instance of the VirtualMachineScaleSetUpdateStorageProfile class. /// public VirtualMachineScaleSetUpdateStorageProfile() { @@ -30,24 +21,30 @@ public VirtualMachineScaleSetUpdateStorageProfile() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetUpdateStorageProfile class. + /// Initializes a new instance of the VirtualMachineScaleSetUpdateStorageProfile class. /// - /// The image reference. - /// The OS disk. - /// The data disks. - /// Specifies the disk controller type - /// configured for the virtual machines in the scale set. **Note:** You - /// need to deallocate the virtual machines in the scale set before - /// updating its disk controller type based on the upgrade mode - /// configured for the scale set. Minimum api-version: 2022-08-01. - /// Possible values include: 'SCSI', 'NVMe' - public VirtualMachineScaleSetUpdateStorageProfile(ImageReference imageReference = default(ImageReference), VirtualMachineScaleSetUpdateOSDisk osDisk = default(VirtualMachineScaleSetUpdateOSDisk), IList dataDisks = default(IList), string diskControllerType = default(string)) + + /// The image reference. + /// + + /// The OS disk. + /// + + /// The data disks. + /// + + /// Specifies the disk controller type configured for the virtual machines in + /// the scale set. **Note:** You need to deallocate the virtual machines in the + /// scale set before updating its disk controller type based on the upgrade + /// mode configured for the scale set. Minimum api-version: 2022-08-01 + /// Possible values include: 'SCSI', 'NVMe' + public VirtualMachineScaleSetUpdateStorageProfile(ImageReference imageReference = default(ImageReference), VirtualMachineScaleSetUpdateOSDisk osDisk = default(VirtualMachineScaleSetUpdateOSDisk), System.Collections.Generic.IList dataDisks = default(System.Collections.Generic.IList), string diskControllerType = default(string)) + { - ImageReference = imageReference; - OsDisk = osDisk; - DataDisks = dataDisks; - DiskControllerType = diskControllerType; + this.ImageReference = imageReference; + this.OsDisk = osDisk; + this.DataDisks = dataDisks; + this.DiskControllerType = diskControllerType; CustomInit(); } @@ -56,34 +53,33 @@ public VirtualMachineScaleSetUpdateStorageProfile() /// partial void CustomInit(); + /// /// Gets or sets the image reference. /// - [JsonProperty(PropertyName = "imageReference")] - public ImageReference ImageReference { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "imageReference")] + public ImageReference ImageReference {get; set; } /// /// Gets or sets the OS disk. /// - [JsonProperty(PropertyName = "osDisk")] - public VirtualMachineScaleSetUpdateOSDisk OsDisk { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osDisk")] + public VirtualMachineScaleSetUpdateOSDisk OsDisk {get; set; } /// /// Gets or sets the data disks. /// - [JsonProperty(PropertyName = "dataDisks")] - public IList DataDisks { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDisks")] + public System.Collections.Generic.IList DataDisks {get; set; } /// - /// Gets or sets specifies the disk controller type configured for the - /// virtual machines in the scale set. **Note:** You need to deallocate - /// the virtual machines in the scale set before updating its disk - /// controller type based on the upgrade mode configured for the scale - /// set. Minimum api-version: 2022-08-01. Possible values include: - /// 'SCSI', 'NVMe' + /// Gets or sets specifies the disk controller type configured for the virtual + /// machines in the scale set. **Note:** You need to deallocate the virtual + /// machines in the scale set before updating its disk controller type based on + /// the upgrade mode configured for the scale set. Minimum api-version: + /// 2022-08-01 Possible values include: 'SCSI', 'NVMe' /// - [JsonProperty(PropertyName = "diskControllerType")] - public string DiskControllerType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "diskControllerType")] + public string DiskControllerType {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateVMProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateVMProfile.cs index cccba0513d39..bb3013e542ab 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateVMProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetUpdateVMProfile.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetUpdateVMProfile { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetUpdateVMProfile class. + /// Initializes a new instance of the VirtualMachineScaleSetUpdateVMProfile class. /// public VirtualMachineScaleSetUpdateVMProfile() { @@ -28,49 +21,62 @@ public VirtualMachineScaleSetUpdateVMProfile() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetUpdateVMProfile class. + /// Initializes a new instance of the VirtualMachineScaleSetUpdateVMProfile class. /// - /// The virtual machine scale set OS - /// profile. - /// The virtual machine scale set storage - /// profile. - /// The virtual machine scale set network - /// profile. - /// The virtual machine scale - /// set security posture reference. - /// The virtual machine scale set - /// Security profile - /// The virtual machine scale set - /// diagnostics profile. - /// The virtual machine scale set - /// extension profile. - /// The license type, which is for bring your - /// own license scenario. - /// Specifies the billing related details - /// of a Azure Spot VMSS. Minimum api-version: 2019-03-01. - /// Specifies Scheduled Event - /// related configurations. - /// UserData for the VM, which must be base-64 - /// encoded. Customer should not pass any secrets in here. - /// <br><br>Minimum api-version: 2021-03-01 - /// Specifies the hardware profile - /// related details of a scale set. Minimum api-version: - /// 2021-11-01. + + /// The virtual machine scale set OS profile. + /// + + /// The virtual machine scale set storage profile. + /// + + /// The virtual machine scale set network profile. + /// + + /// The virtual machine scale set security posture reference. + /// + + /// The virtual machine scale set Security profile + /// + + /// The virtual machine scale set diagnostics profile. + /// + + /// The virtual machine scale set extension profile. + /// + + /// The license type, which is for bring your own license scenario. + /// + + /// Specifies the billing related details of a Azure Spot VMSS. Minimum + /// api-version: 2019-03-01. + /// + + /// Specifies Scheduled Event related configurations. + /// + + /// UserData for the VM, which must be base-64 encoded. Customer should not + /// pass any secrets in here. <br><br>Minimum api-version: 2021-03-01 + /// + + /// Specifies the hardware profile related details of a scale set. Minimum + /// api-version: 2021-11-01. + /// public VirtualMachineScaleSetUpdateVMProfile(VirtualMachineScaleSetUpdateOSProfile osProfile = default(VirtualMachineScaleSetUpdateOSProfile), VirtualMachineScaleSetUpdateStorageProfile storageProfile = default(VirtualMachineScaleSetUpdateStorageProfile), VirtualMachineScaleSetUpdateNetworkProfile networkProfile = default(VirtualMachineScaleSetUpdateNetworkProfile), SecurityPostureReferenceUpdate securityPostureReference = default(SecurityPostureReferenceUpdate), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), VirtualMachineScaleSetExtensionProfile extensionProfile = default(VirtualMachineScaleSetExtensionProfile), string licenseType = default(string), BillingProfile billingProfile = default(BillingProfile), ScheduledEventsProfile scheduledEventsProfile = default(ScheduledEventsProfile), string userData = default(string), VirtualMachineScaleSetHardwareProfile hardwareProfile = default(VirtualMachineScaleSetHardwareProfile)) + { - OsProfile = osProfile; - StorageProfile = storageProfile; - NetworkProfile = networkProfile; - SecurityPostureReference = securityPostureReference; - SecurityProfile = securityProfile; - DiagnosticsProfile = diagnosticsProfile; - ExtensionProfile = extensionProfile; - LicenseType = licenseType; - BillingProfile = billingProfile; - ScheduledEventsProfile = scheduledEventsProfile; - UserData = userData; - HardwareProfile = hardwareProfile; + this.OsProfile = osProfile; + this.StorageProfile = storageProfile; + this.NetworkProfile = networkProfile; + this.SecurityPostureReference = securityPostureReference; + this.SecurityProfile = securityProfile; + this.DiagnosticsProfile = diagnosticsProfile; + this.ExtensionProfile = extensionProfile; + this.LicenseType = licenseType; + this.BillingProfile = billingProfile; + this.ScheduledEventsProfile = scheduledEventsProfile; + this.UserData = userData; + this.HardwareProfile = hardwareProfile; CustomInit(); } @@ -79,83 +85,82 @@ public VirtualMachineScaleSetUpdateVMProfile() /// partial void CustomInit(); + /// /// Gets or sets the virtual machine scale set OS profile. /// - [JsonProperty(PropertyName = "osProfile")] - public VirtualMachineScaleSetUpdateOSProfile OsProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osProfile")] + public VirtualMachineScaleSetUpdateOSProfile OsProfile {get; set; } /// /// Gets or sets the virtual machine scale set storage profile. /// - [JsonProperty(PropertyName = "storageProfile")] - public VirtualMachineScaleSetUpdateStorageProfile StorageProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "storageProfile")] + public VirtualMachineScaleSetUpdateStorageProfile StorageProfile {get; set; } /// /// Gets or sets the virtual machine scale set network profile. /// - [JsonProperty(PropertyName = "networkProfile")] - public VirtualMachineScaleSetUpdateNetworkProfile NetworkProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "networkProfile")] + public VirtualMachineScaleSetUpdateNetworkProfile NetworkProfile {get; set; } /// - /// Gets or sets the virtual machine scale set security posture - /// reference. + /// Gets or sets the virtual machine scale set security posture reference. /// - [JsonProperty(PropertyName = "securityPostureReference")] - public SecurityPostureReferenceUpdate SecurityPostureReference { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "securityPostureReference")] + public SecurityPostureReferenceUpdate SecurityPostureReference {get; set; } /// /// Gets or sets the virtual machine scale set Security profile /// - [JsonProperty(PropertyName = "securityProfile")] - public SecurityProfile SecurityProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "securityProfile")] + public SecurityProfile SecurityProfile {get; set; } /// /// Gets or sets the virtual machine scale set diagnostics profile. /// - [JsonProperty(PropertyName = "diagnosticsProfile")] - public DiagnosticsProfile DiagnosticsProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diagnosticsProfile")] + public DiagnosticsProfile DiagnosticsProfile {get; set; } /// /// Gets or sets the virtual machine scale set extension profile. /// - [JsonProperty(PropertyName = "extensionProfile")] - public VirtualMachineScaleSetExtensionProfile ExtensionProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extensionProfile")] + public VirtualMachineScaleSetExtensionProfile ExtensionProfile {get; set; } /// /// Gets or sets the license type, which is for bring your own license /// scenario. /// - [JsonProperty(PropertyName = "licenseType")] - public string LicenseType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "licenseType")] + public string LicenseType {get; set; } /// - /// Gets or sets specifies the billing related details of a Azure Spot - /// VMSS. Minimum api-version: 2019-03-01. + /// Gets or sets specifies the billing related details of a Azure Spot VMSS. + /// Minimum api-version: 2019-03-01. /// - [JsonProperty(PropertyName = "billingProfile")] - public BillingProfile BillingProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "billingProfile")] + public BillingProfile BillingProfile {get; set; } /// /// Gets or sets specifies Scheduled Event related configurations. /// - [JsonProperty(PropertyName = "scheduledEventsProfile")] - public ScheduledEventsProfile ScheduledEventsProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "scheduledEventsProfile")] + public ScheduledEventsProfile ScheduledEventsProfile {get; set; } /// - /// Gets or sets userData for the VM, which must be base-64 encoded. - /// Customer should not pass any secrets in here. - /// &lt;br&gt;&lt;br&gt;Minimum api-version: 2021-03-01 + /// Gets or sets userData for the VM, which must be base-64 encoded. Customer + /// should not pass any secrets in here. <br><br>Minimum api-version: + /// 2021-03-01 /// - [JsonProperty(PropertyName = "userData")] - public string UserData { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "userData")] + public string UserData {get; set; } /// - /// Gets or sets specifies the hardware profile related details of a - /// scale set. Minimum api-version: 2021-11-01. + /// Gets or sets specifies the hardware profile related details of a scale set. + /// Minimum api-version: 2021-11-01. /// - [JsonProperty(PropertyName = "hardwareProfile")] - public VirtualMachineScaleSetHardwareProfile HardwareProfile { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "hardwareProfile")] + public VirtualMachineScaleSetHardwareProfile HardwareProfile {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVM.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVM.cs index 953c29a79f2c..f8b780ab2b5f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVM.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVM.cs @@ -1,27 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Describes a virtual machine scale set virtual machine. /// - [Rest.Serialization.JsonTransformation] - public partial class VirtualMachineScaleSetVM : Resource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class VirtualMachineScaleSetVM : TrackedResource { /// /// Initializes a new instance of the VirtualMachineScaleSetVM class. @@ -34,122 +24,161 @@ public VirtualMachineScaleSetVM() /// /// Initializes a new instance of the VirtualMachineScaleSetVM class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// Specifies whether the latest model - /// has been applied to the virtual machine. - /// Azure VM unique ID. - /// The virtual machine instance - /// view. - /// Specifies the hardware settings for - /// the virtual machine. - /// Specifies the resilient VM - /// deletion status for the virtual machine. Possible values include: - /// 'Enabled', 'Disabled', 'InProgress', 'Failed' - /// Specifies the storage settings for the - /// virtual machine disks. - /// Specifies additional - /// capabilities enabled or disabled on the virtual machine in the - /// scale set. For instance: whether the virtual machine has the - /// capability to support attaching managed data disks with - /// UltraSSD_LRS storage account type. - /// Specifies the operating system settings for - /// the virtual machine. - /// Specifies the Security related - /// profile settings for the virtual machine. - /// Specifies the network interfaces of - /// the virtual machine. - /// Specifies the network - /// profile configuration of the virtual machine. - /// Specifies the boot diagnostic - /// settings state. Minimum api-version: 2015-06-15. - /// Specifies information about the - /// availability set that the virtual machine should be assigned to. - /// Virtual machines specified in the same availability set are - /// allocated to different nodes to maximize availability. For more + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// The virtual machine instance ID. + /// + + /// The virtual machine SKU. + /// + + /// Specifies information about the marketplace image used to create the + /// virtual machine. This element is only used for marketplace images. Before + /// you can use a marketplace image from an API, you must enable the image for + /// programmatic use. In the Azure portal, find the marketplace image that you + /// want to use and then click **Want to deploy programmatically, Get Started + /// ->**. Enter any required information and then click **Save**. + /// + + /// The virtual machine child extension resources. + /// + + /// The virtual machine zones. + /// + + /// The identity of the virtual machine, if configured. + /// + + /// Etag is property returned in Update/Get response of the VMSS VM, so that + /// customer can supply it in the header to ensure optimistic updates. + /// + + /// Specifies the hardware settings for the virtual machine. + /// + + /// Specifies the storage settings for the virtual machine disks. + /// + + /// Specifies additional capabilities enabled or disabled on the virtual + /// machine in the scale set. For instance: whether the virtual machine has the + /// capability to support attaching managed data disks with UltraSSD_LRS + /// storage account type. + /// + + /// Specifies the operating system settings for the virtual machine. + /// + + /// Specifies the Security related profile settings for the virtual machine. + /// + + /// Specifies the network interfaces of the virtual machine. + /// + + /// Specifies the boot diagnostic settings state. Minimum api-version: + /// 2015-06-15. + /// + + /// Specifies whether the latest model has been applied to the virtual machine. + /// + + /// Azure VM unique ID. + /// + + /// The virtual machine instance view. + /// + + /// Specifies the resilient VM deletion status for the virtual machine. + /// Possible values include: 'Enabled', 'Disabled', 'InProgress', 'Failed' + + /// Specifies the network profile configuration of the virtual machine. + /// + + /// Specifies information about the availability set that the virtual machine + /// should be assigned to. Virtual machines specified in the same availability + /// set are allocated to different nodes to maximize availability. For more /// information about availability sets, see [Availability sets /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). - /// For more information on Azure planned maintenance, see [Maintenance - /// and updates for Virtual Machines in + /// For more information on Azure planned maintenance, see [Maintenance and + /// updates for Virtual Machines in /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). - /// Currently, a VM can only be added to availability set at creation - /// time. An existing VM cannot be added to an availability - /// set. - /// The provisioning state, which only - /// appears in the response. - /// Specifies that the image or disk that is - /// being used was licensed on-premises. <br><br> Possible - /// values for Windows Server operating system are: - /// <br><br> Windows_Client <br><br> - /// Windows_Server <br><br> Possible values for Linux - /// Server operating system are: <br><br> RHEL_BYOS (for - /// RHEL) <br><br> SLES_BYOS (for SUSE) - /// <br><br> For more information, see [Azure Hybrid Use - /// Benefit for Windows + /// Currently, a VM can only be added to availability set at creation time. An + /// existing VM cannot be added to an availability set. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// Specifies that the image or disk that is being used was licensed + /// on-premises. <br><br> Possible values for Windows Server operating system + /// are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible + /// values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) + /// <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure + /// Hybrid Use Benefit for Windows /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) /// <br><br> [Azure Hybrid Use Benefit for Linux /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) - /// <br><br> Minimum api-version: 2015-06-15 - /// Specifies whether the model - /// applied to the virtual machine is the model of the virtual machine - /// scale set or the customized model for the virtual machine. - /// Specifies the protection policy of - /// the virtual machine. - /// UserData for the VM, which must be base-64 - /// encoded. Customer should not pass any secrets in here. Minimum - /// api-version: 2021-03-01 - /// Specifies the time at which the Virtual - /// Machine resource was created. Minimum api-version: - /// 2021-11-01. - /// The virtual machine instance ID. - /// The virtual machine SKU. - /// Specifies information about the marketplace - /// image used to create the virtual machine. This element is only used - /// for marketplace images. Before you can use a marketplace image from - /// an API, you must enable the image for programmatic use. In the - /// Azure portal, find the marketplace image that you want to use and - /// then click **Want to deploy programmatically, Get Started ->**. - /// Enter any required information and then click **Save**. - /// The virtual machine child extension - /// resources. - /// The virtual machine zones. - /// The identity of the virtual machine, if - /// configured. - /// Etag is property returned in Update/Get response - /// of the VMSS VM, so that customer can supply it in the header to - /// ensure optimistic updates. - public VirtualMachineScaleSetVM(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), bool? latestModelApplied = default(bool?), string vmId = default(string), VirtualMachineScaleSetVMInstanceView instanceView = default(VirtualMachineScaleSetVMInstanceView), HardwareProfile hardwareProfile = default(HardwareProfile), string resilientVMDeletionStatus = default(string), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), SecurityProfile securityProfile = default(SecurityProfile), NetworkProfile networkProfile = default(NetworkProfile), VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration = default(VirtualMachineScaleSetVMNetworkProfileConfiguration), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), string provisioningState = default(string), string licenseType = default(string), string modelDefinitionApplied = default(string), VirtualMachineScaleSetVMProtectionPolicy protectionPolicy = default(VirtualMachineScaleSetVMProtectionPolicy), string userData = default(string), System.DateTime? timeCreated = default(System.DateTime?), string instanceId = default(string), Sku sku = default(Sku), Plan plan = default(Plan), IList resources = default(IList), IList zones = default(IList), VirtualMachineIdentity identity = default(VirtualMachineIdentity), string etag = default(string)) - : base(location, id, name, type, tags) + /// <br><br> Minimum api-version: 2015-06-15 + /// + + /// Specifies whether the model applied to the virtual machine is the model of + /// the virtual machine scale set or the customized model for the virtual + /// machine. + /// + + /// Specifies the protection policy of the virtual machine. + /// + + /// UserData for the VM, which must be base-64 encoded. Customer should not + /// pass any secrets in here. Minimum api-version: 2021-03-01 + /// + + /// Specifies the time at which the Virtual Machine resource was created. + /// Minimum api-version: 2021-11-01. + /// + public VirtualMachineScaleSetVM(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string instanceId = default(string), Sku sku = default(Sku), Plan plan = default(Plan), System.Collections.Generic.IList resources = default(System.Collections.Generic.IList), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), VirtualMachineIdentity identity = default(VirtualMachineIdentity), string etag = default(string), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), SecurityProfile securityProfile = default(SecurityProfile), NetworkProfile networkProfile = default(NetworkProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), bool? latestModelApplied = default(bool?), string vmId = default(string), VirtualMachineScaleSetVMInstanceView instanceView = default(VirtualMachineScaleSetVMInstanceView), string resilientVMDeletionStatus = default(string), VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration = default(VirtualMachineScaleSetVMNetworkProfileConfiguration), SubResource availabilitySet = default(SubResource), string provisioningState = default(string), string licenseType = default(string), string modelDefinitionApplied = default(string), VirtualMachineScaleSetVMProtectionPolicy protectionPolicy = default(VirtualMachineScaleSetVMProtectionPolicy), string userData = default(string), System.DateTime? timeCreated = default(System.DateTime?)) + + : base(location, id, name, type, tags) { - LatestModelApplied = latestModelApplied; - VmId = vmId; - InstanceView = instanceView; - HardwareProfile = hardwareProfile; - ResilientVMDeletionStatus = resilientVMDeletionStatus; - StorageProfile = storageProfile; - AdditionalCapabilities = additionalCapabilities; - OsProfile = osProfile; - SecurityProfile = securityProfile; - NetworkProfile = networkProfile; - NetworkProfileConfiguration = networkProfileConfiguration; - DiagnosticsProfile = diagnosticsProfile; - AvailabilitySet = availabilitySet; - ProvisioningState = provisioningState; - LicenseType = licenseType; - ModelDefinitionApplied = modelDefinitionApplied; - ProtectionPolicy = protectionPolicy; - UserData = userData; - TimeCreated = timeCreated; - InstanceId = instanceId; - Sku = sku; - Plan = plan; - Resources = resources; - Zones = zones; - Identity = identity; - Etag = etag; + this.InstanceId = instanceId; + this.Sku = sku; + this.Plan = plan; + this.Resources = resources; + this.Zones = zones; + this.Identity = identity; + this.Etag = etag; + this.HardwareProfile = hardwareProfile; + this.StorageProfile = storageProfile; + this.AdditionalCapabilities = additionalCapabilities; + this.OsProfile = osProfile; + this.SecurityProfile = securityProfile; + this.NetworkProfile = networkProfile; + this.DiagnosticsProfile = diagnosticsProfile; + this.LatestModelApplied = latestModelApplied; + this.VmId = vmId; + this.InstanceView = instanceView; + this.ResilientVMDeletionStatus = resilientVMDeletionStatus; + this.NetworkProfileConfiguration = networkProfileConfiguration; + this.AvailabilitySet = availabilitySet; + this.ProvisioningState = provisioningState; + this.LicenseType = licenseType; + this.ModelDefinitionApplied = modelDefinitionApplied; + this.ProtectionPolicy = protectionPolicy; + this.UserData = userData; + this.TimeCreated = timeCreated; CustomInit(); } @@ -158,230 +187,216 @@ public VirtualMachineScaleSetVM() /// partial void CustomInit(); + /// - /// Gets specifies whether the latest model has been applied to the - /// virtual machine. + /// Gets the virtual machine instance ID. /// - [JsonProperty(PropertyName = "properties.latestModelApplied")] - public bool? LatestModelApplied { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "instanceId")] + public string InstanceId {get; private set; } /// - /// Gets azure VM unique ID. + /// Gets the virtual machine SKU. /// - [JsonProperty(PropertyName = "properties.vmId")] - public string VmId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public Sku Sku {get; private set; } /// - /// Gets the virtual machine instance view. + /// Gets or sets specifies information about the marketplace image used to + /// create the virtual machine. This element is only used for marketplace + /// images. Before you can use a marketplace image from an API, you must enable + /// the image for programmatic use. In the Azure portal, find the marketplace + /// image that you want to use and then click **Want to deploy + /// programmatically, Get Started ->**. Enter any required information and then + /// click **Save**. /// - [JsonProperty(PropertyName = "properties.instanceView")] - public VirtualMachineScaleSetVMInstanceView InstanceView { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "plan")] + public Plan Plan {get; set; } /// - /// Gets or sets specifies the hardware settings for the virtual - /// machine. + /// Gets the virtual machine child extension resources. /// - [JsonProperty(PropertyName = "properties.hardwareProfile")] - public HardwareProfile HardwareProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resources")] + public System.Collections.Generic.IList Resources {get; private set; } /// - /// Gets or sets specifies the resilient VM deletion status for the - /// virtual machine. Possible values include: 'Enabled', 'Disabled', - /// 'InProgress', 'Failed' + /// Gets the virtual machine zones. /// - [JsonProperty(PropertyName = "properties.resilientVMDeletionStatus")] - public string ResilientVMDeletionStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; private set; } /// - /// Gets or sets specifies the storage settings for the virtual machine - /// disks. + /// Gets or sets the identity of the virtual machine, if configured. /// - [JsonProperty(PropertyName = "properties.storageProfile")] - public StorageProfile StorageProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public VirtualMachineIdentity Identity {get; set; } /// - /// Gets or sets specifies additional capabilities enabled or disabled - /// on the virtual machine in the scale set. For instance: whether the - /// virtual machine has the capability to support attaching managed - /// data disks with UltraSSD_LRS storage account type. + /// Gets etag is property returned in Update/Get response of the VMSS VM, so + /// that customer can supply it in the header to ensure optimistic updates. /// - [JsonProperty(PropertyName = "properties.additionalCapabilities")] - public AdditionalCapabilities AdditionalCapabilities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets specifies the operating system settings for the - /// virtual machine. + /// Gets or sets specifies the hardware settings for the virtual machine. /// - [JsonProperty(PropertyName = "properties.osProfile")] - public OSProfile OsProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hardwareProfile")] + public HardwareProfile HardwareProfile {get; set; } /// - /// Gets or sets specifies the Security related profile settings for - /// the virtual machine. + /// Gets or sets specifies the storage settings for the virtual machine disks. /// - [JsonProperty(PropertyName = "properties.securityProfile")] - public SecurityProfile SecurityProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageProfile")] + public StorageProfile StorageProfile {get; set; } /// - /// Gets or sets specifies the network interfaces of the virtual - /// machine. + /// Gets or sets specifies additional capabilities enabled or disabled on the + /// virtual machine in the scale set. For instance: whether the virtual machine + /// has the capability to support attaching managed data disks with + /// UltraSSD_LRS storage account type. /// - [JsonProperty(PropertyName = "properties.networkProfile")] - public NetworkProfile NetworkProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.additionalCapabilities")] + public AdditionalCapabilities AdditionalCapabilities {get; set; } /// - /// Gets or sets specifies the network profile configuration of the - /// virtual machine. + /// Gets or sets specifies the operating system settings for the virtual + /// machine. /// - [JsonProperty(PropertyName = "properties.networkProfileConfiguration")] - public VirtualMachineScaleSetVMNetworkProfileConfiguration NetworkProfileConfiguration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osProfile")] + public OSProfile OsProfile {get; set; } /// - /// Gets or sets specifies the boot diagnostic settings state. Minimum - /// api-version: 2015-06-15. + /// Gets or sets specifies the Security related profile settings for the + /// virtual machine. /// - [JsonProperty(PropertyName = "properties.diagnosticsProfile")] - public DiagnosticsProfile DiagnosticsProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityProfile")] + public SecurityProfile SecurityProfile {get; set; } /// - /// Gets or sets specifies information about the availability set that - /// the virtual machine should be assigned to. Virtual machines - /// specified in the same availability set are allocated to different - /// nodes to maximize availability. For more information about - /// availability sets, see [Availability sets - /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). - /// For more information on Azure planned maintenance, see [Maintenance - /// and updates for Virtual Machines in - /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). - /// Currently, a VM can only be added to availability set at creation - /// time. An existing VM cannot be added to an availability set. + /// Gets or sets specifies the network interfaces of the virtual machine. /// - [JsonProperty(PropertyName = "properties.availabilitySet")] - public SubResource AvailabilitySet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkProfile")] + public NetworkProfile NetworkProfile {get; set; } /// - /// Gets the provisioning state, which only appears in the response. + /// Gets or sets specifies the boot diagnostic settings state. Minimum + /// api-version: 2015-06-15. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diagnosticsProfile")] + public DiagnosticsProfile DiagnosticsProfile {get; set; } /// - /// Gets or sets specifies that the image or disk that is being used - /// was licensed on-premises. &lt;br&gt;&lt;br&gt; - /// Possible values for Windows Server operating system are: - /// &lt;br&gt;&lt;br&gt; Windows_Client - /// &lt;br&gt;&lt;br&gt; Windows_Server - /// &lt;br&gt;&lt;br&gt; Possible values for Linux - /// Server operating system are: &lt;br&gt;&lt;br&gt; - /// RHEL_BYOS (for RHEL) &lt;br&gt;&lt;br&gt; SLES_BYOS - /// (for SUSE) &lt;br&gt;&lt;br&gt; For more - /// information, see [Azure Hybrid Use Benefit for Windows - /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - /// &lt;br&gt;&lt;br&gt; [Azure Hybrid Use Benefit for - /// Linux - /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) - /// &lt;br&gt;&lt;br&gt; Minimum api-version: - /// 2015-06-15 + /// Gets specifies whether the latest model has been applied to the virtual + /// machine. /// - [JsonProperty(PropertyName = "properties.licenseType")] - public string LicenseType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.latestModelApplied")] + public bool? LatestModelApplied {get; private set; } /// - /// Gets specifies whether the model applied to the virtual machine is - /// the model of the virtual machine scale set or the customized model - /// for the virtual machine. + /// Gets azure VM unique ID. /// - [JsonProperty(PropertyName = "properties.modelDefinitionApplied")] - public string ModelDefinitionApplied { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vmId")] + public string VmId {get; private set; } /// - /// Gets or sets specifies the protection policy of the virtual - /// machine. + /// Gets the virtual machine instance view. /// - [JsonProperty(PropertyName = "properties.protectionPolicy")] - public VirtualMachineScaleSetVMProtectionPolicy ProtectionPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.instanceView")] + public VirtualMachineScaleSetVMInstanceView InstanceView {get; private set; } /// - /// Gets or sets userData for the VM, which must be base-64 encoded. - /// Customer should not pass any secrets in here. Minimum api-version: - /// 2021-03-01 + /// Gets or sets specifies the resilient VM deletion status for the virtual + /// machine. Possible values include: 'Enabled', 'Disabled', 'InProgress', 'Failed' /// - [JsonProperty(PropertyName = "properties.userData")] - public string UserData { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resilientVMDeletionStatus")] + public string ResilientVMDeletionStatus {get; set; } /// - /// Gets specifies the time at which the Virtual Machine resource was - /// created. Minimum api-version: 2021-11-01. + /// Gets or sets specifies the network profile configuration of the virtual + /// machine. /// - [JsonProperty(PropertyName = "properties.timeCreated")] - public System.DateTime? TimeCreated { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkProfileConfiguration")] + public VirtualMachineScaleSetVMNetworkProfileConfiguration NetworkProfileConfiguration {get; set; } /// - /// Gets the virtual machine instance ID. + /// Gets or sets specifies information about the availability set that the + /// virtual machine should be assigned to. Virtual machines specified in the + /// same availability set are allocated to different nodes to maximize + /// availability. For more information about availability sets, see + /// [Availability sets + /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + /// For more information on Azure planned maintenance, see [Maintenance and + /// updates for Virtual Machines in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). + /// Currently, a VM can only be added to availability set at creation time. An + /// existing VM cannot be added to an availability set. /// - [JsonProperty(PropertyName = "instanceId")] - public string InstanceId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.availabilitySet")] + public SubResource AvailabilitySet {get; set; } /// - /// Gets the virtual machine SKU. + /// Gets the provisioning state, which only appears in the response. /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets specifies information about the marketplace image used - /// to create the virtual machine. This element is only used for - /// marketplace images. Before you can use a marketplace image from an - /// API, you must enable the image for programmatic use. In the Azure - /// portal, find the marketplace image that you want to use and then - /// click **Want to deploy programmatically, Get Started -&gt;**. - /// Enter any required information and then click **Save**. + /// Gets or sets specifies that the image or disk that is being used was + /// licensed on-premises. <br><br> Possible values for Windows Server operating + /// system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> + /// Possible values for Linux Server operating system are: <br><br> RHEL_BYOS + /// (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see + /// [Azure Hybrid Use Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 /// - [JsonProperty(PropertyName = "plan")] - public Plan Plan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.licenseType")] + public string LicenseType {get; set; } /// - /// Gets the virtual machine child extension resources. + /// Gets specifies whether the model applied to the virtual machine is the + /// model of the virtual machine scale set or the customized model for the + /// virtual machine. /// - [JsonProperty(PropertyName = "resources")] - public IList Resources { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.modelDefinitionApplied")] + public string ModelDefinitionApplied {get; private set; } /// - /// Gets the virtual machine zones. + /// Gets or sets specifies the protection policy of the virtual machine. /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protectionPolicy")] + public VirtualMachineScaleSetVMProtectionPolicy ProtectionPolicy {get; set; } /// - /// Gets or sets the identity of the virtual machine, if configured. + /// Gets or sets userData for the VM, which must be base-64 encoded. Customer + /// should not pass any secrets in here. Minimum api-version: 2021-03-01 /// - [JsonProperty(PropertyName = "identity")] - public VirtualMachineIdentity Identity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.userData")] + public string UserData {get; set; } /// - /// Gets etag is property returned in Update/Get response of the VMSS - /// VM, so that customer can supply it in the header to ensure - /// optimistic updates. + /// Gets specifies the time at which the Virtual Machine resource was created. + /// Minimum api-version: 2021-11-01. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeCreated")] + public System.DateTime? TimeCreated {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (StorageProfile != null) - { - StorageProfile.Validate(); - } - if (Resources != null) + + + + if (this.Resources != null) { - foreach (var element in Resources) + foreach (var element in this.Resources) { if (element != null) { @@ -389,6 +404,29 @@ public override void Validate() } } } + + + + + if (this.StorageProfile != null) + { + this.StorageProfile.Validate(); + } + + + + + + + + + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtension.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtension.cs index 93f1c6c9264b..9d282d2ebb56 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtension.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtension.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Describes a VMSS VM Extension. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachineScaleSetVMExtension : SubResourceReadOnly { /// - /// Initializes a new instance of the VirtualMachineScaleSetVMExtension - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetVMExtension class. /// public VirtualMachineScaleSetVMExtension() { @@ -33,68 +22,89 @@ public VirtualMachineScaleSetVMExtension() } /// - /// Initializes a new instance of the VirtualMachineScaleSetVMExtension - /// class. - /// - /// Resource Id - /// How the extension handler should be - /// forced to update even if the extension configuration has not - /// changed. - /// The name of the extension handler - /// publisher. - /// Specifies the - /// type of the extension; an example is - /// "CustomScriptExtension". - /// Specifies the version of the - /// script handler. - /// Indicates whether the - /// extension should use a newer minor version if one is available at - /// deployment time. Once deployed, however, the extension will not - /// upgrade minor versions unless redeployed, even with this property - /// set to true. - /// Indicates whether the - /// extension should be automatically upgraded by the platform if there - /// is a newer version of the extension available. - /// Json formatted public settings for the - /// extension. - /// The extension can contain either - /// protectedSettings or protectedSettingsFromKeyVault or no protected - /// settings at all. - /// The provisioning state, which only - /// appears in the response. - /// The virtual machine extension instance - /// view. - /// Indicates whether failures stemming - /// from the extension will be suppressed (Operational failures such as - /// not connecting to the VM will not be suppressed regardless of this - /// value). The default is false. - /// The extensions - /// protected settings that are passed by reference, and consumed from - /// key vault - /// Collection of extension - /// names after which this extension needs to be provisioned. - /// The location of the extension. - /// Resource type - /// Resource name - public VirtualMachineScaleSetVMExtension(string id = default(string), string forceUpdateTag = default(string), string publisher = default(string), string virtualMachineExtensionPropertiesType = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object), string provisioningState = default(string), VirtualMachineExtensionInstanceView instanceView = default(VirtualMachineExtensionInstanceView), bool? suppressFailures = default(bool?), KeyVaultSecretReference protectedSettingsFromKeyVault = default(KeyVaultSecretReference), IList provisionAfterExtensions = default(IList), string location = default(string), string type = default(string), string name = default(string)) - : base(id) + /// Initializes a new instance of the VirtualMachineScaleSetVMExtension class. + /// + + /// Resource Id + /// + + /// The location of the extension. + /// + + /// Resource type + /// + + /// Resource name + /// + + /// How the extension handler should be forced to update even if the extension + /// configuration has not changed. + /// + + /// The name of the extension handler publisher. + /// + + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// + + /// Specifies the version of the script handler. + /// + + /// Indicates whether the extension should use a newer minor version if one is + /// available at deployment time. Once deployed, however, the extension will + /// not upgrade minor versions unless redeployed, even with this property set + /// to true. + /// + + /// Indicates whether the extension should be automatically upgraded by the + /// platform if there is a newer version of the extension available. + /// + + /// Json formatted public settings for the extension. + /// + + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// The virtual machine extension instance view. + /// + + /// Indicates whether failures stemming from the extension will be suppressed + /// (Operational failures such as not connecting to the VM will not be + /// suppressed regardless of this value). The default is false. + /// + + /// The extensions protected settings that are passed by reference, and + /// consumed from key vault + /// + + /// Collection of extension names after which this extension needs to be + /// provisioned. + /// + public VirtualMachineScaleSetVMExtension(string id = default(string), string location = default(string), string type = default(string), string name = default(string), string forceUpdateTag = default(string), string publisher = default(string), string virtualMachineExtensionType = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object), string provisioningState = default(string), VirtualMachineExtensionInstanceView instanceView = default(VirtualMachineExtensionInstanceView), bool? suppressFailures = default(bool?), KeyVaultSecretReference protectedSettingsFromKeyVault = default(KeyVaultSecretReference), System.Collections.Generic.IList provisionAfterExtensions = default(System.Collections.Generic.IList)) + + : base(id) { - ForceUpdateTag = forceUpdateTag; - Publisher = publisher; - VirtualMachineExtensionPropertiesType = virtualMachineExtensionPropertiesType; - TypeHandlerVersion = typeHandlerVersion; - AutoUpgradeMinorVersion = autoUpgradeMinorVersion; - EnableAutomaticUpgrade = enableAutomaticUpgrade; - Settings = settings; - ProtectedSettings = protectedSettings; - ProvisioningState = provisioningState; - InstanceView = instanceView; - SuppressFailures = suppressFailures; - ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; - ProvisionAfterExtensions = provisionAfterExtensions; - Location = location; - Type = type; - Name = name; + this.Location = location; + this.Type = type; + this.Name = name; + this.ForceUpdateTag = forceUpdateTag; + this.Publisher = publisher; + this.VirtualMachineExtensionType = virtualMachineExtensionType; + this.TypeHandlerVersion = typeHandlerVersion; + this.AutoUpgradeMinorVersion = autoUpgradeMinorVersion; + this.EnableAutomaticUpgrade = enableAutomaticUpgrade; + this.Settings = settings; + this.ProtectedSettings = protectedSettings; + this.ProvisioningState = provisioningState; + this.InstanceView = instanceView; + this.SuppressFailures = suppressFailures; + this.ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + this.ProvisionAfterExtensions = provisionAfterExtensions; CustomInit(); } @@ -103,127 +113,138 @@ public VirtualMachineScaleSetVMExtension() /// partial void CustomInit(); + + /// + /// Gets or sets the location of the extension. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets resource type + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } + /// - /// Gets or sets how the extension handler should be forced to update - /// even if the extension configuration has not changed. + /// Gets resource name + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } + + /// + /// Gets or sets how the extension handler should be forced to update even if + /// the extension configuration has not changed. /// - [JsonProperty(PropertyName = "properties.forceUpdateTag")] - public string ForceUpdateTag { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.forceUpdateTag")] + public string ForceUpdateTag {get; set; } /// /// Gets or sets the name of the extension handler publisher. /// - [JsonProperty(PropertyName = "properties.publisher")] - public string Publisher { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publisher")] + public string Publisher {get; set; } /// /// Gets or sets specifies the type of the extension; an example is - /// "CustomScriptExtension". + /// "CustomScriptExtension". /// - [JsonProperty(PropertyName = "properties.type")] - public string VirtualMachineExtensionPropertiesType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.type")] + public string VirtualMachineExtensionType {get; set; } /// /// Gets or sets specifies the version of the script handler. /// - [JsonProperty(PropertyName = "properties.typeHandlerVersion")] - public string TypeHandlerVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.typeHandlerVersion")] + public string TypeHandlerVersion {get; set; } /// - /// Gets or sets indicates whether the extension should use a newer - /// minor version if one is available at deployment time. Once - /// deployed, however, the extension will not upgrade minor versions - /// unless redeployed, even with this property set to true. + /// Gets or sets indicates whether the extension should use a newer minor + /// version if one is available at deployment time. Once deployed, however, the + /// extension will not upgrade minor versions unless redeployed, even with this + /// property set to true. /// - [JsonProperty(PropertyName = "properties.autoUpgradeMinorVersion")] - public bool? AutoUpgradeMinorVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoUpgradeMinorVersion")] + public bool? AutoUpgradeMinorVersion {get; set; } /// - /// Gets or sets indicates whether the extension should be - /// automatically upgraded by the platform if there is a newer version - /// of the extension available. + /// Gets or sets indicates whether the extension should be automatically + /// upgraded by the platform if there is a newer version of the extension + /// available. /// - [JsonProperty(PropertyName = "properties.enableAutomaticUpgrade")] - public bool? EnableAutomaticUpgrade { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableAutomaticUpgrade")] + public bool? EnableAutomaticUpgrade {get; set; } /// /// Gets or sets json formatted public settings for the extension. /// - [JsonProperty(PropertyName = "properties.settings")] - public object Settings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.settings")] + public object Settings {get; set; } /// /// Gets or sets the extension can contain either protectedSettings or /// protectedSettingsFromKeyVault or no protected settings at all. /// - [JsonProperty(PropertyName = "properties.protectedSettings")] - public object ProtectedSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protectedSettings")] + public object ProtectedSettings {get; set; } /// /// Gets the provisioning state, which only appears in the response. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Gets or sets the virtual machine extension instance view. /// - [JsonProperty(PropertyName = "properties.instanceView")] - public VirtualMachineExtensionInstanceView InstanceView { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.instanceView")] + public VirtualMachineExtensionInstanceView InstanceView {get; set; } /// - /// Gets or sets indicates whether failures stemming from the extension - /// will be suppressed (Operational failures such as not connecting to - /// the VM will not be suppressed regardless of this value). The - /// default is false. + /// Gets or sets indicates whether failures stemming from the extension will be + /// suppressed (Operational failures such as not connecting to the VM will not + /// be suppressed regardless of this value). The default is false. /// - [JsonProperty(PropertyName = "properties.suppressFailures")] - public bool? SuppressFailures { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.suppressFailures")] + public bool? SuppressFailures {get; set; } /// /// Gets or sets the extensions protected settings that are passed by /// reference, and consumed from key vault /// - [JsonProperty(PropertyName = "properties.protectedSettingsFromKeyVault")] - public KeyVaultSecretReference ProtectedSettingsFromKeyVault { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protectedSettingsFromKeyVault")] + public KeyVaultSecretReference ProtectedSettingsFromKeyVault {get; set; } /// - /// Gets or sets collection of extension names after which this - /// extension needs to be provisioned. + /// Gets or sets collection of extension names after which this extension needs + /// to be provisioned. /// - [JsonProperty(PropertyName = "properties.provisionAfterExtensions")] - public IList ProvisionAfterExtensions { get; set; } - - /// - /// Gets or sets the location of the extension. - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets resource type - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - /// - /// Gets resource name - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisionAfterExtensions")] + public System.Collections.Generic.IList ProvisionAfterExtensions {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ProtectedSettingsFromKeyVault != null) + + + + + + + + + + + + if (this.ProtectedSettingsFromKeyVault != null) { - ProtectedSettingsFromKeyVault.Validate(); + this.ProtectedSettingsFromKeyVault.Validate(); } + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionUpdate.cs index fdbb3911e616..ef7d54099ce6 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionUpdate.cs @@ -1,29 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Describes a VMSS VM Extension. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachineScaleSetVMExtensionUpdate : SubResourceReadOnly { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMExtensionUpdate class. + /// Initializes a new instance of the VirtualMachineScaleSetVMExtensionUpdate class. /// public VirtualMachineScaleSetVMExtensionUpdate() { @@ -31,56 +22,72 @@ public VirtualMachineScaleSetVMExtensionUpdate() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMExtensionUpdate class. - /// - /// Resource Id - /// The name of the extension. - /// Resource type - /// How the extension handler should be - /// forced to update even if the extension configuration has not - /// changed. - /// The name of the extension handler - /// publisher. - /// Specifies the type of the extension; an example - /// is "CustomScriptExtension". - /// Specifies the version of the - /// script handler. - /// Indicates whether the - /// extension should use a newer minor version if one is available at - /// deployment time. Once deployed, however, the extension will not - /// upgrade minor versions unless redeployed, even with this property - /// set to true. - /// Indicates whether the - /// extension should be automatically upgraded by the platform if there - /// is a newer version of the extension available. - /// Json formatted public settings for the - /// extension. - /// The extension can contain either - /// protectedSettings or protectedSettingsFromKeyVault or no protected - /// settings at all. - /// Indicates whether failures stemming - /// from the extension will be suppressed (Operational failures such as - /// not connecting to the VM will not be suppressed regardless of this - /// value). The default is false. - /// The extensions - /// protected settings that are passed by reference, and consumed from - /// key vault - public VirtualMachineScaleSetVMExtensionUpdate(string id = default(string), string name = default(string), string type = default(string), string forceUpdateTag = default(string), string publisher = default(string), string type1 = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object), bool? suppressFailures = default(bool?), KeyVaultSecretReference protectedSettingsFromKeyVault = default(KeyVaultSecretReference)) - : base(id) + /// Initializes a new instance of the VirtualMachineScaleSetVMExtensionUpdate class. + /// + + /// Resource Id + /// + + /// The name of the extension. + /// + + /// Resource type + /// + + /// How the extension handler should be forced to update even if the extension + /// configuration has not changed. + /// + + /// The name of the extension handler publisher. + /// + + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// + + /// Specifies the version of the script handler. + /// + + /// Indicates whether the extension should use a newer minor version if one is + /// available at deployment time. Once deployed, however, the extension will + /// not upgrade minor versions unless redeployed, even with this property set + /// to true. + /// + + /// Indicates whether the extension should be automatically upgraded by the + /// platform if there is a newer version of the extension available. + /// + + /// Json formatted public settings for the extension. + /// + + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + + /// Indicates whether failures stemming from the extension will be suppressed + /// (Operational failures such as not connecting to the VM will not be + /// suppressed regardless of this value). The default is false. + /// + + /// The extensions protected settings that are passed by reference, and + /// consumed from key vault + /// + public VirtualMachineScaleSetVMExtensionUpdate(string id = default(string), string name = default(string), string type = default(string), string forceUpdateTag = default(string), string publisher = default(string), string virtualMachineExtensionType = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object), bool? suppressFailures = default(bool?), KeyVaultSecretReference protectedSettingsFromKeyVault = default(KeyVaultSecretReference)) + + : base(id) { - Name = name; - Type = type; - ForceUpdateTag = forceUpdateTag; - Publisher = publisher; - Type1 = type1; - TypeHandlerVersion = typeHandlerVersion; - AutoUpgradeMinorVersion = autoUpgradeMinorVersion; - EnableAutomaticUpgrade = enableAutomaticUpgrade; - Settings = settings; - ProtectedSettings = protectedSettings; - SuppressFailures = suppressFailures; - ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + this.Name = name; + this.Type = type; + this.ForceUpdateTag = forceUpdateTag; + this.Publisher = publisher; + this.VirtualMachineExtensionType = virtualMachineExtensionType; + this.TypeHandlerVersion = typeHandlerVersion; + this.AutoUpgradeMinorVersion = autoUpgradeMinorVersion; + this.EnableAutomaticUpgrade = enableAutomaticUpgrade; + this.Settings = settings; + this.ProtectedSettings = protectedSettings; + this.SuppressFailures = suppressFailures; + this.ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; CustomInit(); } @@ -89,102 +96,109 @@ public VirtualMachineScaleSetVMExtensionUpdate() /// partial void CustomInit(); + /// /// Gets the name of the extension. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets how the extension handler should be forced to update - /// even if the extension configuration has not changed. + /// Gets or sets how the extension handler should be forced to update even if + /// the extension configuration has not changed. /// - [JsonProperty(PropertyName = "properties.forceUpdateTag")] - public string ForceUpdateTag { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.forceUpdateTag")] + public string ForceUpdateTag {get; set; } /// /// Gets or sets the name of the extension handler publisher. /// - [JsonProperty(PropertyName = "properties.publisher")] - public string Publisher { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publisher")] + public string Publisher {get; set; } /// /// Gets or sets specifies the type of the extension; an example is - /// "CustomScriptExtension". + /// "CustomScriptExtension". /// - [JsonProperty(PropertyName = "properties.type")] - public string Type1 { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.type")] + public string VirtualMachineExtensionType {get; set; } /// /// Gets or sets specifies the version of the script handler. /// - [JsonProperty(PropertyName = "properties.typeHandlerVersion")] - public string TypeHandlerVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.typeHandlerVersion")] + public string TypeHandlerVersion {get; set; } /// - /// Gets or sets indicates whether the extension should use a newer - /// minor version if one is available at deployment time. Once - /// deployed, however, the extension will not upgrade minor versions - /// unless redeployed, even with this property set to true. + /// Gets or sets indicates whether the extension should use a newer minor + /// version if one is available at deployment time. Once deployed, however, the + /// extension will not upgrade minor versions unless redeployed, even with this + /// property set to true. /// - [JsonProperty(PropertyName = "properties.autoUpgradeMinorVersion")] - public bool? AutoUpgradeMinorVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoUpgradeMinorVersion")] + public bool? AutoUpgradeMinorVersion {get; set; } /// - /// Gets or sets indicates whether the extension should be - /// automatically upgraded by the platform if there is a newer version - /// of the extension available. + /// Gets or sets indicates whether the extension should be automatically + /// upgraded by the platform if there is a newer version of the extension + /// available. /// - [JsonProperty(PropertyName = "properties.enableAutomaticUpgrade")] - public bool? EnableAutomaticUpgrade { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableAutomaticUpgrade")] + public bool? EnableAutomaticUpgrade {get; set; } /// /// Gets or sets json formatted public settings for the extension. /// - [JsonProperty(PropertyName = "properties.settings")] - public object Settings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.settings")] + public object Settings {get; set; } /// /// Gets or sets the extension can contain either protectedSettings or /// protectedSettingsFromKeyVault or no protected settings at all. /// - [JsonProperty(PropertyName = "properties.protectedSettings")] - public object ProtectedSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protectedSettings")] + public object ProtectedSettings {get; set; } /// - /// Gets or sets indicates whether failures stemming from the extension - /// will be suppressed (Operational failures such as not connecting to - /// the VM will not be suppressed regardless of this value). The - /// default is false. + /// Gets or sets indicates whether failures stemming from the extension will be + /// suppressed (Operational failures such as not connecting to the VM will not + /// be suppressed regardless of this value). The default is false. /// - [JsonProperty(PropertyName = "properties.suppressFailures")] - public bool? SuppressFailures { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.suppressFailures")] + public bool? SuppressFailures {get; set; } /// /// Gets or sets the extensions protected settings that are passed by /// reference, and consumed from key vault /// - [JsonProperty(PropertyName = "properties.protectedSettingsFromKeyVault")] - public KeyVaultSecretReference ProtectedSettingsFromKeyVault { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protectedSettingsFromKeyVault")] + public KeyVaultSecretReference ProtectedSettingsFromKeyVault {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ProtectedSettingsFromKeyVault != null) + + + + + + + + + if (this.ProtectedSettingsFromKeyVault != null) { - ProtectedSettingsFromKeyVault.Validate(); + this.ProtectedSettingsFromKeyVault.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionsCreateOrUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionsCreateOrUpdateHeaders.cs index 97ca62bbdba0..f7eda37fa65c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionsCreateOrUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionsCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class VirtualMachineScaleSetVMExtensionsCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMExtensionsCreateOrUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetVMExtensionsCreateOrUpdateHeaders class. /// public VirtualMachineScaleSetVMExtensionsCreateOrUpdateHeaders() { @@ -28,18 +18,19 @@ public VirtualMachineScaleSetVMExtensionsCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMExtensionsCreateOrUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetVMExtensionsCreateOrUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachineScaleSetVMExtensionsCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachineScaleSetVMExtensionsCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionsListResult.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionsListResult.cs index 1057fee97b37..92843a4d88e2 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionsListResult.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionsListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetVMExtensionsListResult { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMExtensionsListResult class. + /// Initializes a new instance of the VirtualMachineScaleSetVMExtensionsListResult class. /// public VirtualMachineScaleSetVMExtensionsListResult() { @@ -30,13 +21,15 @@ public VirtualMachineScaleSetVMExtensionsListResult() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMExtensionsListResult class. + /// Initializes a new instance of the VirtualMachineScaleSetVMExtensionsListResult class. /// - /// The list of VMSS VM extensions - public VirtualMachineScaleSetVMExtensionsListResult(IList value = default(IList)) + + /// The list of VMSS VM extensions + /// + public VirtualMachineScaleSetVMExtensionsListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -45,11 +38,11 @@ public VirtualMachineScaleSetVMExtensionsListResult() /// partial void CustomInit(); + /// /// Gets or sets the list of VMSS VM extensions /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionsSummary.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionsSummary.cs index aabf14a4753c..2165091088f1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionsSummary.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionsSummary.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetVMExtensionsSummary { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMExtensionsSummary class. + /// Initializes a new instance of the VirtualMachineScaleSetVMExtensionsSummary class. /// public VirtualMachineScaleSetVMExtensionsSummary() { @@ -30,15 +21,19 @@ public VirtualMachineScaleSetVMExtensionsSummary() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMExtensionsSummary class. + /// Initializes a new instance of the VirtualMachineScaleSetVMExtensionsSummary class. /// - /// The extension name. - /// The extensions information. - public VirtualMachineScaleSetVMExtensionsSummary(string name = default(string), IList statusesSummary = default(IList)) + + /// The extension name. + /// + + /// The extensions information. + /// + public VirtualMachineScaleSetVMExtensionsSummary(string name = default(string), System.Collections.Generic.IList statusesSummary = default(System.Collections.Generic.IList)) + { - Name = name; - StatusesSummary = statusesSummary; + this.Name = name; + this.StatusesSummary = statusesSummary; CustomInit(); } @@ -47,17 +42,17 @@ public VirtualMachineScaleSetVMExtensionsSummary() /// partial void CustomInit(); + /// /// Gets the extension name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets the extensions information. /// - [JsonProperty(PropertyName = "statusesSummary")] - public IList StatusesSummary { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "statusesSummary")] + public System.Collections.Generic.IList StatusesSummary {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionsUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionsUpdateHeaders.cs index 04dad5689610..c0c116f1d85a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionsUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMExtensionsUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Update operation. - /// public partial class VirtualMachineScaleSetVMExtensionsUpdateHeaders { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMExtensionsUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetVMExtensionsUpdateHeaders class. /// public VirtualMachineScaleSetVMExtensionsUpdateHeaders() { @@ -28,18 +18,19 @@ public VirtualMachineScaleSetVMExtensionsUpdateHeaders() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMExtensionsUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetVMExtensionsUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachineScaleSetVMExtensionsUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachineScaleSetVMExtensionsUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMInstanceIDs.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMInstanceIDs.cs index b51892cd4f82..a3421533a10d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMInstanceIDs.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMInstanceIDs.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetVMInstanceIDs { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMInstanceIDs class. + /// Initializes a new instance of the VirtualMachineScaleSetVMInstanceIDs class. /// public VirtualMachineScaleSetVMInstanceIDs() { @@ -30,16 +21,17 @@ public VirtualMachineScaleSetVMInstanceIDs() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMInstanceIDs class. + /// Initializes a new instance of the VirtualMachineScaleSetVMInstanceIDs class. /// - /// The virtual machine scale set instance - /// ids. Omitting the virtual machine scale set instance ids will - /// result in the operation being performed on all virtual machines in - /// the virtual machine scale set. - public VirtualMachineScaleSetVMInstanceIDs(IList instanceIds = default(IList)) + + /// The virtual machine scale set instance ids. Omitting the virtual machine + /// scale set instance ids will result in the operation being performed on all + /// virtual machines in the virtual machine scale set. + /// + public VirtualMachineScaleSetVMInstanceIDs(System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList)) + { - InstanceIds = instanceIds; + this.InstanceIds = instanceIds; CustomInit(); } @@ -48,14 +40,13 @@ public VirtualMachineScaleSetVMInstanceIDs() /// partial void CustomInit(); + /// - /// Gets or sets the virtual machine scale set instance ids. Omitting - /// the virtual machine scale set instance ids will result in the - /// operation being performed on all virtual machines in the virtual - /// machine scale set. + /// Gets or sets the virtual machine scale set instance ids. Omitting the + /// virtual machine scale set instance ids will result in the operation being + /// performed on all virtual machines in the virtual machine scale set. /// - [JsonProperty(PropertyName = "instanceIds")] - public IList InstanceIds { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "instanceIds")] + public System.Collections.Generic.IList InstanceIds {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMInstanceRequiredIDs.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMInstanceRequiredIDs.cs index 061ad001a64e..caad8e7d486c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMInstanceRequiredIDs.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMInstanceRequiredIDs.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetVMInstanceRequiredIDs { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMInstanceRequiredIDs class. + /// Initializes a new instance of the VirtualMachineScaleSetVMInstanceRequiredIDs class. /// public VirtualMachineScaleSetVMInstanceRequiredIDs() { @@ -31,14 +21,15 @@ public VirtualMachineScaleSetVMInstanceRequiredIDs() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMInstanceRequiredIDs class. + /// Initializes a new instance of the VirtualMachineScaleSetVMInstanceRequiredIDs class. /// - /// The virtual machine scale set instance - /// ids. - public VirtualMachineScaleSetVMInstanceRequiredIDs(IList instanceIds) + + /// The virtual machine scale set instance ids. + /// + public VirtualMachineScaleSetVMInstanceRequiredIDs(System.Collections.Generic.IList instanceIds) + { - InstanceIds = instanceIds; + this.InstanceIds = instanceIds; CustomInit(); } @@ -47,24 +38,25 @@ public VirtualMachineScaleSetVMInstanceRequiredIDs(IList instanceIds) /// partial void CustomInit(); + /// /// Gets or sets the virtual machine scale set instance ids. /// - [JsonProperty(PropertyName = "instanceIds")] - public IList InstanceIds { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "instanceIds")] + public System.Collections.Generic.IList InstanceIds {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (InstanceIds == null) + if (this.InstanceIds == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "InstanceIds"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "InstanceIds"); } + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMInstanceView.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMInstanceView.cs index 0a0d04711bc1..92b25e9014d8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMInstanceView.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMInstanceView.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetVMInstanceView { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMInstanceView class. + /// Initializes a new instance of the VirtualMachineScaleSetVMInstanceView class. /// public VirtualMachineScaleSetVMInstanceView() { @@ -30,67 +21,87 @@ public VirtualMachineScaleSetVMInstanceView() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMInstanceView class. - /// - /// The Update Domain count. - /// The Fault Domain count. - /// The Remote desktop certificate - /// thumbprint. - /// The VM Agent running on the virtual - /// machine. - /// The Maintenance Operation - /// status on the virtual machine. - /// The disks information. - /// The extensions information. - /// The health status for the VM. - /// Boot Diagnostics is a debugging - /// feature which allows you to view Console Output and Screenshot to - /// diagnose VM status. You can easily view the output of your console - /// log. Azure also enables you to see a screenshot of the VM from the - /// hypervisor. - /// 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. 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. - /// 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]. Possible values include: 'V1', - /// 'V2' - public VirtualMachineScaleSetVMInstanceView(int? platformUpdateDomain = default(int?), int? platformFaultDomain = default(int?), string rdpThumbPrint = default(string), VirtualMachineAgentInstanceView vmAgent = default(VirtualMachineAgentInstanceView), MaintenanceRedeployStatus maintenanceRedeployStatus = default(MaintenanceRedeployStatus), IList disks = default(IList), IList extensions = default(IList), VirtualMachineHealthStatus vmHealth = default(VirtualMachineHealthStatus), BootDiagnosticsInstanceView bootDiagnostics = default(BootDiagnosticsInstanceView), IList statuses = default(IList), string assignedHost = default(string), string placementGroupId = default(string), string computerName = default(string), string osName = default(string), string osVersion = default(string), string hyperVGeneration = default(string)) + /// Initializes a new instance of the VirtualMachineScaleSetVMInstanceView class. + /// + + /// The Update Domain count. + /// + + /// The Fault Domain count. + /// + + /// The Remote desktop certificate thumbprint. + /// + + /// The VM Agent running on the virtual machine. + /// + + /// The Maintenance Operation status on the virtual machine. + /// + + /// The disks information. + /// + + /// The extensions information. + /// + + /// The health status for the VM. + /// + + /// Boot Diagnostics is a debugging feature which allows you to view Console + /// Output and Screenshot to diagnose VM status. You can easily view the output + /// of your console log. Azure also enables you to see a screenshot of the VM + /// from the hypervisor. + /// + + /// 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. 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. + /// + + /// 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] + /// Possible values include: 'V1', 'V2' + public VirtualMachineScaleSetVMInstanceView(int? platformUpdateDomain = default(int?), int? platformFaultDomain = default(int?), string rdpThumbPrint = default(string), VirtualMachineAgentInstanceView vmAgent = default(VirtualMachineAgentInstanceView), MaintenanceRedeployStatus maintenanceRedeployStatus = default(MaintenanceRedeployStatus), System.Collections.Generic.IList disks = default(System.Collections.Generic.IList), System.Collections.Generic.IList extensions = default(System.Collections.Generic.IList), VirtualMachineHealthStatus vmHealth = default(VirtualMachineHealthStatus), BootDiagnosticsInstanceView bootDiagnostics = default(BootDiagnosticsInstanceView), System.Collections.Generic.IList statuses = default(System.Collections.Generic.IList), string assignedHost = default(string), string placementGroupId = default(string), string computerName = default(string), string osName = default(string), string osVersion = default(string), string hyperVGeneration = default(string)) + { - PlatformUpdateDomain = platformUpdateDomain; - PlatformFaultDomain = platformFaultDomain; - RdpThumbPrint = rdpThumbPrint; - VmAgent = vmAgent; - MaintenanceRedeployStatus = maintenanceRedeployStatus; - Disks = disks; - Extensions = extensions; - VmHealth = vmHealth; - BootDiagnostics = bootDiagnostics; - Statuses = statuses; - AssignedHost = assignedHost; - PlacementGroupId = placementGroupId; - ComputerName = computerName; - OsName = osName; - OsVersion = osVersion; - HyperVGeneration = hyperVGeneration; + this.PlatformUpdateDomain = platformUpdateDomain; + this.PlatformFaultDomain = platformFaultDomain; + this.RdpThumbPrint = rdpThumbPrint; + this.VmAgent = vmAgent; + this.MaintenanceRedeployStatus = maintenanceRedeployStatus; + this.Disks = disks; + this.Extensions = extensions; + this.VmHealth = vmHealth; + this.BootDiagnostics = bootDiagnostics; + this.Statuses = statuses; + this.AssignedHost = assignedHost; + this.PlacementGroupId = placementGroupId; + this.ComputerName = computerName; + this.OsName = osName; + this.OsVersion = osVersion; + this.HyperVGeneration = hyperVGeneration; CustomInit(); } @@ -99,119 +110,113 @@ public VirtualMachineScaleSetVMInstanceView() /// partial void CustomInit(); + /// /// Gets or sets the Update Domain count. /// - [JsonProperty(PropertyName = "platformUpdateDomain")] - public int? PlatformUpdateDomain { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "platformUpdateDomain")] + public int? PlatformUpdateDomain {get; set; } /// /// Gets or sets the Fault Domain count. /// - [JsonProperty(PropertyName = "platformFaultDomain")] - public int? PlatformFaultDomain { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "platformFaultDomain")] + public int? PlatformFaultDomain {get; set; } /// /// Gets or sets the Remote desktop certificate thumbprint. /// - [JsonProperty(PropertyName = "rdpThumbPrint")] - public string RdpThumbPrint { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "rdpThumbPrint")] + public string RdpThumbPrint {get; set; } /// /// Gets or sets the VM Agent running on the virtual machine. /// - [JsonProperty(PropertyName = "vmAgent")] - public VirtualMachineAgentInstanceView VmAgent { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vmAgent")] + public VirtualMachineAgentInstanceView VmAgent {get; set; } /// - /// Gets or sets the Maintenance Operation status on the virtual - /// machine. + /// Gets or sets the Maintenance Operation status on the virtual machine. /// - [JsonProperty(PropertyName = "maintenanceRedeployStatus")] - public MaintenanceRedeployStatus MaintenanceRedeployStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maintenanceRedeployStatus")] + public MaintenanceRedeployStatus MaintenanceRedeployStatus {get; set; } /// /// Gets or sets the disks information. /// - [JsonProperty(PropertyName = "disks")] - public IList Disks { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "disks")] + public System.Collections.Generic.IList Disks {get; set; } /// /// Gets or sets the extensions information. /// - [JsonProperty(PropertyName = "extensions")] - public IList Extensions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extensions")] + public System.Collections.Generic.IList Extensions {get; set; } /// /// Gets the health status for the VM. /// - [JsonProperty(PropertyName = "vmHealth")] - public VirtualMachineHealthStatus VmHealth { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "vmHealth")] + public VirtualMachineHealthStatus VmHealth {get; private set; } /// - /// Gets or sets boot Diagnostics is a debugging feature which allows - /// you to view Console Output and Screenshot to diagnose VM status. - /// You can easily view the output of your console log. Azure also - /// enables you to see a screenshot of the VM from the hypervisor. + /// Gets or sets boot Diagnostics is a debugging feature which allows you to + /// view Console Output and Screenshot to diagnose VM status. You can easily + /// view the output of your console log. Azure also enables you to see a + /// screenshot of the VM from the hypervisor. /// - [JsonProperty(PropertyName = "bootDiagnostics")] - public BootDiagnosticsInstanceView BootDiagnostics { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "bootDiagnostics")] + public BootDiagnosticsInstanceView BootDiagnostics {get; set; } /// /// Gets or sets the resource status information. /// - [JsonProperty(PropertyName = "statuses")] - public IList Statuses { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "statuses")] + public System.Collections.Generic.IList Statuses {get; set; } /// - /// Gets 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. Minimum api-version: 2020-06-01. + /// Gets 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. Minimum api-version: 2020-06-01. /// - [JsonProperty(PropertyName = "assignedHost")] - public string AssignedHost { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "assignedHost")] + public string AssignedHost {get; private set; } /// - /// Gets or sets the placement group in which the VM is running. If the - /// VM is deallocated it will not have a placementGroupId. + /// Gets or sets the placement group in which the VM is running. If the VM is + /// deallocated it will not have a placementGroupId. /// - [JsonProperty(PropertyName = "placementGroupId")] - public string PlacementGroupId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "placementGroupId")] + public string PlacementGroupId {get; set; } /// - /// Gets or sets specifies the host OS name of the virtual machine. - /// &lt;br&gt;&lt;br&gt; This name cannot be updated - /// after the VM is created. &lt;br&gt;&lt;br&gt; - /// **Max-length (Windows):** 15 characters - /// &lt;br&gt;&lt;br&gt; **Max-length (Linux):** 64 - /// characters. &lt;br&gt;&lt;br&gt; For naming - /// conventions and restrictions see [Azure infrastructure services - /// implementation + /// Gets or sets 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). /// - [JsonProperty(PropertyName = "computerName")] - public string ComputerName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "computerName")] + public string ComputerName {get; set; } /// /// Gets or sets the Operating System running on the hybrid machine. /// - [JsonProperty(PropertyName = "osName")] - public string OsName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osName")] + public string OsName {get; set; } /// - /// Gets or sets the version of Operating System running on the hybrid - /// machine. + /// Gets or sets the version of Operating System running on the hybrid machine. /// - [JsonProperty(PropertyName = "osVersion")] - public string OsVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osVersion")] + public string OsVersion {get; set; } /// - /// Gets or sets the hypervisor generation of the Virtual Machine [V1, - /// V2]. Possible values include: 'V1', 'V2' + /// Gets or sets the hypervisor generation of the Virtual Machine [V1, V2] Possible values include: 'V1', 'V2' /// - [JsonProperty(PropertyName = "hyperVGeneration")] - public string HyperVGeneration { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "hyperVGeneration")] + public string HyperVGeneration {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMNetworkProfileConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMNetworkProfileConfiguration.cs index f8e141cdd2b9..1cd4132b833b 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMNetworkProfileConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMNetworkProfileConfiguration.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetVMNetworkProfileConfiguration { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMNetworkProfileConfiguration class. + /// Initializes a new instance of the VirtualMachineScaleSetVMNetworkProfileConfiguration class. /// public VirtualMachineScaleSetVMNetworkProfileConfiguration() { @@ -30,14 +21,15 @@ public VirtualMachineScaleSetVMNetworkProfileConfiguration() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMNetworkProfileConfiguration class. + /// Initializes a new instance of the VirtualMachineScaleSetVMNetworkProfileConfiguration class. /// - /// The list of network - /// configurations. - public VirtualMachineScaleSetVMNetworkProfileConfiguration(IList networkInterfaceConfigurations = default(IList)) + + /// The list of network configurations. + /// + public VirtualMachineScaleSetVMNetworkProfileConfiguration(System.Collections.Generic.IList networkInterfaceConfigurations = default(System.Collections.Generic.IList)) + { - NetworkInterfaceConfigurations = networkInterfaceConfigurations; + this.NetworkInterfaceConfigurations = networkInterfaceConfigurations; CustomInit(); } @@ -46,11 +38,11 @@ public VirtualMachineScaleSetVMNetworkProfileConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the list of network configurations. /// - [JsonProperty(PropertyName = "networkInterfaceConfigurations")] - public IList NetworkInterfaceConfigurations { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "networkInterfaceConfigurations")] + public System.Collections.Generic.IList NetworkInterfaceConfigurations {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMProfile.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMProfile.cs index c6301f1492df..d041e0b19809 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMProfile.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMProfile.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetVMProfile { /// - /// Initializes a new instance of the VirtualMachineScaleSetVMProfile - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetVMProfile class. /// public VirtualMachineScaleSetVMProfile() { @@ -28,92 +21,114 @@ public VirtualMachineScaleSetVMProfile() } /// - /// Initializes a new instance of the VirtualMachineScaleSetVMProfile - /// class. + /// Initializes a new instance of the VirtualMachineScaleSetVMProfile class. /// - /// Specifies the operating system settings for - /// the virtual machines in the scale set. - /// Specifies the storage settings for the - /// virtual machine disks. - /// Specifies properties of the network - /// interfaces of the virtual machines in the scale set. - /// Specifies the Security related - /// profile settings for the virtual machines in the scale set. - /// Specifies the boot diagnostic - /// settings state. Minimum api-version: 2015-06-15. - /// Specifies a collection of settings - /// for extensions installed on virtual machines in the scale - /// set. - /// Specifies that the image or disk that is - /// being used was licensed on-premises. <br><br> Possible - /// values for Windows Server operating system are: - /// <br><br> Windows_Client <br><br> - /// Windows_Server <br><br> Possible values for Linux - /// Server operating system are: <br><br> RHEL_BYOS (for - /// RHEL) <br><br> SLES_BYOS (for SUSE) - /// <br><br> For more information, see [Azure Hybrid Use - /// Benefit for Windows + + /// Specifies the operating system settings for the virtual machines in the + /// scale set. + /// + + /// Specifies the storage settings for the virtual machine disks. + /// + + /// Specifies properties of the network interfaces of the virtual machines in + /// the scale set. + /// + + /// Specifies the Security related profile settings for the virtual machines in + /// the scale set. + /// + + /// Specifies the boot diagnostic settings state. Minimum api-version: + /// 2015-06-15. + /// + + /// Specifies a collection of settings for extensions installed on virtual + /// machines in the scale set. + /// + + /// Specifies that the image or disk that is being used was licensed + /// on-premises. <br><br> Possible values for Windows Server operating system + /// are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible + /// values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) + /// <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure + /// Hybrid Use Benefit for Windows /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) /// <br><br> [Azure Hybrid Use Benefit for Linux /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) - /// <br><br> Minimum api-version: 2015-06-15 - /// Specifies the priority for the virtual - /// machines in the scale set. Minimum api-version: 2017-10-30-preview. - /// Possible values include: 'Regular', 'Low', 'Spot' - /// Specifies the eviction policy for the - /// Azure Spot virtual machine and Azure Spot scale set. For Azure Spot - /// virtual machines, both 'Deallocate' and 'Delete' are supported and - /// the minimum api-version is 2019-03-01. For Azure Spot scale sets, - /// both 'Deallocate' and 'Delete' are supported and the minimum - /// api-version is 2017-10-30-preview. Possible values include: - /// 'Deallocate', 'Delete' - /// Specifies the billing related details - /// of a Azure Spot VMSS. Minimum api-version: 2019-03-01. - /// Specifies Scheduled Event - /// related configurations. - /// UserData for the virtual machines in the - /// scale set, which must be base-64 encoded. Customer should not pass - /// any secrets in here. Minimum api-version: 2021-03-01. - /// Specifies the capacity - /// reservation related details of a scale set. Minimum api-version: - /// 2021-04-01. - /// Specifies the gallery applications - /// that should be made available to the VM/VMSS - /// Specifies the hardware profile - /// related details of a scale set. Minimum api-version: - /// 2021-11-01. - /// Specifies the service - /// artifact reference id used to set same image version for all - /// virtual machines in the scale set when using 'latest' image - /// version. Minimum api-version: 2022-11-01 - /// Specifies the security - /// posture to be used in the scale set. Minimum api-version: - /// 2023-03-01 - /// Specifies the time in which this VM - /// profile for the Virtual Machine Scale Set was created. This value - /// will be added to VMSS Flex VM tags when creating/updating the VMSS - /// VM Profile. Minimum API version for this property is - /// 2023-09-01. + /// <br><br> Minimum api-version: 2015-06-15 + /// + + /// Specifies the priority for the virtual machines in the scale set. Minimum + /// api-version: 2017-10-30-preview. + /// Possible values include: 'Regular', 'Low', 'Spot' + + /// Specifies the eviction policy for the Azure Spot virtual machine and Azure + /// Spot scale set. For Azure Spot virtual machines, both 'Deallocate' and + /// 'Delete' are supported and the minimum api-version is 2019-03-01. For Azure + /// Spot scale sets, both 'Deallocate' and 'Delete' are supported and the + /// minimum api-version is 2017-10-30-preview. + /// Possible values include: 'Deallocate', 'Delete' + + /// Specifies the billing related details of a Azure Spot VMSS. Minimum + /// api-version: 2019-03-01. + /// + + /// Specifies Scheduled Event related configurations. + /// + + /// UserData for the virtual machines in the scale set, which must be base-64 + /// encoded. Customer should not pass any secrets in here. Minimum api-version: + /// 2021-03-01. + /// + + /// Specifies the capacity reservation related details of a scale set. Minimum + /// api-version: 2021-04-01. + /// + + /// Specifies the gallery applications that should be made available to the + /// VM/VMSS + /// + + /// Specifies the hardware profile related details of a scale set. Minimum + /// api-version: 2021-11-01. + /// + + /// Specifies the service artifact reference id used to set same image version + /// for all virtual machines in the scale set when using 'latest' image + /// version. Minimum api-version: 2022-11-01 + /// + + /// Specifies the security posture to be used in the scale set. Minimum + /// api-version: 2023-03-01 + /// + + /// Specifies the time in which this VM profile for the Virtual Machine Scale + /// Set was created. This value will be added to VMSS Flex VM tags when + /// creating/updating the VMSS VM Profile. Minimum API version for this + /// property is 2023-09-01. + /// public VirtualMachineScaleSetVMProfile(VirtualMachineScaleSetOSProfile osProfile = default(VirtualMachineScaleSetOSProfile), VirtualMachineScaleSetStorageProfile storageProfile = default(VirtualMachineScaleSetStorageProfile), VirtualMachineScaleSetNetworkProfile networkProfile = default(VirtualMachineScaleSetNetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), VirtualMachineScaleSetExtensionProfile extensionProfile = default(VirtualMachineScaleSetExtensionProfile), string licenseType = default(string), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), ScheduledEventsProfile scheduledEventsProfile = default(ScheduledEventsProfile), string userData = default(string), CapacityReservationProfile capacityReservation = default(CapacityReservationProfile), ApplicationProfile applicationProfile = default(ApplicationProfile), VirtualMachineScaleSetHardwareProfile hardwareProfile = default(VirtualMachineScaleSetHardwareProfile), ServiceArtifactReference serviceArtifactReference = default(ServiceArtifactReference), SecurityPostureReference securityPostureReference = default(SecurityPostureReference), System.DateTime? timeCreated = default(System.DateTime?)) + { - OsProfile = osProfile; - StorageProfile = storageProfile; - NetworkProfile = networkProfile; - SecurityProfile = securityProfile; - DiagnosticsProfile = diagnosticsProfile; - ExtensionProfile = extensionProfile; - LicenseType = licenseType; - Priority = priority; - EvictionPolicy = evictionPolicy; - BillingProfile = billingProfile; - ScheduledEventsProfile = scheduledEventsProfile; - UserData = userData; - CapacityReservation = capacityReservation; - ApplicationProfile = applicationProfile; - HardwareProfile = hardwareProfile; - ServiceArtifactReference = serviceArtifactReference; - SecurityPostureReference = securityPostureReference; - TimeCreated = timeCreated; + this.OsProfile = osProfile; + this.StorageProfile = storageProfile; + this.NetworkProfile = networkProfile; + this.SecurityProfile = securityProfile; + this.DiagnosticsProfile = diagnosticsProfile; + this.ExtensionProfile = extensionProfile; + this.LicenseType = licenseType; + this.Priority = priority; + this.EvictionPolicy = evictionPolicy; + this.BillingProfile = billingProfile; + this.ScheduledEventsProfile = scheduledEventsProfile; + this.UserData = userData; + this.CapacityReservation = capacityReservation; + this.ApplicationProfile = applicationProfile; + this.HardwareProfile = hardwareProfile; + this.ServiceArtifactReference = serviceArtifactReference; + this.SecurityPostureReference = securityPostureReference; + this.TimeCreated = timeCreated; CustomInit(); } @@ -122,171 +137,176 @@ public VirtualMachineScaleSetVMProfile() /// partial void CustomInit(); + /// - /// Gets or sets specifies the operating system settings for the - /// virtual machines in the scale set. + /// Gets or sets specifies the operating system settings for the virtual + /// machines in the scale set. /// - [JsonProperty(PropertyName = "osProfile")] - public VirtualMachineScaleSetOSProfile OsProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osProfile")] + public VirtualMachineScaleSetOSProfile OsProfile {get; set; } /// - /// Gets or sets specifies the storage settings for the virtual machine - /// disks. + /// Gets or sets specifies the storage settings for the virtual machine disks. /// - [JsonProperty(PropertyName = "storageProfile")] - public VirtualMachineScaleSetStorageProfile StorageProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "storageProfile")] + public VirtualMachineScaleSetStorageProfile StorageProfile {get; set; } /// - /// Gets or sets specifies properties of the network interfaces of the - /// virtual machines in the scale set. + /// Gets or sets specifies properties of the network interfaces of the virtual + /// machines in the scale set. /// - [JsonProperty(PropertyName = "networkProfile")] - public VirtualMachineScaleSetNetworkProfile NetworkProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "networkProfile")] + public VirtualMachineScaleSetNetworkProfile NetworkProfile {get; set; } /// - /// Gets or sets specifies the Security related profile settings for - /// the virtual machines in the scale set. + /// Gets or sets specifies the Security related profile settings for the + /// virtual machines in the scale set. /// - [JsonProperty(PropertyName = "securityProfile")] - public SecurityProfile SecurityProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "securityProfile")] + public SecurityProfile SecurityProfile {get; set; } /// /// Gets or sets specifies the boot diagnostic settings state. Minimum /// api-version: 2015-06-15. /// - [JsonProperty(PropertyName = "diagnosticsProfile")] - public DiagnosticsProfile DiagnosticsProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "diagnosticsProfile")] + public DiagnosticsProfile DiagnosticsProfile {get; set; } /// - /// Gets or sets specifies a collection of settings for extensions - /// installed on virtual machines in the scale set. + /// Gets or sets specifies a collection of settings for extensions installed on + /// virtual machines in the scale set. /// - [JsonProperty(PropertyName = "extensionProfile")] - public VirtualMachineScaleSetExtensionProfile ExtensionProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "extensionProfile")] + public VirtualMachineScaleSetExtensionProfile ExtensionProfile {get; set; } /// - /// Gets or sets specifies that the image or disk that is being used - /// was licensed on-premises. &lt;br&gt;&lt;br&gt; - /// Possible values for Windows Server operating system are: - /// &lt;br&gt;&lt;br&gt; Windows_Client - /// &lt;br&gt;&lt;br&gt; Windows_Server - /// &lt;br&gt;&lt;br&gt; Possible values for Linux - /// Server operating system are: &lt;br&gt;&lt;br&gt; - /// RHEL_BYOS (for RHEL) &lt;br&gt;&lt;br&gt; SLES_BYOS - /// (for SUSE) &lt;br&gt;&lt;br&gt; For more - /// information, see [Azure Hybrid Use Benefit for Windows + /// Gets or sets specifies that the image or disk that is being used was + /// licensed on-premises. <br><br> Possible values for Windows Server operating + /// system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> + /// Possible values for Linux Server operating system are: <br><br> RHEL_BYOS + /// (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see + /// [Azure Hybrid Use Benefit for Windows /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - /// &lt;br&gt;&lt;br&gt; [Azure Hybrid Use Benefit for - /// Linux + /// <br><br> [Azure Hybrid Use Benefit for Linux /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) - /// &lt;br&gt;&lt;br&gt; Minimum api-version: - /// 2015-06-15 + /// <br><br> Minimum api-version: 2015-06-15 /// - [JsonProperty(PropertyName = "licenseType")] - public string LicenseType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "licenseType")] + public string LicenseType {get; set; } /// - /// Gets or sets specifies the priority for the virtual machines in the - /// scale set. Minimum api-version: 2017-10-30-preview. Possible values - /// include: 'Regular', 'Low', 'Spot' + /// Gets or sets specifies the priority for the virtual machines in the scale + /// set. Minimum api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low', 'Spot' /// - [JsonProperty(PropertyName = "priority")] - public string Priority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "priority")] + public string Priority {get; set; } /// - /// Gets or sets specifies the eviction policy for the Azure Spot - /// virtual machine and Azure Spot scale set. For Azure Spot virtual - /// machines, both 'Deallocate' and 'Delete' are supported and the - /// minimum api-version is 2019-03-01. For Azure Spot scale sets, both - /// 'Deallocate' and 'Delete' are supported and the minimum api-version - /// is 2017-10-30-preview. Possible values include: 'Deallocate', - /// 'Delete' + /// Gets or sets specifies the eviction policy for the Azure Spot virtual + /// machine and Azure Spot scale set. For Azure Spot virtual machines, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version is + /// 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are + /// supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' /// - [JsonProperty(PropertyName = "evictionPolicy")] - public string EvictionPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "evictionPolicy")] + public string EvictionPolicy {get; set; } /// - /// Gets or sets specifies the billing related details of a Azure Spot - /// VMSS. Minimum api-version: 2019-03-01. + /// Gets or sets specifies the billing related details of a Azure Spot VMSS. + /// Minimum api-version: 2019-03-01. /// - [JsonProperty(PropertyName = "billingProfile")] - public BillingProfile BillingProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "billingProfile")] + public BillingProfile BillingProfile {get; set; } /// /// Gets or sets specifies Scheduled Event related configurations. /// - [JsonProperty(PropertyName = "scheduledEventsProfile")] - public ScheduledEventsProfile ScheduledEventsProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "scheduledEventsProfile")] + public ScheduledEventsProfile ScheduledEventsProfile {get; set; } /// - /// Gets or sets userData for the virtual machines in the scale set, - /// which must be base-64 encoded. Customer should not pass any secrets - /// in here. Minimum api-version: 2021-03-01. + /// Gets or sets userData for the virtual machines in the scale set, which must + /// be base-64 encoded. Customer should not pass any secrets in here. Minimum + /// api-version: 2021-03-01. /// - [JsonProperty(PropertyName = "userData")] - public string UserData { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "userData")] + public string UserData {get; set; } /// - /// Gets or sets specifies the capacity reservation related details of - /// a scale set. Minimum api-version: 2021-04-01. + /// Gets or sets specifies the capacity reservation related details of a scale + /// set. Minimum api-version: 2021-04-01. /// - [JsonProperty(PropertyName = "capacityReservation")] - public CapacityReservationProfile CapacityReservation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "capacityReservation")] + public CapacityReservationProfile CapacityReservation {get; set; } /// /// Gets or sets specifies the gallery applications that should be made /// available to the VM/VMSS /// - [JsonProperty(PropertyName = "applicationProfile")] - public ApplicationProfile ApplicationProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "applicationProfile")] + public ApplicationProfile ApplicationProfile {get; set; } /// - /// Gets or sets specifies the hardware profile related details of a - /// scale set. Minimum api-version: 2021-11-01. + /// Gets or sets specifies the hardware profile related details of a scale set. + /// Minimum api-version: 2021-11-01. /// - [JsonProperty(PropertyName = "hardwareProfile")] - public VirtualMachineScaleSetHardwareProfile HardwareProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "hardwareProfile")] + public VirtualMachineScaleSetHardwareProfile HardwareProfile {get; set; } /// - /// Gets or sets specifies the service artifact reference id used to - /// set same image version for all virtual machines in the scale set - /// when using 'latest' image version. Minimum api-version: 2022-11-01 + /// Gets or sets specifies the service artifact reference id used to set same + /// image version for all virtual machines in the scale set when using 'latest' + /// image version. Minimum api-version: 2022-11-01 /// - [JsonProperty(PropertyName = "serviceArtifactReference")] - public ServiceArtifactReference ServiceArtifactReference { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceArtifactReference")] + public ServiceArtifactReference ServiceArtifactReference {get; set; } /// - /// Gets or sets specifies the security posture to be used in the scale - /// set. Minimum api-version: 2023-03-01 + /// Gets or sets specifies the security posture to be used in the scale set. + /// Minimum api-version: 2023-03-01 /// - [JsonProperty(PropertyName = "securityPostureReference")] - public SecurityPostureReference SecurityPostureReference { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "securityPostureReference")] + public SecurityPostureReference SecurityPostureReference {get; set; } /// - /// Gets specifies the time in which this VM profile for the Virtual - /// Machine Scale Set was created. This value will be added to VMSS - /// Flex VM tags when creating/updating the VMSS VM Profile. Minimum - /// API version for this property is 2023-09-01. + /// Gets specifies the time in which this VM profile for the Virtual Machine + /// Scale Set was created. This value will be added to VMSS Flex VM tags when + /// creating/updating the VMSS VM Profile. Minimum API version for this + /// property is 2023-09-01. /// - [JsonProperty(PropertyName = "timeCreated")] - public System.DateTime? TimeCreated { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "timeCreated")] + public System.DateTime? TimeCreated {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (StorageProfile != null) + + if (this.StorageProfile != null) { - StorageProfile.Validate(); + this.StorageProfile.Validate(); } - if (SecurityPostureReference != null) + + + + + + + + + + + + + + + if (this.SecurityPostureReference != null) { - SecurityPostureReference.Validate(); + this.SecurityPostureReference.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMProperties.cs new file mode 100644 index 000000000000..7f2df4ad2bb9 --- /dev/null +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMProperties.cs @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Compute.Models +{ + using System.Linq; + + /// + /// Describes the properties of a virtual machine scale set virtual machine. + /// + public partial class VirtualMachineScaleSetVMProperties + { + /// + /// Initializes a new instance of the VirtualMachineScaleSetVMProperties class. + /// + public VirtualMachineScaleSetVMProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineScaleSetVMProperties class. + /// + + /// Specifies whether the latest model has been applied to the virtual machine. + /// + + /// Azure VM unique ID. + /// + + /// The virtual machine instance view. + /// + + /// Specifies the hardware settings for the virtual machine. + /// + + /// Specifies the resilient VM deletion status for the virtual machine. + /// Possible values include: 'Enabled', 'Disabled', 'InProgress', 'Failed' + + /// Specifies the storage settings for the virtual machine disks. + /// + + /// Specifies additional capabilities enabled or disabled on the virtual + /// machine in the scale set. For instance: whether the virtual machine has the + /// capability to support attaching managed data disks with UltraSSD_LRS + /// storage account type. + /// + + /// Specifies the operating system settings for the virtual machine. + /// + + /// Specifies the Security related profile settings for the virtual machine. + /// + + /// Specifies the network interfaces of the virtual machine. + /// + + /// Specifies the network profile configuration of the virtual machine. + /// + + /// Specifies the boot diagnostic settings state. Minimum api-version: + /// 2015-06-15. + /// + + /// Specifies information about the availability set that the virtual machine + /// should be assigned to. Virtual machines specified in the same availability + /// set are allocated to different nodes to maximize availability. For more + /// information about availability sets, see [Availability sets + /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + /// For more information on Azure planned maintenance, see [Maintenance and + /// updates for Virtual Machines in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). + /// Currently, a VM can only be added to availability set at creation time. An + /// existing VM cannot be added to an availability set. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// Specifies that the image or disk that is being used was licensed + /// on-premises. <br><br> Possible values for Windows Server operating system + /// are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible + /// values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) + /// <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure + /// Hybrid Use Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// + + /// Specifies whether the model applied to the virtual machine is the model of + /// the virtual machine scale set or the customized model for the virtual + /// machine. + /// + + /// Specifies the protection policy of the virtual machine. + /// + + /// UserData for the VM, which must be base-64 encoded. Customer should not + /// pass any secrets in here. Minimum api-version: 2021-03-01 + /// + + /// Specifies the time at which the Virtual Machine resource was created. + /// Minimum api-version: 2021-11-01. + /// + public VirtualMachineScaleSetVMProperties(bool? latestModelApplied = default(bool?), string vmId = default(string), VirtualMachineScaleSetVMInstanceView instanceView = default(VirtualMachineScaleSetVMInstanceView), HardwareProfile hardwareProfile = default(HardwareProfile), string resilientVMDeletionStatus = default(string), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), SecurityProfile securityProfile = default(SecurityProfile), NetworkProfile networkProfile = default(NetworkProfile), VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration = default(VirtualMachineScaleSetVMNetworkProfileConfiguration), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), string provisioningState = default(string), string licenseType = default(string), string modelDefinitionApplied = default(string), VirtualMachineScaleSetVMProtectionPolicy protectionPolicy = default(VirtualMachineScaleSetVMProtectionPolicy), string userData = default(string), System.DateTime? timeCreated = default(System.DateTime?)) + + { + this.LatestModelApplied = latestModelApplied; + this.VmId = vmId; + this.InstanceView = instanceView; + this.HardwareProfile = hardwareProfile; + this.ResilientVMDeletionStatus = resilientVMDeletionStatus; + this.StorageProfile = storageProfile; + this.AdditionalCapabilities = additionalCapabilities; + this.OsProfile = osProfile; + this.SecurityProfile = securityProfile; + this.NetworkProfile = networkProfile; + this.NetworkProfileConfiguration = networkProfileConfiguration; + this.DiagnosticsProfile = diagnosticsProfile; + this.AvailabilitySet = availabilitySet; + this.ProvisioningState = provisioningState; + this.LicenseType = licenseType; + this.ModelDefinitionApplied = modelDefinitionApplied; + this.ProtectionPolicy = protectionPolicy; + this.UserData = userData; + this.TimeCreated = timeCreated; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets specifies whether the latest model has been applied to the virtual + /// machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "latestModelApplied")] + public bool? LatestModelApplied {get; private set; } + + /// + /// Gets azure VM unique ID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "vmId")] + public string VmId {get; private set; } + + /// + /// Gets the virtual machine instance view. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "instanceView")] + public VirtualMachineScaleSetVMInstanceView InstanceView {get; private set; } + + /// + /// Gets or sets specifies the hardware settings for the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hardwareProfile")] + public HardwareProfile HardwareProfile {get; set; } + + /// + /// Gets or sets specifies the resilient VM deletion status for the virtual + /// machine. Possible values include: 'Enabled', 'Disabled', 'InProgress', 'Failed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resilientVMDeletionStatus")] + public string ResilientVMDeletionStatus {get; set; } + + /// + /// Gets or sets specifies the storage settings for the virtual machine disks. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageProfile")] + public StorageProfile StorageProfile {get; set; } + + /// + /// Gets or sets specifies additional capabilities enabled or disabled on the + /// virtual machine in the scale set. For instance: whether the virtual machine + /// has the capability to support attaching managed data disks with + /// UltraSSD_LRS storage account type. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalCapabilities")] + public AdditionalCapabilities AdditionalCapabilities {get; set; } + + /// + /// Gets or sets specifies the operating system settings for the virtual + /// machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "osProfile")] + public OSProfile OsProfile {get; set; } + + /// + /// Gets or sets specifies the Security related profile settings for the + /// virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "securityProfile")] + public SecurityProfile SecurityProfile {get; set; } + + /// + /// Gets or sets specifies the network interfaces of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkProfile")] + public NetworkProfile NetworkProfile {get; set; } + + /// + /// Gets or sets specifies the network profile configuration of the virtual + /// machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkProfileConfiguration")] + public VirtualMachineScaleSetVMNetworkProfileConfiguration NetworkProfileConfiguration {get; set; } + + /// + /// Gets or sets specifies the boot diagnostic settings state. Minimum + /// api-version: 2015-06-15. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diagnosticsProfile")] + public DiagnosticsProfile DiagnosticsProfile {get; set; } + + /// + /// Gets or sets specifies information about the availability set that the + /// virtual machine should be assigned to. Virtual machines specified in the + /// same availability set are allocated to different nodes to maximize + /// availability. For more information about availability sets, see + /// [Availability sets + /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + /// For more information on Azure planned maintenance, see [Maintenance and + /// updates for Virtual Machines in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). + /// Currently, a VM can only be added to availability set at creation time. An + /// existing VM cannot be added to an availability set. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "availabilitySet")] + public SubResource AvailabilitySet {get; set; } + + /// + /// Gets the provisioning state, which only appears in the response. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets specifies that the image or disk that is being used was + /// licensed on-premises. <br><br> Possible values for Windows Server operating + /// system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> + /// Possible values for Linux Server operating system are: <br><br> RHEL_BYOS + /// (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see + /// [Azure Hybrid Use Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "licenseType")] + public string LicenseType {get; set; } + + /// + /// Gets specifies whether the model applied to the virtual machine is the + /// model of the virtual machine scale set or the customized model for the + /// virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "modelDefinitionApplied")] + public string ModelDefinitionApplied {get; private set; } + + /// + /// Gets or sets specifies the protection policy of the virtual machine. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protectionPolicy")] + public VirtualMachineScaleSetVMProtectionPolicy ProtectionPolicy {get; set; } + + /// + /// Gets or sets userData for the VM, which must be base-64 encoded. Customer + /// should not pass any secrets in here. Minimum api-version: 2021-03-01 + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "userData")] + public string UserData {get; set; } + + /// + /// Gets specifies the time at which the Virtual Machine resource was created. + /// Minimum api-version: 2021-11-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeCreated")] + public System.DateTime? TimeCreated {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + if (this.StorageProfile != null) + { + this.StorageProfile.Validate(); + } + + + + + + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMProtectionPolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMProtectionPolicy.cs index 73637dcff1c8..4a04bc012669 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMProtectionPolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMProtectionPolicy.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetVMProtectionPolicy { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMProtectionPolicy class. + /// Initializes a new instance of the VirtualMachineScaleSetVMProtectionPolicy class. /// public VirtualMachineScaleSetVMProtectionPolicy() { @@ -28,20 +21,22 @@ public VirtualMachineScaleSetVMProtectionPolicy() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMProtectionPolicy class. + /// Initializes a new instance of the VirtualMachineScaleSetVMProtectionPolicy class. /// - /// Indicates that the virtual machine - /// scale set VM shouldn't be considered for deletion during a scale-in - /// operation. - /// Indicates that model - /// updates or actions (including scale-in) initiated on the virtual - /// machine scale set should not be applied to the virtual machine - /// scale set VM. + + /// Indicates that the virtual machine scale set VM shouldn't be considered for + /// deletion during a scale-in operation. + /// + + /// Indicates that model updates or actions (including scale-in) initiated on + /// the virtual machine scale set should not be applied to the virtual machine + /// scale set VM. + /// public VirtualMachineScaleSetVMProtectionPolicy(bool? protectFromScaleIn = default(bool?), bool? protectFromScaleSetActions = default(bool?)) + { - ProtectFromScaleIn = protectFromScaleIn; - ProtectFromScaleSetActions = protectFromScaleSetActions; + this.ProtectFromScaleIn = protectFromScaleIn; + this.ProtectFromScaleSetActions = protectFromScaleSetActions; CustomInit(); } @@ -50,20 +45,20 @@ public VirtualMachineScaleSetVMProtectionPolicy() /// partial void CustomInit(); + /// - /// Gets or sets indicates that the virtual machine scale set VM - /// shouldn't be considered for deletion during a scale-in operation. + /// Gets or sets indicates that the virtual machine scale set VM shouldn't be + /// considered for deletion during a scale-in operation. /// - [JsonProperty(PropertyName = "protectFromScaleIn")] - public bool? ProtectFromScaleIn { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protectFromScaleIn")] + public bool? ProtectFromScaleIn {get; set; } /// - /// Gets or sets indicates that model updates or actions (including - /// scale-in) initiated on the virtual machine scale set should not be - /// applied to the virtual machine scale set VM. + /// Gets or sets indicates that model updates or actions (including scale-in) + /// initiated on the virtual machine scale set should not be applied to the + /// virtual machine scale set VM. /// - [JsonProperty(PropertyName = "protectFromScaleSetActions")] - public bool? ProtectFromScaleSetActions { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "protectFromScaleSetActions")] + public bool? ProtectFromScaleSetActions {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMReimageParameters.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMReimageParameters.cs index bf9f25241137..465a74280680 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMReimageParameters.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMReimageParameters.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineScaleSetVMReimageParameters : VirtualMachineReimageParameters { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMReimageParameters class. + /// Initializes a new instance of the VirtualMachineScaleSetVMReimageParameters class. /// public VirtualMachineScaleSetVMReimageParameters() { @@ -28,24 +21,30 @@ public VirtualMachineScaleSetVMReimageParameters() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMReimageParameters class. + /// Initializes a new instance of the VirtualMachineScaleSetVMReimageParameters class. /// - /// Specifies whether to reimage temp disk. - /// Default value: false. Note: This temp disk reimage parameter is - /// only supported for VM/VMSS with Ephemeral OS disk. - /// Specifies in decimal number, the version - /// the OS disk should be reimaged to. If exact version is not - /// provided, the OS disk is reimaged to the existing version of OS - /// Disk. - /// Specifies information required for - /// reimaging the non-ephemeral OS disk. - /// Parameter to force - /// update ephemeral OS disk for a virtual machine scale set VM + + /// Specifies whether to reimage temp disk. Default value: false. Note: This + /// temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS + /// disk. + /// + + /// Specifies in decimal number, the version the OS disk should be reimaged to. + /// If exact version is not provided, the OS disk is reimaged to the existing + /// version of OS Disk. + /// + + /// Specifies information required for reimaging the non-ephemeral OS disk. + /// + + /// Parameter to force update ephemeral OS disk for a virtual machine scale set + /// VM + /// public VirtualMachineScaleSetVMReimageParameters(bool? tempDisk = default(bool?), string exactVersion = default(string), OSProfileProvisioningData osProfile = default(OSProfileProvisioningData), bool? forceUpdateOSDiskForEphemeral = default(bool?)) - : base(tempDisk, exactVersion, osProfile) + + : base(tempDisk, exactVersion, osProfile) { - ForceUpdateOSDiskForEphemeral = forceUpdateOSDiskForEphemeral; + this.ForceUpdateOSDiskForEphemeral = forceUpdateOSDiskForEphemeral; CustomInit(); } @@ -54,12 +53,12 @@ public VirtualMachineScaleSetVMReimageParameters() /// partial void CustomInit(); + /// - /// Gets or sets parameter to force update ephemeral OS disk for a - /// virtual machine scale set VM + /// Gets or sets parameter to force update ephemeral OS disk for a virtual + /// machine scale set VM /// - [JsonProperty(PropertyName = "forceUpdateOSDiskForEphemeral")] - public bool? ForceUpdateOSDiskForEphemeral { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "forceUpdateOSDiskForEphemeral")] + public bool? ForceUpdateOSDiskForEphemeral {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMRunCommandsCreateOrUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMRunCommandsCreateOrUpdateHeaders.cs index e8c756488d63..dfc7503c3dbb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMRunCommandsCreateOrUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMRunCommandsCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class VirtualMachineScaleSetVMRunCommandsCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMRunCommandsCreateOrUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetVMRunCommandsCreateOrUpdateHeaders class. /// public VirtualMachineScaleSetVMRunCommandsCreateOrUpdateHeaders() { @@ -28,18 +18,19 @@ public VirtualMachineScaleSetVMRunCommandsCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMRunCommandsCreateOrUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetVMRunCommandsCreateOrUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachineScaleSetVMRunCommandsCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachineScaleSetVMRunCommandsCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMRunCommandsUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMRunCommandsUpdateHeaders.cs index e09a4bfdffd9..4c95114c1a12 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMRunCommandsUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMRunCommandsUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Update operation. - /// public partial class VirtualMachineScaleSetVMRunCommandsUpdateHeaders { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMRunCommandsUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetVMRunCommandsUpdateHeaders class. /// public VirtualMachineScaleSetVMRunCommandsUpdateHeaders() { @@ -28,18 +18,19 @@ public VirtualMachineScaleSetVMRunCommandsUpdateHeaders() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMRunCommandsUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetVMRunCommandsUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachineScaleSetVMRunCommandsUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachineScaleSetVMRunCommandsUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders.cs index 0b4fb9f75511..fd5d36c3d858 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders.cs @@ -1,45 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for ApproveRollingUpgrade operation. - /// - public partial class VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders + public partial class VirtualMachineScaleSetVMSApproveRollingUpgradeHeaders { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetVMSApproveRollingUpgradeHeaders class. /// - public VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders() + public VirtualMachineScaleSetVMSApproveRollingUpgradeHeaders() { CustomInit(); } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetVMSApproveRollingUpgradeHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. - public VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders(string location = default(string), int? retryAfter = default(int?)) + + /// + /// + + /// + /// + public VirtualMachineScaleSetVMSApproveRollingUpgradeHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMsAttachDetachDataDisksHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMsAttachDetachDataDisksHeaders.cs index 9b7b3eb8ff1e..03db17f716c5 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMsAttachDetachDataDisksHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetVMsAttachDetachDataDisksHeaders.cs @@ -1,45 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for AttachDetachDataDisks operation. - /// - public partial class VirtualMachineScaleSetVMsAttachDetachDataDisksHeaders + public partial class VirtualMachineScaleSetVMSAttachDetachDataDisksHeaders { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMsAttachDetachDataDisksHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetVMSAttachDetachDataDisksHeaders class. /// - public VirtualMachineScaleSetVMsAttachDetachDataDisksHeaders() + public VirtualMachineScaleSetVMSAttachDetachDataDisksHeaders() { CustomInit(); } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetVMsAttachDetachDataDisksHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetVMSAttachDetachDataDisksHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. - public VirtualMachineScaleSetVMsAttachDetachDataDisksHeaders(string location = default(string), int? retryAfter = default(int?)) + + /// + /// + + /// + /// + public VirtualMachineScaleSetVMSAttachDetachDataDisksHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachineScaleSetVMsAttachDetachDataDisksHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsApproveRollingUpgradeHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsApproveRollingUpgradeHeaders.cs index 966db1c1b756..73b36cc0be81 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsApproveRollingUpgradeHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsApproveRollingUpgradeHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for ApproveRollingUpgrade operation. - /// public partial class VirtualMachineScaleSetsApproveRollingUpgradeHeaders { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetsApproveRollingUpgradeHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetsApproveRollingUpgradeHeaders class. /// public VirtualMachineScaleSetsApproveRollingUpgradeHeaders() { @@ -28,18 +18,19 @@ public VirtualMachineScaleSetsApproveRollingUpgradeHeaders() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetsApproveRollingUpgradeHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetsApproveRollingUpgradeHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachineScaleSetsApproveRollingUpgradeHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachineScaleSetsApproveRollingUpgradeHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsCreateOrUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsCreateOrUpdateHeaders.cs index 95267ef1c709..ccd3ed8a2d13 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsCreateOrUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class VirtualMachineScaleSetsCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetsCreateOrUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetsCreateOrUpdateHeaders class. /// public VirtualMachineScaleSetsCreateOrUpdateHeaders() { @@ -28,18 +18,19 @@ public VirtualMachineScaleSetsCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetsCreateOrUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetsCreateOrUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachineScaleSetsCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachineScaleSetsCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsReapplyHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsReapplyHeaders.cs index 4c6765904e48..79ba9a931c8c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsReapplyHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsReapplyHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Reapply operation. - /// public partial class VirtualMachineScaleSetsReapplyHeaders { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetsReapplyHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetsReapplyHeaders class. /// public VirtualMachineScaleSetsReapplyHeaders() { @@ -28,18 +18,19 @@ public VirtualMachineScaleSetsReapplyHeaders() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetsReapplyHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetsReapplyHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachineScaleSetsReapplyHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachineScaleSetsReapplyHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsScaleOutHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsScaleOutHeaders.cs index e528eee6b209..9deb2fc6cf91 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsScaleOutHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsScaleOutHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for ScaleOut operation. - /// public partial class VirtualMachineScaleSetsScaleOutHeaders { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetsScaleOutHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetsScaleOutHeaders class. /// public VirtualMachineScaleSetsScaleOutHeaders() { @@ -28,18 +18,19 @@ public VirtualMachineScaleSetsScaleOutHeaders() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetsScaleOutHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetsScaleOutHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachineScaleSetsScaleOutHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachineScaleSetsScaleOutHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsUpdateHeaders.cs index 80b685f88ed9..afdbf55ac7a9 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineScaleSetsUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Update operation. - /// public partial class VirtualMachineScaleSetsUpdateHeaders { /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetsUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetsUpdateHeaders class. /// public VirtualMachineScaleSetsUpdateHeaders() { @@ -28,18 +18,19 @@ public VirtualMachineScaleSetsUpdateHeaders() } /// - /// Initializes a new instance of the - /// VirtualMachineScaleSetsUpdateHeaders class. + /// Initializes a new instance of the VirtualMachineScaleSetsUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachineScaleSetsUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachineScaleSetsUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineSize.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineSize.cs index de774e455703..a12e4a4b47eb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineSize.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineSize.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,30 +23,38 @@ public VirtualMachineSize() /// /// Initializes a new instance of the VirtualMachineSize class. /// - /// The name of the virtual machine size. - /// The number of cores supported by the - /// virtual machine size. For Constrained vCPU capable VM sizes, this - /// number represents the total vCPUs of quota that the VM uses. For - /// accurate vCPU count, please refer to - /// https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu - /// or - /// https://docs.microsoft.com/rest/api/compute/resourceskus/list - /// The OS disk size, in MB, allowed by - /// the virtual machine size. - /// The resource disk size, in MB, - /// allowed by the virtual machine size. - /// The amount of memory, in MB, supported by - /// the virtual machine size. - /// The maximum number of data disks - /// that can be attached to the virtual machine size. - public VirtualMachineSize(string name = default(string), int? numberOfCores = default(int?), int? osDiskSizeInMB = default(int?), int? resourceDiskSizeInMB = default(int?), int? memoryInMB = default(int?), int? maxDataDiskCount = default(int?)) + + /// The name of the virtual machine size. + /// + + /// The number of cores supported by the virtual machine size. For Constrained + /// vCPU capable VM sizes, this number represents the total vCPUs of quota that + /// the VM uses. For accurate vCPU count, please refer to + /// https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or + /// https://docs.microsoft.com/rest/api/compute/resourceskus/list + /// + + /// The OS disk size, in MB, allowed by the virtual machine size. + /// + + /// The resource disk size, in MB, allowed by the virtual machine size. + /// + + /// The amount of memory, in MB, supported by the virtual machine size. + /// + + /// The maximum number of data disks that can be attached to the virtual + /// machine size. + /// + public VirtualMachineSize(string name = default(string), int? numberOfCores = default(int?), int? osDiskSizeInMb = default(int?), int? resourceDiskSizeInMb = default(int?), int? memoryInMb = default(int?), int? maxDataDiskCount = default(int?)) + { - Name = name; - NumberOfCores = numberOfCores; - OsDiskSizeInMB = osDiskSizeInMB; - ResourceDiskSizeInMB = resourceDiskSizeInMB; - MemoryInMB = memoryInMB; - MaxDataDiskCount = maxDataDiskCount; + this.Name = name; + this.NumberOfCores = numberOfCores; + this.OSDiskSizeInMb = osDiskSizeInMb; + this.ResourceDiskSizeInMb = resourceDiskSizeInMb; + this.MemoryInMb = memoryInMb; + this.MaxDataDiskCount = maxDataDiskCount; CustomInit(); } @@ -61,50 +63,48 @@ public VirtualMachineSize() /// partial void CustomInit(); + /// /// Gets or sets the name of the virtual machine size. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the number of cores supported by the virtual machine - /// size. For Constrained vCPU capable VM sizes, this number represents - /// the total vCPUs of quota that the VM uses. For accurate vCPU count, - /// please refer to - /// https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu - /// or https://docs.microsoft.com/rest/api/compute/resourceskus/list + /// Gets or sets the number of cores supported by the virtual machine size. For + /// Constrained vCPU capable VM sizes, this number represents the total vCPUs + /// of quota that the VM uses. For accurate vCPU count, please refer to + /// https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or + /// https://docs.microsoft.com/rest/api/compute/resourceskus/list /// - [JsonProperty(PropertyName = "numberOfCores")] - public int? NumberOfCores { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "numberOfCores")] + public int? NumberOfCores {get; set; } /// - /// Gets or sets the OS disk size, in MB, allowed by the virtual - /// machine size. + /// Gets or sets the OS disk size, in MB, allowed by the virtual machine size. /// - [JsonProperty(PropertyName = "osDiskSizeInMB")] - public int? OsDiskSizeInMB { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "osDiskSizeInMB")] + public int? OSDiskSizeInMb {get; set; } /// - /// Gets or sets the resource disk size, in MB, allowed by the virtual - /// machine size. + /// Gets or sets the resource disk size, in MB, allowed by the virtual machine + /// size. /// - [JsonProperty(PropertyName = "resourceDiskSizeInMB")] - public int? ResourceDiskSizeInMB { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceDiskSizeInMB")] + public int? ResourceDiskSizeInMb {get; set; } /// - /// Gets or sets the amount of memory, in MB, supported by the virtual - /// machine size. + /// Gets or sets the amount of memory, in MB, supported by the virtual machine + /// size. /// - [JsonProperty(PropertyName = "memoryInMB")] - public int? MemoryInMB { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "memoryInMB")] + public int? MemoryInMb {get; set; } /// - /// Gets or sets the maximum number of data disks that can be attached - /// to the virtual machine size. + /// Gets or sets the maximum number of data disks that can be attached to the + /// virtual machine size. /// - [JsonProperty(PropertyName = "maxDataDiskCount")] - public int? MaxDataDiskCount { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "maxDataDiskCount")] + public int? MaxDataDiskCount {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineSizeTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineSizeTypes.cs index 4b45aed4c4e6..5ee791d2c7e4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineSizeTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineSizeTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for VirtualMachineSizeTypes. /// + + public static class VirtualMachineSizeTypes { public const string BasicA0 = "Basic_A0"; @@ -37,15 +34,15 @@ public static class VirtualMachineSizeTypes public const string StandardA2V2 = "Standard_A2_v2"; public const string StandardA4V2 = "Standard_A4_v2"; public const string StandardA8V2 = "Standard_A8_v2"; - public const string StandardA2mV2 = "Standard_A2m_v2"; - public const string StandardA4mV2 = "Standard_A4m_v2"; - public const string StandardA8mV2 = "Standard_A8m_v2"; - public const string StandardB1s = "Standard_B1s"; - public const string StandardB1ms = "Standard_B1ms"; - public const string StandardB2s = "Standard_B2s"; - public const string StandardB2ms = "Standard_B2ms"; - public const string StandardB4ms = "Standard_B4ms"; - public const string StandardB8ms = "Standard_B8ms"; + public const string StandardA2MV2 = "Standard_A2m_v2"; + public const string StandardA4MV2 = "Standard_A4m_v2"; + public const string StandardA8MV2 = "Standard_A8m_v2"; + public const string StandardB1S = "Standard_B1s"; + public const string StandardB1Ms = "Standard_B1ms"; + public const string StandardB2S = "Standard_B2s"; + public const string StandardB2Ms = "Standard_B2ms"; + public const string StandardB4Ms = "Standard_B4ms"; + public const string StandardB8Ms = "Standard_B8ms"; public const string StandardD1 = "Standard_D1"; public const string StandardD2 = "Standard_D2"; public const string StandardD3 = "Standard_D3"; @@ -65,12 +62,12 @@ public static class VirtualMachineSizeTypes public const string StandardD16V3 = "Standard_D16_v3"; public const string StandardD32V3 = "Standard_D32_v3"; public const string StandardD64V3 = "Standard_D64_v3"; - public const string StandardD2sV3 = "Standard_D2s_v3"; - public const string StandardD4sV3 = "Standard_D4s_v3"; - public const string StandardD8sV3 = "Standard_D8s_v3"; - public const string StandardD16sV3 = "Standard_D16s_v3"; - public const string StandardD32sV3 = "Standard_D32s_v3"; - public const string StandardD64sV3 = "Standard_D64s_v3"; + public const string StandardD2SV3 = "Standard_D2s_v3"; + public const string StandardD4SV3 = "Standard_D4s_v3"; + public const string StandardD8SV3 = "Standard_D8s_v3"; + public const string StandardD16SV3 = "Standard_D16s_v3"; + public const string StandardD32SV3 = "Standard_D32s_v3"; + public const string StandardD64SV3 = "Standard_D64s_v3"; public const string StandardD11V2 = "Standard_D11_v2"; public const string StandardD12V2 = "Standard_D12_v2"; public const string StandardD13V2 = "Standard_D13_v2"; @@ -104,33 +101,33 @@ public static class VirtualMachineSizeTypes public const string StandardE16V3 = "Standard_E16_v3"; public const string StandardE32V3 = "Standard_E32_v3"; public const string StandardE64V3 = "Standard_E64_v3"; - public const string StandardE2sV3 = "Standard_E2s_v3"; - public const string StandardE4sV3 = "Standard_E4s_v3"; - public const string StandardE8sV3 = "Standard_E8s_v3"; - public const string StandardE16sV3 = "Standard_E16s_v3"; - public const string StandardE32sV3 = "Standard_E32s_v3"; - public const string StandardE64sV3 = "Standard_E64s_v3"; + public const string StandardE2SV3 = "Standard_E2s_v3"; + public const string StandardE4SV3 = "Standard_E4s_v3"; + public const string StandardE8SV3 = "Standard_E8s_v3"; + public const string StandardE16SV3 = "Standard_E16s_v3"; + public const string StandardE32SV3 = "Standard_E32s_v3"; + public const string StandardE64SV3 = "Standard_E64s_v3"; public const string StandardE3216V3 = "Standard_E32-16_v3"; - public const string StandardE328sV3 = "Standard_E32-8s_v3"; - public const string StandardE6432sV3 = "Standard_E64-32s_v3"; - public const string StandardE6416sV3 = "Standard_E64-16s_v3"; + public const string StandardE328SV3 = "Standard_E32-8s_v3"; + public const string StandardE6432SV3 = "Standard_E64-32s_v3"; + public const string StandardE6416SV3 = "Standard_E64-16s_v3"; public const string StandardF1 = "Standard_F1"; public const string StandardF2 = "Standard_F2"; public const string StandardF4 = "Standard_F4"; public const string StandardF8 = "Standard_F8"; public const string StandardF16 = "Standard_F16"; - public const string StandardF1s = "Standard_F1s"; - public const string StandardF2s = "Standard_F2s"; - public const string StandardF4s = "Standard_F4s"; - public const string StandardF8s = "Standard_F8s"; - public const string StandardF16s = "Standard_F16s"; - public const string StandardF2sV2 = "Standard_F2s_v2"; - public const string StandardF4sV2 = "Standard_F4s_v2"; - public const string StandardF8sV2 = "Standard_F8s_v2"; - public const string StandardF16sV2 = "Standard_F16s_v2"; - public const string StandardF32sV2 = "Standard_F32s_v2"; - public const string StandardF64sV2 = "Standard_F64s_v2"; - public const string StandardF72sV2 = "Standard_F72s_v2"; + public const string StandardF1S = "Standard_F1s"; + public const string StandardF2S = "Standard_F2s"; + public const string StandardF4S = "Standard_F4s"; + public const string StandardF8S = "Standard_F8s"; + public const string StandardF16S = "Standard_F16s"; + public const string StandardF2SV2 = "Standard_F2s_v2"; + public const string StandardF4SV2 = "Standard_F4s_v2"; + public const string StandardF8SV2 = "Standard_F8s_v2"; + public const string StandardF16SV2 = "Standard_F16s_v2"; + public const string StandardF32SV2 = "Standard_F32s_v2"; + public const string StandardF64SV2 = "Standard_F64s_v2"; + public const string StandardF72SV2 = "Standard_F72s_v2"; public const string StandardG1 = "Standard_G1"; public const string StandardG2 = "Standard_G2"; public const string StandardG3 = "Standard_G3"; @@ -147,40 +144,40 @@ public static class VirtualMachineSizeTypes public const string StandardGS58 = "Standard_GS5-8"; public const string StandardH8 = "Standard_H8"; public const string StandardH16 = "Standard_H16"; - public const string StandardH8m = "Standard_H8m"; - public const string StandardH16m = "Standard_H16m"; - public const string StandardH16r = "Standard_H16r"; - public const string StandardH16mr = "Standard_H16mr"; - public const string StandardL4s = "Standard_L4s"; - public const string StandardL8s = "Standard_L8s"; - public const string StandardL16s = "Standard_L16s"; - public const string StandardL32s = "Standard_L32s"; - public const string StandardM64s = "Standard_M64s"; - public const string StandardM64ms = "Standard_M64ms"; - public const string StandardM128s = "Standard_M128s"; - public const string StandardM128ms = "Standard_M128ms"; - public const string StandardM6432ms = "Standard_M64-32ms"; - public const string StandardM6416ms = "Standard_M64-16ms"; - public const string StandardM12864ms = "Standard_M128-64ms"; - public const string StandardM12832ms = "Standard_M128-32ms"; + public const string StandardH8M = "Standard_H8m"; + public const string StandardH16M = "Standard_H16m"; + public const string StandardH16R = "Standard_H16r"; + public const string StandardH16Mr = "Standard_H16mr"; + public const string StandardL4S = "Standard_L4s"; + public const string StandardL8S = "Standard_L8s"; + public const string StandardL16S = "Standard_L16s"; + public const string StandardL32S = "Standard_L32s"; + public const string StandardM64S = "Standard_M64s"; + public const string StandardM64Ms = "Standard_M64ms"; + public const string StandardM128S = "Standard_M128s"; + public const string StandardM128Ms = "Standard_M128ms"; + public const string StandardM6432Ms = "Standard_M64-32ms"; + public const string StandardM6416Ms = "Standard_M64-16ms"; + public const string StandardM12864Ms = "Standard_M128-64ms"; + public const string StandardM12832Ms = "Standard_M128-32ms"; public const string StandardNC6 = "Standard_NC6"; public const string StandardNC12 = "Standard_NC12"; public const string StandardNC24 = "Standard_NC24"; - public const string StandardNC24r = "Standard_NC24r"; - public const string StandardNC6sV2 = "Standard_NC6s_v2"; - public const string StandardNC12sV2 = "Standard_NC12s_v2"; - public const string StandardNC24sV2 = "Standard_NC24s_v2"; - public const string StandardNC24rsV2 = "Standard_NC24rs_v2"; - public const string StandardNC6sV3 = "Standard_NC6s_v3"; - public const string StandardNC12sV3 = "Standard_NC12s_v3"; - public const string StandardNC24sV3 = "Standard_NC24s_v3"; - public const string StandardNC24rsV3 = "Standard_NC24rs_v3"; - public const string StandardND6s = "Standard_ND6s"; - public const string StandardND12s = "Standard_ND12s"; - public const string StandardND24s = "Standard_ND24s"; - public const string StandardND24rs = "Standard_ND24rs"; + public const string StandardNC24R = "Standard_NC24r"; + public const string StandardNC6SV2 = "Standard_NC6s_v2"; + public const string StandardNC12SV2 = "Standard_NC12s_v2"; + public const string StandardNC24SV2 = "Standard_NC24s_v2"; + public const string StandardNC24RsV2 = "Standard_NC24rs_v2"; + public const string StandardNC6SV3 = "Standard_NC6s_v3"; + public const string StandardNC12SV3 = "Standard_NC12s_v3"; + public const string StandardNC24SV3 = "Standard_NC24s_v3"; + public const string StandardNC24RsV3 = "Standard_NC24rs_v3"; + public const string StandardND6S = "Standard_ND6s"; + public const string StandardND12S = "Standard_ND12s"; + public const string StandardND24S = "Standard_ND24s"; + public const string StandardND24Rs = "Standard_ND24rs"; public const string StandardNV6 = "Standard_NV6"; public const string StandardNV12 = "Standard_NV12"; public const string StandardNV24 = "Standard_NV24"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineSoftwarePatchProperties.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineSoftwarePatchProperties.cs index bc709ce1f948..c865ff280d10 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineSoftwarePatchProperties.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineSoftwarePatchProperties.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VirtualMachineSoftwarePatchProperties { /// - /// Initializes a new instance of the - /// VirtualMachineSoftwarePatchProperties class. + /// Initializes a new instance of the VirtualMachineSoftwarePatchProperties class. /// public VirtualMachineSoftwarePatchProperties() { @@ -30,41 +21,54 @@ public VirtualMachineSoftwarePatchProperties() } /// - /// Initializes a new instance of the - /// VirtualMachineSoftwarePatchProperties class. + /// Initializes a new instance of the VirtualMachineSoftwarePatchProperties class. /// - /// A unique identifier for the patch. - /// The friendly name of the patch. - /// The version number of the patch. This - /// property applies only to Linux patches. - /// The KBID of the patch. Only applies to Windows - /// patches. - /// The classification(s) of the patch as - /// provided by the patch publisher. - /// Describes the reboot requirements of - /// the patch. Possible values include: 'Unknown', 'NeverReboots', - /// 'AlwaysRequiresReboot', 'CanRequestReboot' - /// The activity ID of the operation that - /// produced this result. It is used to correlate across CRP and - /// extension logs. - /// The UTC timestamp when the repository - /// published this patch. - /// The UTC timestamp of the last - /// update to this patch record. - /// Describes the availability of a given - /// patch. Possible values include: 'Unknown', 'Available' - public VirtualMachineSoftwarePatchProperties(string patchId = default(string), string name = default(string), string version = default(string), string kbId = default(string), IList classifications = default(IList), string rebootBehavior = default(string), string activityId = default(string), System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? lastModifiedDateTime = default(System.DateTime?), string assessmentState = default(string)) + + /// A unique identifier for the patch. + /// + + /// The friendly name of the patch. + /// + + /// The version number of the patch. This property applies only to Linux + /// patches. + /// + + /// The KBID of the patch. Only applies to Windows patches. + /// + + /// The classification(s) of the patch as provided by the patch publisher. + /// + + /// Describes the reboot requirements of the patch. + /// Possible values include: 'Unknown', 'NeverReboots', 'AlwaysRequiresReboot', + /// 'CanRequestReboot' + + /// The activity ID of the operation that produced this result. It is used to + /// correlate across CRP and extension logs. + /// + + /// The UTC timestamp when the repository published this patch. + /// + + /// The UTC timestamp of the last update to this patch record. + /// + + /// Describes the availability of a given patch. + /// Possible values include: 'Unknown', 'Available' + public VirtualMachineSoftwarePatchProperties(string patchId = default(string), string name = default(string), string version = default(string), string kbId = default(string), System.Collections.Generic.IList classifications = default(System.Collections.Generic.IList), string rebootBehavior = default(string), string activityId = default(string), System.DateTime? publishedDate = default(System.DateTime?), System.DateTime? lastModifiedDateTime = default(System.DateTime?), string assessmentState = default(string)) + { - PatchId = patchId; - Name = name; - Version = version; - KbId = kbId; - Classifications = classifications; - RebootBehavior = rebootBehavior; - ActivityId = activityId; - PublishedDate = publishedDate; - LastModifiedDateTime = lastModifiedDateTime; - AssessmentState = assessmentState; + this.PatchId = patchId; + this.Name = name; + this.Version = version; + this.KbId = kbId; + this.Classifications = classifications; + this.RebootBehavior = rebootBehavior; + this.ActivityId = activityId; + this.PublishedDate = publishedDate; + this.LastModifiedDateTime = lastModifiedDateTime; + this.AssessmentState = assessmentState; CustomInit(); } @@ -73,71 +77,67 @@ public VirtualMachineSoftwarePatchProperties() /// partial void CustomInit(); + /// /// Gets a unique identifier for the patch. /// - [JsonProperty(PropertyName = "patchId")] - public string PatchId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "patchId")] + public string PatchId {get; private set; } /// /// Gets the friendly name of the patch. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// - /// Gets the version number of the patch. This property applies only to - /// Linux patches. + /// Gets the version number of the patch. This property applies only to Linux + /// patches. /// - [JsonProperty(PropertyName = "version")] - public string Version { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "version")] + public string Version {get; private set; } /// /// Gets the KBID of the patch. Only applies to Windows patches. /// - [JsonProperty(PropertyName = "kbId")] - public string KbId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "kbId")] + public string KbId {get; private set; } /// - /// Gets the classification(s) of the patch as provided by the patch - /// publisher. + /// Gets the classification(s) of the patch as provided by the patch publisher. /// - [JsonProperty(PropertyName = "classifications")] - public IList Classifications { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "classifications")] + public System.Collections.Generic.IList Classifications {get; private set; } /// - /// Gets describes the reboot requirements of the patch. Possible - /// values include: 'Unknown', 'NeverReboots', 'AlwaysRequiresReboot', - /// 'CanRequestReboot' + /// Gets describes the reboot requirements of the patch. Possible values include: 'Unknown', 'NeverReboots', 'AlwaysRequiresReboot', 'CanRequestReboot' /// - [JsonProperty(PropertyName = "rebootBehavior")] - public string RebootBehavior { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "rebootBehavior")] + public string RebootBehavior {get; private set; } /// - /// Gets the activity ID of the operation that produced this result. It - /// is used to correlate across CRP and extension logs. + /// Gets the activity ID of the operation that produced this result. It is used + /// to correlate across CRP and extension logs. /// - [JsonProperty(PropertyName = "activityId")] - public string ActivityId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "activityId")] + public string ActivityId {get; private set; } /// /// Gets the UTC timestamp when the repository published this patch. /// - [JsonProperty(PropertyName = "publishedDate")] - public System.DateTime? PublishedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "publishedDate")] + public System.DateTime? PublishedDate {get; private set; } /// /// Gets the UTC timestamp of the last update to this patch record. /// - [JsonProperty(PropertyName = "lastModifiedDateTime")] - public System.DateTime? LastModifiedDateTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedDateTime")] + public System.DateTime? LastModifiedDateTime {get; private set; } /// - /// Gets describes the availability of a given patch. Possible values - /// include: 'Unknown', 'Available' + /// Gets describes the availability of a given patch. Possible values include: 'Unknown', 'Available' /// - [JsonProperty(PropertyName = "assessmentState")] - public string AssessmentState { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "assessmentState")] + public string AssessmentState {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineStatusCodeCount.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineStatusCodeCount.cs index 3c614f4e1aac..e7ab97bb48f3 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineStatusCodeCount.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineStatusCodeCount.cs @@ -1,27 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// The status code and count of the virtual machine scale set instance - /// view status summary. + /// The status code and count of the virtual machine scale set instance view + /// status summary. /// public partial class VirtualMachineStatusCodeCount { /// - /// Initializes a new instance of the VirtualMachineStatusCodeCount - /// class. + /// Initializes a new instance of the VirtualMachineStatusCodeCount class. /// public VirtualMachineStatusCodeCount() { @@ -29,16 +22,19 @@ public VirtualMachineStatusCodeCount() } /// - /// Initializes a new instance of the VirtualMachineStatusCodeCount - /// class. + /// Initializes a new instance of the VirtualMachineStatusCodeCount class. /// - /// The instance view status code. - /// The number of instances having a particular - /// status code. + + /// The instance view status code. + /// + + /// The number of instances having a particular status code. + /// public VirtualMachineStatusCodeCount(string code = default(string), int? count = default(int?)) + { - Code = code; - Count = count; + this.Code = code; + this.Count = count; CustomInit(); } @@ -47,17 +43,17 @@ public VirtualMachineStatusCodeCount() /// partial void CustomInit(); + /// /// Gets the instance view status code. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; private set; } /// /// Gets the number of instances having a particular status code. /// - [JsonProperty(PropertyName = "count")] - public int? Count { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "count")] + public int? Count {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineUpdate.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineUpdate.cs index 4c148adbdb9b..abb990800e82 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineUpdate.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachineUpdate.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Describes a Virtual Machine Update. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VirtualMachineUpdate : UpdateResource { /// @@ -34,164 +24,196 @@ public VirtualMachineUpdate() /// /// Initializes a new instance of the VirtualMachineUpdate class. /// - /// Resource tags - /// Specifies information about the marketplace - /// image used to create the virtual machine. This element is only used - /// for marketplace images. Before you can use a marketplace image from - /// an API, you must enable the image for programmatic use. In the - /// Azure portal, find the marketplace image that you want to use and - /// then click **Want to deploy programmatically, Get Started ->**. - /// Enter any required information and then click **Save**. - /// Specifies the hardware settings for - /// the virtual machine. - /// Specifies Redeploy, Reboot and - /// ScheduledEventsAdditionalPublishingTargets Scheduled Event related - /// configurations for the virtual machine. - /// Specifies the storage settings for the - /// virtual machine disks. - /// Specifies additional - /// capabilities enabled or disabled on the virtual machine. - /// Specifies the operating system settings - /// used while creating the virtual machine. Some of the settings - /// cannot be changed once VM is provisioned. - /// Specifies the network interfaces of - /// the virtual machine. - /// Specifies the Security related - /// profile settings for the virtual machine. - /// Specifies the boot diagnostic - /// settings state. Minimum api-version: 2015-06-15. - /// Specifies information about the - /// availability set that the virtual machine should be assigned to. - /// Virtual machines specified in the same availability set are - /// allocated to different nodes to maximize availability. For more + + /// Resource tags + /// + + /// Specifies information about the marketplace image used to create the + /// virtual machine. This element is only used for marketplace images. Before + /// you can use a marketplace image from an API, you must enable the image for + /// programmatic use. In the Azure portal, find the marketplace image that you + /// want to use and then click **Want to deploy programmatically, Get Started + /// ->**. Enter any required information and then click **Save**. + /// + + /// The identity of the virtual machine, if configured. + /// + + /// The virtual machine zones. + /// + + /// Specifies the hardware settings for the virtual machine. + /// + + /// Specifies the storage settings for the virtual machine disks. + /// + + /// Specifies additional capabilities enabled or disabled on the virtual + /// machine. + /// + + /// Specifies the operating system settings used while creating the virtual + /// machine. Some of the settings cannot be changed once VM is provisioned. + /// + + /// Specifies the network interfaces of the virtual machine. + /// + + /// Specifies the Security related profile settings for the virtual machine. + /// + + /// Specifies the boot diagnostic settings state. Minimum api-version: + /// 2015-06-15. + /// + + /// Specifies the billing related details of a Azure Spot virtual machine. + /// Minimum api-version: 2019-03-01. + /// + + /// Specifies the gallery applications that should be made available to the + /// VM/VMSS. + /// + + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets + /// Scheduled Event related configurations for the virtual machine. + /// + + /// Specifies information about the availability set that the virtual machine + /// should be assigned to. Virtual machines specified in the same availability + /// set are allocated to different nodes to maximize availability. For more /// information about availability sets, see [Availability sets /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). - /// For more information on Azure planned maintenance, see [Maintenance - /// and updates for Virtual Machines in + /// For more information on Azure planned maintenance, see [Maintenance and + /// updates for Virtual Machines in /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). - /// Currently, a VM can only be added to availability set at creation - /// time. The availability set to which the VM is being added should be - /// under the same resource group as the availability set resource. An - /// existing VM cannot be added to an availability set. This property - /// cannot exist along with a non-null - /// properties.virtualMachineScaleSet reference. - /// Specifies information about - /// the virtual machine scale set that the virtual machine should be - /// assigned to. Virtual machines specified in the same virtual machine - /// scale set are allocated to different nodes to maximize - /// availability. Currently, a VM can only be added to virtual machine - /// scale set at creation time. An existing VM cannot be added to a - /// virtual machine scale set. This property cannot exist along with a - /// non-null properties.availabilitySet reference. Minimum api‐version: - /// 2019‐03‐01. - /// Specifies information about - /// the proximity placement group that the virtual machine should be - /// assigned to. Minimum api-version: 2018-04-01. - /// Specifies the priority for the virtual - /// machine. Minimum api-version: 2019-03-01. Possible values include: - /// 'Regular', 'Low', 'Spot' - /// Specifies the eviction policy for the - /// Azure Spot virtual machine and Azure Spot scale set. For Azure Spot - /// virtual machines, both 'Deallocate' and 'Delete' are supported and - /// the minimum api-version is 2019-03-01. For Azure Spot scale sets, - /// both 'Deallocate' and 'Delete' are supported and the minimum - /// api-version is 2017-10-30-preview. Possible values include: - /// 'Deallocate', 'Delete' - /// Specifies the billing related details - /// of a Azure Spot virtual machine. Minimum api-version: - /// 2019-03-01. - /// Specifies information about the dedicated host - /// that the virtual machine resides in. Minimum api-version: - /// 2018-10-01. - /// Specifies information about the dedicated - /// host group that the virtual machine resides in. **Note:** User - /// cannot specify both host and hostGroup properties. Minimum - /// api-version: 2020-06-01. - /// The provisioning state, which only - /// appears in the response. - /// The virtual machine instance - /// view. - /// Specifies that the image or disk that is - /// being used was licensed on-premises. <br><br> Possible - /// values for Windows Server operating system are: - /// <br><br> Windows_Client <br><br> - /// Windows_Server <br><br> Possible values for Linux - /// Server operating system are: <br><br> RHEL_BYOS (for - /// RHEL) <br><br> SLES_BYOS (for SUSE) - /// <br><br> For more information, see [Azure Hybrid Use - /// Benefit for Windows + /// Currently, a VM can only be added to availability set at creation time. The + /// availability set to which the VM is being added should be under the same + /// resource group as the availability set resource. An existing VM cannot be + /// added to an availability set. This property cannot exist along with a + /// non-null properties.virtualMachineScaleSet reference. + /// + + /// Specifies information about the virtual machine scale set that the virtual + /// machine should be assigned to. Virtual machines specified in the same + /// virtual machine scale set are allocated to different nodes to maximize + /// availability. Currently, a VM can only be added to virtual machine scale + /// set at creation time. An existing VM cannot be added to a virtual machine + /// scale set. This property cannot exist along with a non-null + /// properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. + /// + + /// Specifies information about the proximity placement group that the virtual + /// machine should be assigned to. Minimum api-version: 2018-04-01. + /// + + /// Specifies the priority for the virtual machine. Minimum api-version: + /// 2019-03-01 + /// Possible values include: 'Regular', 'Low', 'Spot' + + /// Specifies the eviction policy for the Azure Spot virtual machine and Azure + /// Spot scale set. For Azure Spot virtual machines, both 'Deallocate' and + /// 'Delete' are supported and the minimum api-version is 2019-03-01. For Azure + /// Spot scale sets, both 'Deallocate' and 'Delete' are supported and the + /// minimum api-version is 2017-10-30-preview. + /// Possible values include: 'Deallocate', 'Delete' + + /// Specifies information about the dedicated host that the virtual machine + /// resides in. Minimum api-version: 2018-10-01. + /// + + /// Specifies information about the dedicated host group that the virtual + /// machine resides in. **Note:** User cannot specify both host and hostGroup + /// properties. Minimum api-version: 2020-06-01. + /// + + /// The provisioning state, which only appears in the response. + /// + + /// The virtual machine instance view. + /// + + /// Specifies that the image or disk that is being used was licensed + /// on-premises. <br><br> Possible values for Windows Server operating system + /// are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible + /// values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) + /// <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure + /// Hybrid Use Benefit for Windows /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) /// <br><br> [Azure Hybrid Use Benefit for Linux /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) - /// <br><br> Minimum api-version: 2015-06-15 - /// Specifies the VM unique ID which is a 128-bits - /// identifier that is encoded and stored in all Azure IaaS VMs SMBIOS - /// and can be read using platform BIOS commands. - /// Specifies the time alloted for - /// all extensions to start. The time duration should be between 15 - /// minutes and 120 minutes (inclusive) and should be specified in ISO - /// 8601 format. The default value is 90 minutes (PT1H30M). Minimum - /// api-version: 2020-06-01. - /// Specifies the scale set logical - /// fault domain into which the Virtual Machine will be created. By - /// default, the Virtual Machine will by automatically assigned to a - /// fault domain that best maintains balance across available fault - /// domains. This is applicable only if the 'virtualMachineScaleSet' - /// property of this Virtual Machine is set. The Virtual Machine Scale - /// Set that is referenced, must have 'platformFaultDomainCount' - /// greater than 1. This property cannot be updated once the Virtual - /// Machine is created. Fault domain assignment can be viewed in the - /// Virtual Machine Instance View. Minimum api‐version: - /// 2020‐12‐01. - /// Specifies Scheduled Event - /// related configurations. - /// UserData for the VM, which must be base-64 - /// encoded. Customer should not pass any secrets in here. Minimum - /// api-version: 2021-03-01. - /// Specifies information about the - /// capacity reservation that is used to allocate virtual machine. - /// Minimum api-version: 2021-04-01. - /// Specifies the gallery applications - /// that should be made available to the VM/VMSS. - /// Specifies the time at which the Virtual - /// Machine resource was created. Minimum api-version: - /// 2021-11-01. - /// The identity of the virtual machine, if - /// configured. - /// The virtual machine zones. - public VirtualMachineUpdate(IDictionary tags = default(IDictionary), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), ScheduledEventsPolicy scheduledEventsPolicy = default(ScheduledEventsPolicy), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), ScheduledEventsProfile scheduledEventsProfile = default(ScheduledEventsProfile), string userData = default(string), CapacityReservationProfile capacityReservation = default(CapacityReservationProfile), ApplicationProfile applicationProfile = default(ApplicationProfile), System.DateTime? timeCreated = default(System.DateTime?), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList zones = default(IList)) - : base(tags) + /// <br><br> Minimum api-version: 2015-06-15 + /// + + /// Specifies the VM unique ID which is a 128-bits identifier that is encoded + /// and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS + /// commands. + /// + + /// Specifies the time alloted for all extensions to start. The time duration + /// should be between 15 minutes and 120 minutes (inclusive) and should be + /// specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). + /// Minimum api-version: 2020-06-01. + /// + + /// Specifies the scale set logical fault domain into which the Virtual Machine + /// will be created. By default, the Virtual Machine will by automatically + /// assigned to a fault domain that best maintains balance across available + /// fault domains. This is applicable only if the 'virtualMachineScaleSet' + /// property of this Virtual Machine is set. The Virtual Machine Scale Set that + /// is referenced, must have 'platformFaultDomainCount' greater than 1. This + /// property cannot be updated once the Virtual Machine is created. Fault + /// domain assignment can be viewed in the Virtual Machine Instance View. + /// Minimum api‐version: 2020‐12‐01. + /// + + /// Specifies Scheduled Event related configurations. + /// + + /// UserData for the VM, which must be base-64 encoded. Customer should not + /// pass any secrets in here. Minimum api-version: 2021-03-01. + /// + + /// Specifies information about the capacity reservation that is used to + /// allocate virtual machine. Minimum api-version: 2021-04-01. + /// + + /// Specifies the time at which the Virtual Machine resource was created. + /// Minimum api-version: 2021-11-01. + /// + public VirtualMachineUpdate(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), Plan plan = default(Plan), VirtualMachineIdentity identity = default(VirtualMachineIdentity), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), BillingProfile billingProfile = default(BillingProfile), ApplicationProfile applicationProfile = default(ApplicationProfile), ScheduledEventsPolicy scheduledEventsPolicy = default(ScheduledEventsPolicy), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int? platformFaultDomain = default(int?), ScheduledEventsProfile scheduledEventsProfile = default(ScheduledEventsProfile), string userData = default(string), CapacityReservationProfile capacityReservation = default(CapacityReservationProfile), System.DateTime? timeCreated = default(System.DateTime?)) + + : base(tags) { - Plan = plan; - HardwareProfile = hardwareProfile; - ScheduledEventsPolicy = scheduledEventsPolicy; - StorageProfile = storageProfile; - AdditionalCapabilities = additionalCapabilities; - OsProfile = osProfile; - NetworkProfile = networkProfile; - SecurityProfile = securityProfile; - DiagnosticsProfile = diagnosticsProfile; - AvailabilitySet = availabilitySet; - VirtualMachineScaleSet = virtualMachineScaleSet; - ProximityPlacementGroup = proximityPlacementGroup; - Priority = priority; - EvictionPolicy = evictionPolicy; - BillingProfile = billingProfile; - Host = host; - HostGroup = hostGroup; - ProvisioningState = provisioningState; - InstanceView = instanceView; - LicenseType = licenseType; - VmId = vmId; - ExtensionsTimeBudget = extensionsTimeBudget; - PlatformFaultDomain = platformFaultDomain; - ScheduledEventsProfile = scheduledEventsProfile; - UserData = userData; - CapacityReservation = capacityReservation; - ApplicationProfile = applicationProfile; - TimeCreated = timeCreated; - Identity = identity; - Zones = zones; + this.Plan = plan; + this.Identity = identity; + this.Zones = zones; + this.HardwareProfile = hardwareProfile; + this.StorageProfile = storageProfile; + this.AdditionalCapabilities = additionalCapabilities; + this.OsProfile = osProfile; + this.NetworkProfile = networkProfile; + this.SecurityProfile = securityProfile; + this.DiagnosticsProfile = diagnosticsProfile; + this.BillingProfile = billingProfile; + this.ApplicationProfile = applicationProfile; + this.ScheduledEventsPolicy = scheduledEventsPolicy; + this.AvailabilitySet = availabilitySet; + this.VirtualMachineScaleSet = virtualMachineScaleSet; + this.ProximityPlacementGroup = proximityPlacementGroup; + this.Priority = priority; + this.EvictionPolicy = evictionPolicy; + this.Host = host; + this.HostGroup = hostGroup; + this.ProvisioningState = provisioningState; + this.InstanceView = instanceView; + this.LicenseType = licenseType; + this.VmId = vmId; + this.ExtensionsTimeBudget = extensionsTimeBudget; + this.PlatformFaultDomain = platformFaultDomain; + this.ScheduledEventsProfile = scheduledEventsProfile; + this.UserData = userData; + this.CapacityReservation = capacityReservation; + this.TimeCreated = timeCreated; CustomInit(); } @@ -200,287 +222,293 @@ public VirtualMachineUpdate() /// partial void CustomInit(); + /// - /// Gets or sets specifies information about the marketplace image used - /// to create the virtual machine. This element is only used for - /// marketplace images. Before you can use a marketplace image from an - /// API, you must enable the image for programmatic use. In the Azure - /// portal, find the marketplace image that you want to use and then - /// click **Want to deploy programmatically, Get Started -&gt;**. - /// Enter any required information and then click **Save**. + /// Gets or sets specifies information about the marketplace image used to + /// create the virtual machine. This element is only used for marketplace + /// images. Before you can use a marketplace image from an API, you must enable + /// the image for programmatic use. In the Azure portal, find the marketplace + /// image that you want to use and then click **Want to deploy + /// programmatically, Get Started ->**. Enter any required information and then + /// click **Save**. /// - [JsonProperty(PropertyName = "plan")] - public Plan Plan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "plan")] + public Plan Plan {get; set; } /// - /// Gets or sets specifies the hardware settings for the virtual - /// machine. + /// Gets or sets the identity of the virtual machine, if configured. /// - [JsonProperty(PropertyName = "properties.hardwareProfile")] - public HardwareProfile HardwareProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public VirtualMachineIdentity Identity {get; set; } /// - /// Gets or sets specifies Redeploy, Reboot and - /// ScheduledEventsAdditionalPublishingTargets Scheduled Event related - /// configurations for the virtual machine. + /// Gets or sets the virtual machine zones. /// - [JsonProperty(PropertyName = "properties.scheduledEventsPolicy")] - public ScheduledEventsPolicy ScheduledEventsPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } /// - /// Gets or sets specifies the storage settings for the virtual machine - /// disks. + /// Gets or sets specifies the hardware settings for the virtual machine. /// - [JsonProperty(PropertyName = "properties.storageProfile")] - public StorageProfile StorageProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hardwareProfile")] + public HardwareProfile HardwareProfile {get; set; } /// - /// Gets or sets specifies additional capabilities enabled or disabled - /// on the virtual machine. + /// Gets or sets specifies the storage settings for the virtual machine disks. /// - [JsonProperty(PropertyName = "properties.additionalCapabilities")] - public AdditionalCapabilities AdditionalCapabilities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageProfile")] + public StorageProfile StorageProfile {get; set; } /// - /// Gets or sets specifies the operating system settings used while - /// creating the virtual machine. Some of the settings cannot be - /// changed once VM is provisioned. + /// Gets or sets specifies additional capabilities enabled or disabled on the + /// virtual machine. /// - [JsonProperty(PropertyName = "properties.osProfile")] - public OSProfile OsProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.additionalCapabilities")] + public AdditionalCapabilities AdditionalCapabilities {get; set; } /// - /// Gets or sets specifies the network interfaces of the virtual - /// machine. + /// Gets or sets specifies the operating system settings used while creating + /// the virtual machine. Some of the settings cannot be changed once VM is + /// provisioned. /// - [JsonProperty(PropertyName = "properties.networkProfile")] - public NetworkProfile NetworkProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.osProfile")] + public OSProfile OsProfile {get; set; } /// - /// Gets or sets specifies the Security related profile settings for - /// the virtual machine. + /// Gets or sets specifies the network interfaces of the virtual machine. /// - [JsonProperty(PropertyName = "properties.securityProfile")] - public SecurityProfile SecurityProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkProfile")] + public NetworkProfile NetworkProfile {get; set; } /// - /// Gets or sets specifies the boot diagnostic settings state. Minimum - /// api-version: 2015-06-15. + /// Gets or sets specifies the Security related profile settings for the + /// virtual machine. /// - [JsonProperty(PropertyName = "properties.diagnosticsProfile")] - public DiagnosticsProfile DiagnosticsProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityProfile")] + public SecurityProfile SecurityProfile {get; set; } /// - /// Gets or sets specifies information about the availability set that - /// the virtual machine should be assigned to. Virtual machines - /// specified in the same availability set are allocated to different - /// nodes to maximize availability. For more information about - /// availability sets, see [Availability sets - /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). - /// For more information on Azure planned maintenance, see [Maintenance - /// and updates for Virtual Machines in - /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). - /// Currently, a VM can only be added to availability set at creation - /// time. The availability set to which the VM is being added should be - /// under the same resource group as the availability set resource. An - /// existing VM cannot be added to an availability set. This property - /// cannot exist along with a non-null - /// properties.virtualMachineScaleSet reference. + /// Gets or sets specifies the boot diagnostic settings state. Minimum + /// api-version: 2015-06-15. /// - [JsonProperty(PropertyName = "properties.availabilitySet")] - public SubResource AvailabilitySet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.diagnosticsProfile")] + public DiagnosticsProfile DiagnosticsProfile {get; set; } /// - /// Gets or sets specifies information about the virtual machine scale - /// set that the virtual machine should be assigned to. Virtual - /// machines specified in the same virtual machine scale set are - /// allocated to different nodes to maximize availability. Currently, a - /// VM can only be added to virtual machine scale set at creation time. - /// An existing VM cannot be added to a virtual machine scale set. This - /// property cannot exist along with a non-null - /// properties.availabilitySet reference. Minimum api‐version: - /// 2019‐03‐01. + /// Gets or sets specifies the billing related details of a Azure Spot virtual + /// machine. Minimum api-version: 2019-03-01. /// - [JsonProperty(PropertyName = "properties.virtualMachineScaleSet")] - public SubResource VirtualMachineScaleSet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.billingProfile")] + public BillingProfile BillingProfile {get; set; } /// - /// Gets or sets specifies information about the proximity placement - /// group that the virtual machine should be assigned to. Minimum - /// api-version: 2018-04-01. + /// Gets or sets specifies the gallery applications that should be made + /// available to the VM/VMSS. /// - [JsonProperty(PropertyName = "properties.proximityPlacementGroup")] - public SubResource ProximityPlacementGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.applicationProfile")] + public ApplicationProfile ApplicationProfile {get; set; } /// - /// Gets or sets specifies the priority for the virtual machine. - /// Minimum api-version: 2019-03-01. Possible values include: - /// 'Regular', 'Low', 'Spot' + /// Gets or sets specifies Redeploy, Reboot and + /// ScheduledEventsAdditionalPublishingTargets Scheduled Event related + /// configurations for the virtual machine. /// - [JsonProperty(PropertyName = "properties.priority")] - public string Priority { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scheduledEventsPolicy")] + public ScheduledEventsPolicy ScheduledEventsPolicy {get; set; } /// - /// Gets or sets specifies the eviction policy for the Azure Spot - /// virtual machine and Azure Spot scale set. For Azure Spot virtual - /// machines, both 'Deallocate' and 'Delete' are supported and the - /// minimum api-version is 2019-03-01. For Azure Spot scale sets, both - /// 'Deallocate' and 'Delete' are supported and the minimum api-version - /// is 2017-10-30-preview. Possible values include: 'Deallocate', - /// 'Delete' + /// Gets or sets specifies information about the availability set that the + /// virtual machine should be assigned to. Virtual machines specified in the + /// same availability set are allocated to different nodes to maximize + /// availability. For more information about availability sets, see + /// [Availability sets + /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + /// For more information on Azure planned maintenance, see [Maintenance and + /// updates for Virtual Machines in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). + /// Currently, a VM can only be added to availability set at creation time. The + /// availability set to which the VM is being added should be under the same + /// resource group as the availability set resource. An existing VM cannot be + /// added to an availability set. This property cannot exist along with a + /// non-null properties.virtualMachineScaleSet reference. /// - [JsonProperty(PropertyName = "properties.evictionPolicy")] - public string EvictionPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.availabilitySet")] + public SubResource AvailabilitySet {get; set; } /// - /// Gets or sets specifies the billing related details of a Azure Spot - /// virtual machine. Minimum api-version: 2019-03-01. + /// Gets or sets specifies information about the virtual machine scale set that + /// the virtual machine should be assigned to. Virtual machines specified in + /// the same virtual machine scale set are allocated to different nodes to + /// maximize availability. Currently, a VM can only be added to virtual machine + /// scale set at creation time. An existing VM cannot be added to a virtual + /// machine scale set. This property cannot exist along with a non-null + /// properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. /// - [JsonProperty(PropertyName = "properties.billingProfile")] - public BillingProfile BillingProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.virtualMachineScaleSet")] + public SubResource VirtualMachineScaleSet {get; set; } /// - /// Gets or sets specifies information about the dedicated host that - /// the virtual machine resides in. Minimum api-version: 2018-10-01. + /// Gets or sets specifies information about the proximity placement group that + /// the virtual machine should be assigned to. Minimum api-version: 2018-04-01. /// - [JsonProperty(PropertyName = "properties.host")] - public SubResource Host { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.proximityPlacementGroup")] + public SubResource ProximityPlacementGroup {get; set; } /// - /// Gets or sets specifies information about the dedicated host group - /// that the virtual machine resides in. **Note:** User cannot specify - /// both host and hostGroup properties. Minimum api-version: - /// 2020-06-01. + /// Gets or sets specifies the priority for the virtual machine. Minimum + /// api-version: 2019-03-01 Possible values include: 'Regular', 'Low', 'Spot' /// - [JsonProperty(PropertyName = "properties.hostGroup")] - public SubResource HostGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.priority")] + public string Priority {get; set; } /// - /// Gets the provisioning state, which only appears in the response. + /// Gets or sets specifies the eviction policy for the Azure Spot virtual + /// machine and Azure Spot scale set. For Azure Spot virtual machines, both + /// 'Deallocate' and 'Delete' are supported and the minimum api-version is + /// 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are + /// supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.evictionPolicy")] + public string EvictionPolicy {get; set; } /// - /// Gets the virtual machine instance view. + /// Gets or sets specifies information about the dedicated host that the + /// virtual machine resides in. Minimum api-version: 2018-10-01. /// - [JsonProperty(PropertyName = "properties.instanceView")] - public VirtualMachineInstanceView InstanceView { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.host")] + public SubResource Host {get; set; } /// - /// Gets or sets specifies that the image or disk that is being used - /// was licensed on-premises. &lt;br&gt;&lt;br&gt; - /// Possible values for Windows Server operating system are: - /// &lt;br&gt;&lt;br&gt; Windows_Client - /// &lt;br&gt;&lt;br&gt; Windows_Server - /// &lt;br&gt;&lt;br&gt; Possible values for Linux - /// Server operating system are: &lt;br&gt;&lt;br&gt; - /// RHEL_BYOS (for RHEL) &lt;br&gt;&lt;br&gt; SLES_BYOS - /// (for SUSE) &lt;br&gt;&lt;br&gt; For more - /// information, see [Azure Hybrid Use Benefit for Windows - /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) - /// &lt;br&gt;&lt;br&gt; [Azure Hybrid Use Benefit for - /// Linux - /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) - /// &lt;br&gt;&lt;br&gt; Minimum api-version: - /// 2015-06-15 + /// Gets or sets specifies information about the dedicated host group that the + /// virtual machine resides in. **Note:** User cannot specify both host and + /// hostGroup properties. Minimum api-version: 2020-06-01. /// - [JsonProperty(PropertyName = "properties.licenseType")] - public string LicenseType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hostGroup")] + public SubResource HostGroup {get; set; } /// - /// Gets specifies the VM unique ID which is a 128-bits identifier that - /// is encoded and stored in all Azure IaaS VMs SMBIOS and can be read - /// using platform BIOS commands. + /// Gets the provisioning state, which only appears in the response. /// - [JsonProperty(PropertyName = "properties.vmId")] - public string VmId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets specifies the time alloted for all extensions to - /// start. The time duration should be between 15 minutes and 120 - /// minutes (inclusive) and should be specified in ISO 8601 format. The - /// default value is 90 minutes (PT1H30M). Minimum api-version: - /// 2020-06-01. + /// Gets the virtual machine instance view. /// - [JsonProperty(PropertyName = "properties.extensionsTimeBudget")] - public string ExtensionsTimeBudget { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.instanceView")] + public VirtualMachineInstanceView InstanceView {get; private set; } /// - /// Gets or sets specifies the scale set logical fault domain into - /// which the Virtual Machine will be created. By default, the Virtual - /// Machine will by automatically assigned to a fault domain that best - /// maintains balance across available fault domains. This is - /// applicable only if the 'virtualMachineScaleSet' property of this - /// Virtual Machine is set. The Virtual Machine Scale Set that is - /// referenced, must have 'platformFaultDomainCount' greater than 1. - /// This property cannot be updated once the Virtual Machine is - /// created. Fault domain assignment can be viewed in the Virtual - /// Machine Instance View. Minimum api‐version: 2020‐12‐01. + /// Gets or sets specifies that the image or disk that is being used was + /// licensed on-premises. <br><br> Possible values for Windows Server operating + /// system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> + /// Possible values for Linux Server operating system are: <br><br> RHEL_BYOS + /// (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see + /// [Azure Hybrid Use Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 /// - [JsonProperty(PropertyName = "properties.platformFaultDomain")] - public int? PlatformFaultDomain { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.licenseType")] + public string LicenseType {get; set; } /// - /// Gets or sets specifies Scheduled Event related configurations. + /// Gets specifies the VM unique ID which is a 128-bits identifier that is + /// encoded and stored in all Azure IaaS VMs SMBIOS and can be read using + /// platform BIOS commands. /// - [JsonProperty(PropertyName = "properties.scheduledEventsProfile")] - public ScheduledEventsProfile ScheduledEventsProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.vmId")] + public string VmId {get; private set; } /// - /// Gets or sets userData for the VM, which must be base-64 encoded. - /// Customer should not pass any secrets in here. Minimum api-version: - /// 2021-03-01. + /// Gets or sets specifies the time alloted for all extensions to start. The + /// time duration should be between 15 minutes and 120 minutes (inclusive) and + /// should be specified in ISO 8601 format. The default value is 90 minutes + /// (PT1H30M). Minimum api-version: 2020-06-01. /// - [JsonProperty(PropertyName = "properties.userData")] - public string UserData { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.extensionsTimeBudget")] + public string ExtensionsTimeBudget {get; set; } /// - /// Gets or sets specifies information about the capacity reservation - /// that is used to allocate virtual machine. Minimum api-version: - /// 2021-04-01. + /// Gets or sets specifies the scale set logical fault domain into which the + /// Virtual Machine will be created. By default, the Virtual Machine will by + /// automatically assigned to a fault domain that best maintains balance across + /// available fault domains. This is applicable only if the + /// 'virtualMachineScaleSet' property of this Virtual Machine is set. The + /// Virtual Machine Scale Set that is referenced, must have + /// 'platformFaultDomainCount' greater than 1. This property cannot be updated + /// once the Virtual Machine is created. Fault domain assignment can be viewed + /// in the Virtual Machine Instance View. Minimum api‐version: 2020‐12‐01. /// - [JsonProperty(PropertyName = "properties.capacityReservation")] - public CapacityReservationProfile CapacityReservation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.platformFaultDomain")] + public int? PlatformFaultDomain {get; set; } /// - /// Gets or sets specifies the gallery applications that should be made - /// available to the VM/VMSS. + /// Gets or sets specifies Scheduled Event related configurations. /// - [JsonProperty(PropertyName = "properties.applicationProfile")] - public ApplicationProfile ApplicationProfile { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scheduledEventsProfile")] + public ScheduledEventsProfile ScheduledEventsProfile {get; set; } /// - /// Gets specifies the time at which the Virtual Machine resource was - /// created. Minimum api-version: 2021-11-01. + /// Gets or sets userData for the VM, which must be base-64 encoded. Customer + /// should not pass any secrets in here. Minimum api-version: 2021-03-01. /// - [JsonProperty(PropertyName = "properties.timeCreated")] - public System.DateTime? TimeCreated { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.userData")] + public string UserData {get; set; } /// - /// Gets or sets the identity of the virtual machine, if configured. + /// Gets or sets specifies information about the capacity reservation that is + /// used to allocate virtual machine. Minimum api-version: 2021-04-01. /// - [JsonProperty(PropertyName = "identity")] - public VirtualMachineIdentity Identity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.capacityReservation")] + public CapacityReservationProfile CapacityReservation {get; set; } /// - /// Gets or sets the virtual machine zones. + /// Gets specifies the time at which the Virtual Machine resource was created. + /// Minimum api-version: 2021-11-01. /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.timeCreated")] + public System.DateTime? TimeCreated {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (StorageProfile != null) + + + + + if (this.StorageProfile != null) { - StorageProfile.Validate(); + this.StorageProfile.Validate(); } + + + + + + + + + + + + + + + + + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinesAttachDetachDataDisksHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinesAttachDetachDataDisksHeaders.cs index f8933f05da58..b1cdcf51ef66 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinesAttachDetachDataDisksHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinesAttachDetachDataDisksHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for AttachDetachDataDisks operation. - /// public partial class VirtualMachinesAttachDetachDataDisksHeaders { /// - /// Initializes a new instance of the - /// VirtualMachinesAttachDetachDataDisksHeaders class. + /// Initializes a new instance of the VirtualMachinesAttachDetachDataDisksHeaders class. /// public VirtualMachinesAttachDetachDataDisksHeaders() { @@ -28,18 +18,19 @@ public VirtualMachinesAttachDetachDataDisksHeaders() } /// - /// Initializes a new instance of the - /// VirtualMachinesAttachDetachDataDisksHeaders class. + /// Initializes a new instance of the VirtualMachinesAttachDetachDataDisksHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachinesAttachDetachDataDisksHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachinesAttachDetachDataDisksHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinesCreateOrUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinesCreateOrUpdateHeaders.cs index 44552aad5855..9afa85bd9469 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinesCreateOrUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinesCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class VirtualMachinesCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// VirtualMachinesCreateOrUpdateHeaders class. + /// Initializes a new instance of the VirtualMachinesCreateOrUpdateHeaders class. /// public VirtualMachinesCreateOrUpdateHeaders() { @@ -28,18 +18,19 @@ public VirtualMachinesCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// VirtualMachinesCreateOrUpdateHeaders class. + /// Initializes a new instance of the VirtualMachinesCreateOrUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachinesCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachinesCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinesUpdateHeaders.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinesUpdateHeaders.cs index d4b2c846c7b8..0bd18af12be4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinesUpdateHeaders.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VirtualMachinesUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Update operation. - /// public partial class VirtualMachinesUpdateHeaders { /// - /// Initializes a new instance of the VirtualMachinesUpdateHeaders - /// class. + /// Initializes a new instance of the VirtualMachinesUpdateHeaders class. /// public VirtualMachinesUpdateHeaders() { @@ -28,18 +18,19 @@ public VirtualMachinesUpdateHeaders() } /// - /// Initializes a new instance of the VirtualMachinesUpdateHeaders - /// class. + /// Initializes a new instance of the VirtualMachinesUpdateHeaders class. /// - /// The Location header contains the URL where - /// the status of the long running operation can be checked. - /// The Retry-After header can indicate how - /// long the client should wait before polling the operation - /// status. + + /// + /// + + /// + /// public VirtualMachinesUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { - Location = location; - RetryAfter = retryAfter; + this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -48,19 +39,17 @@ public VirtualMachinesUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets the Location header contains the URL where the status - /// of the long running operation can be checked. + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// - /// Gets or sets the Retry-After header can indicate how long the - /// client should wait before polling the operation status. + /// Gets or sets /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VmDiskTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VmDiskTypes.cs index 6b98cea8d944..0722eba1ee06 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VmDiskTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VmDiskTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for VmDiskTypes. /// + + public static class VmDiskTypes { public const string None = "None"; public const string Unmanaged = "Unmanaged"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VmImagesInEdgeZoneListResult.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VmImagesInEdgeZoneListResult.cs index d50f70184049..8253d442d220 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VmImagesInEdgeZoneListResult.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VmImagesInEdgeZoneListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class VmImagesInEdgeZoneListResult { /// - /// Initializes a new instance of the VmImagesInEdgeZoneListResult - /// class. + /// Initializes a new instance of the VmImagesInEdgeZoneListResult class. /// public VmImagesInEdgeZoneListResult() { @@ -30,17 +21,20 @@ public VmImagesInEdgeZoneListResult() } /// - /// Initializes a new instance of the VmImagesInEdgeZoneListResult - /// class. + /// Initializes a new instance of the VmImagesInEdgeZoneListResult class. /// - /// The list of VMImages in EdgeZone - /// The URI to fetch the next page of VMImages - /// in EdgeZone. Call ListNext() with this URI to fetch the next page - /// of VmImages. - public VmImagesInEdgeZoneListResult(IList value = default(IList), string nextLink = default(string)) + + /// The list of VMImages in EdgeZone + /// + + /// The URI to fetch the next page of VMImages in EdgeZone. Call ListNext() + /// with this URI to fetch the next page of VmImages. + /// + public VmImagesInEdgeZoneListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList), string nextLink = default(string)) + { - Value = value; - NextLink = nextLink; + this.Value = value; + this.NextLink = nextLink; CustomInit(); } @@ -49,19 +43,18 @@ public VmImagesInEdgeZoneListResult() /// partial void CustomInit(); + /// /// Gets or sets the list of VMImages in EdgeZone /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } /// - /// Gets or sets the URI to fetch the next page of VMImages in - /// EdgeZone. Call ListNext() with this URI to fetch the next page of - /// VmImages. + /// Gets or sets the URI to fetch the next page of VMImages in EdgeZone. Call + /// ListNext() with this URI to fetch the next page of VmImages. /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + public string NextLink {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/VmssVMInstanceViewTypes.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/VmssVMInstanceViewTypes.cs index 15f7886ca35e..1e15cf5c4fc8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/VmssVMInstanceViewTypes.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/VmssVMInstanceViewTypes.cs @@ -1,31 +1,24 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for VmssVMInstanceViewTypes. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum VmssVMInstanceViewTypes { - [EnumMember(Value = "instanceView")] + [System.Runtime.Serialization.EnumMember(Value = "instanceView")] InstanceView, - [EnumMember(Value = "userData")] + [System.Runtime.Serialization.EnumMember(Value = "userData")] UserData, - [EnumMember(Value = "resiliencyView")] + [System.Runtime.Serialization.EnumMember(Value = "resiliencyView")] ResiliencyView } internal static class VmssVMInstanceViewTypesEnumExtension @@ -34,7 +27,6 @@ internal static string ToSerializedValue(this VmssVMInstanceViewTypes? value) { return value == null ? null : ((VmssVMInstanceViewTypes)value).ToSerializedValue(); } - internal static string ToSerializedValue(this VmssVMInstanceViewTypes value) { switch( value ) @@ -48,7 +40,6 @@ internal static string ToSerializedValue(this VmssVMInstanceViewTypes value) } return null; } - internal static VmssVMInstanceViewTypes? ParseVmssVMInstanceViewTypes(this string value) { switch( value ) @@ -63,4 +54,4 @@ internal static string ToSerializedValue(this VmssVMInstanceViewTypes value) return null; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/WinRMConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/WinRMConfiguration.cs index 2a7f723e723c..37b535a8038a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/WinRMConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/WinRMConfiguration.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,11 +23,13 @@ public WinRMConfiguration() /// /// Initializes a new instance of the WinRMConfiguration class. /// - /// The list of Windows Remote Management - /// listeners - public WinRMConfiguration(IList listeners = default(IList)) + + /// The list of Windows Remote Management listeners + /// + public WinRMConfiguration(System.Collections.Generic.IList listeners = default(System.Collections.Generic.IList)) + { - Listeners = listeners; + this.Listeners = listeners; CustomInit(); } @@ -44,11 +38,11 @@ public WinRMConfiguration() /// partial void CustomInit(); + /// /// Gets or sets the list of Windows Remote Management listeners /// - [JsonProperty(PropertyName = "listeners")] - public IList Listeners { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "listeners")] + public System.Collections.Generic.IList Listeners {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/WinRMListener.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/WinRMListener.cs index a7b2f860aee4..832531165740 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/WinRMListener.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/WinRMListener.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,28 +23,30 @@ public WinRMListener() /// /// Initializes a new instance of the WinRMListener class. /// - /// Specifies the protocol of WinRM listener. - /// Possible values are: **http,** **https.**. Possible values include: - /// 'Http', 'Https' - /// This is the URL of a certificate that - /// has been uploaded to Key Vault as a secret. For adding a secret to - /// the Key Vault, see [Add a key or secret to the key + + /// Specifies the protocol of WinRM listener. Possible values are: **http,** + /// **https.** + /// Possible values include: 'Http', 'Https' + + /// This is the URL of a certificate that has been uploaded to Key Vault as a + /// secret. For adding a secret to the Key Vault, see [Add a key or secret to + /// the key /// vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). - /// In this case, your certificate needs to be the Base64 encoding of - /// the following JSON Object which is encoded in UTF-8: - /// <br><br> {<br> - /// "data":"<Base64-encoded-certificate>",<br> - /// "dataType":"pfx",<br> - /// "password":"<pfx-file-password>"<br>} <br> To - /// install certificates on a virtual machine it is recommended to use - /// the [Azure Key Vault virtual machine extension for + /// In this case, your certificate needs to be the Base64 encoding of the + /// following JSON Object which is encoded in UTF-8: <br><br> {<br> + /// "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> + /// "password":"<pfx-file-password>"<br>} <br> To install certificates on a + /// virtual machine it is recommended to use the [Azure Key Vault virtual + /// machine extension for /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) /// or the [Azure Key Vault virtual machine extension for - /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + /// public WinRMListener(ProtocolTypes? protocol = default(ProtocolTypes?), string certificateUrl = default(string)) + { - Protocol = protocol; - CertificateUrl = certificateUrl; + this.Protocol = protocol; + this.CertificateUrl = certificateUrl; CustomInit(); } @@ -59,34 +55,30 @@ public WinRMListener() /// partial void CustomInit(); + /// - /// Gets or sets specifies the protocol of WinRM listener. Possible - /// values are: **http,** **https.**. Possible values include: 'Http', - /// 'Https' + /// Gets or sets specifies the protocol of WinRM listener. Possible values are: + /// **http,** **https.** Possible values include: 'Http', 'Https' /// - [JsonProperty(PropertyName = "protocol")] - public ProtocolTypes? Protocol { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "protocol")] + public ProtocolTypes? Protocol {get; set; } /// - /// Gets or sets this is the URL of a certificate that has been - /// uploaded to Key Vault as a secret. For adding a secret to the Key - /// Vault, see [Add a key or secret to the key + /// Gets or sets this is the URL of a certificate that has been uploaded to Key + /// Vault as a secret. For adding a secret to the Key Vault, see [Add a key or + /// secret to the key /// vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). - /// In this case, your certificate needs to be the Base64 encoding of - /// the following JSON Object which is encoded in UTF-8: - /// &lt;br&gt;&lt;br&gt; {&lt;br&gt; - /// "data":"&lt;Base64-encoded-certificate&gt;",&lt;br&gt; - /// "dataType":"pfx",&lt;br&gt; - /// "password":"&lt;pfx-file-password&gt;"&lt;br&gt;} - /// &lt;br&gt; To install certificates on a virtual machine it - /// is recommended to use the [Azure Key Vault virtual machine - /// extension for + /// In this case, your certificate needs to be the Base64 encoding of the + /// following JSON Object which is encoded in UTF-8: <br><br> {<br> + /// "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> + /// "password":"<pfx-file-password>"<br>} <br> To install certificates on a + /// virtual machine it is recommended to use the [Azure Key Vault virtual + /// machine extension for /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) /// or the [Azure Key Vault virtual machine extension for /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). /// - [JsonProperty(PropertyName = "certificateUrl")] - public string CertificateUrl { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "certificateUrl")] + public string CertificateUrl {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsConfiguration.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsConfiguration.cs index a05cac9699f0..3c26fb12b20d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsConfiguration.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsConfiguration.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,39 +23,50 @@ public WindowsConfiguration() /// /// Initializes a new instance of the WindowsConfiguration class. /// - /// Indicates whether virtual machine - /// agent should be provisioned on the virtual machine. When this - /// property is not specified in the request body, it is set to true by - /// default. This will ensure that VM Agent is installed on the VM so - /// that extensions can be added to the VM later. - /// Indicates whether Automatic - /// Updates is enabled for the Windows virtual machine. Default value - /// is true. For virtual machine scale sets, this property can be - /// updated and updates will take effect on OS reprovisioning. - /// Specifies the time zone of the virtual - /// machine. e.g. "Pacific Standard Time". Possible values can be + + /// Indicates whether virtual machine agent should be provisioned on the + /// virtual machine. When this property is not specified in the request body, + /// it is set to true by default. This will ensure that VM Agent is installed + /// on the VM so that extensions can be added to the VM later. + /// + + /// Indicates whether Automatic Updates is enabled for the Windows virtual + /// machine. Default value is true. For virtual machine scale sets, this + /// property can be updated and updates will take effect on OS reprovisioning. + /// + + /// Specifies the time zone of the virtual machine. e.g. "Pacific Standard + /// Time". Possible values can be /// [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) /// value from time zones returned by - /// [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). - /// Specifies additional - /// base-64 encoded XML formatted information that can be included in - /// the Unattend.xml file, which is used by Windows Setup. - /// [Preview Feature] Specifies settings - /// related to VM Guest Patching on Windows. - /// Specifies the Windows Remote Management - /// listeners. This enables remote Windows PowerShell. - /// Indicates whether - /// VMAgent Platform Updates are enabled for the Windows Virtual - /// Machine. - public WindowsConfiguration(bool? provisionVMAgent = default(bool?), bool? enableAutomaticUpdates = default(bool?), string timeZone = default(string), IList additionalUnattendContent = default(IList), PatchSettings patchSettings = default(PatchSettings), WinRMConfiguration winRM = default(WinRMConfiguration), bool? enableVMAgentPlatformUpdates = default(bool?)) + /// [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + /// + + /// Specifies additional base-64 encoded XML formatted information that can be + /// included in the Unattend.xml file, which is used by Windows Setup. + /// + + /// [Preview Feature] Specifies settings related to VM Guest Patching on + /// Windows. + /// + + /// Specifies the Windows Remote Management listeners. This enables remote + /// Windows PowerShell. + /// + + /// Indicates whether VMAgent Platform Updates are enabled for the Windows + /// Virtual Machine. + /// + public WindowsConfiguration(bool? provisionVMAgent = default(bool?), bool? enableAutomaticUpdates = default(bool?), string timeZone = default(string), System.Collections.Generic.IList additionalUnattendContent = default(System.Collections.Generic.IList), PatchSettings patchSettings = default(PatchSettings), WinRMConfiguration winRm = default(WinRMConfiguration), bool? enableVMAgentPlatformUpdates = default(bool?)) + { - ProvisionVMAgent = provisionVMAgent; - EnableAutomaticUpdates = enableAutomaticUpdates; - TimeZone = timeZone; - AdditionalUnattendContent = additionalUnattendContent; - PatchSettings = patchSettings; - WinRM = winRM; - EnableVMAgentPlatformUpdates = enableVMAgentPlatformUpdates; + this.ProvisionVMAgent = provisionVMAgent; + this.EnableAutomaticUpdates = enableAutomaticUpdates; + this.TimeZone = timeZone; + this.AdditionalUnattendContent = additionalUnattendContent; + this.PatchSettings = patchSettings; + this.WinRM = winRm; + this.EnableVMAgentPlatformUpdates = enableVMAgentPlatformUpdates; CustomInit(); } @@ -72,63 +75,62 @@ public WindowsConfiguration() /// partial void CustomInit(); + /// - /// Gets or sets indicates whether virtual machine agent should be - /// provisioned on the virtual machine. When this property is not - /// specified in the request body, it is set to true by default. This - /// will ensure that VM Agent is installed on the VM so that extensions - /// can be added to the VM later. + /// Gets or sets indicates whether virtual machine agent should be provisioned + /// on the virtual machine. When this property is not specified in the request + /// body, it is set to true by default. This will ensure that VM Agent is + /// installed on the VM so that extensions can be added to the VM later. /// - [JsonProperty(PropertyName = "provisionVMAgent")] - public bool? ProvisionVMAgent { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "provisionVMAgent")] + public bool? ProvisionVMAgent {get; set; } /// - /// Gets or sets indicates whether Automatic Updates is enabled for the - /// Windows virtual machine. Default value is true. For virtual machine - /// scale sets, this property can be updated and updates will take - /// effect on OS reprovisioning. + /// Gets or sets indicates whether Automatic Updates is enabled for the Windows + /// virtual machine. Default value is true. For virtual machine scale sets, + /// this property can be updated and updates will take effect on OS + /// reprovisioning. /// - [JsonProperty(PropertyName = "enableAutomaticUpdates")] - public bool? EnableAutomaticUpdates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enableAutomaticUpdates")] + public bool? EnableAutomaticUpdates {get; set; } /// - /// Gets or sets specifies the time zone of the virtual machine. e.g. - /// "Pacific Standard Time". Possible values can be + /// Gets or sets specifies the time zone of the virtual machine. e.g. "Pacific + /// Standard Time". Possible values can be /// [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) /// value from time zones returned by /// [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). /// - [JsonProperty(PropertyName = "timeZone")] - public string TimeZone { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "timeZone")] + public string TimeZone {get; set; } /// - /// Gets or sets specifies additional base-64 encoded XML formatted - /// information that can be included in the Unattend.xml file, which is - /// used by Windows Setup. + /// Gets or sets specifies additional base-64 encoded XML formatted information + /// that can be included in the Unattend.xml file, which is used by Windows + /// Setup. /// - [JsonProperty(PropertyName = "additionalUnattendContent")] - public IList AdditionalUnattendContent { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalUnattendContent")] + public System.Collections.Generic.IList AdditionalUnattendContent {get; set; } /// - /// Gets or sets [Preview Feature] Specifies settings related to VM - /// Guest Patching on Windows. + /// Gets or sets [Preview Feature] Specifies settings related to VM Guest + /// Patching on Windows. /// - [JsonProperty(PropertyName = "patchSettings")] - public PatchSettings PatchSettings { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "patchSettings")] + public PatchSettings PatchSettings {get; set; } /// - /// Gets or sets specifies the Windows Remote Management listeners. - /// This enables remote Windows PowerShell. + /// Gets or sets specifies the Windows Remote Management listeners. This + /// enables remote Windows PowerShell. /// - [JsonProperty(PropertyName = "winRM")] - public WinRMConfiguration WinRM { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "winRM")] + public WinRMConfiguration WinRM {get; set; } /// - /// Gets indicates whether VMAgent Platform Updates are enabled for the - /// Windows Virtual Machine. + /// Gets indicates whether VMAgent Platform Updates are enabled for the Windows + /// Virtual Machine. /// - [JsonProperty(PropertyName = "enableVMAgentPlatformUpdates")] - public bool? EnableVMAgentPlatformUpdates { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "enableVMAgentPlatformUpdates")] + public bool? EnableVMAgentPlatformUpdates {get; private set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsParameters.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsParameters.cs index 7a85fc56b141..199b4bf638a3 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsParameters.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsParameters.cs @@ -1,23 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Input for InstallPatches on a Windows VM, as directly received by the - /// API + /// Input for InstallPatches on a Windows VM, as directly received by the API /// public partial class WindowsParameters { @@ -32,37 +23,45 @@ public WindowsParameters() /// /// Initializes a new instance of the WindowsParameters class. /// - /// The update classifications - /// to select when installing patches for Windows. - /// Kbs to include in the patch - /// operation - /// Kbs to exclude in the patch - /// operation - /// Filters out Kbs that don't - /// have an InstallationRebootBehavior of 'NeverReboots' when this is - /// set to true. - /// This is used to install patches - /// that were published on or before this given max published - /// date. - /// This is used to include - /// patches that match the given patch name masks. Alphanumeric strings - /// and wildcard expressions consisting of * and ? are only supported - /// as input values in the list. Null, empty and only whitespaces - /// strings as inputs values are not supported. - /// This is used to exclude - /// patches that match the given patch name masks. Alphanumeric strings - /// and wildcard expressions consisting of * and ? are only supported - /// as input values in the list. Null, empty and only whitespaces - /// strings as inputs values are not supported. - public WindowsParameters(IList classificationsToInclude = default(IList), IList kbNumbersToInclude = default(IList), IList kbNumbersToExclude = default(IList), bool? excludeKbsRequiringReboot = default(bool?), System.DateTime? maxPatchPublishDate = default(System.DateTime?), IList patchNameMasksToInclude = default(IList), IList patchNameMasksToExclude = default(IList)) + + /// The update classifications to select when installing patches for Windows. + /// + + /// Kbs to include in the patch operation + /// + + /// Kbs to exclude in the patch operation + /// + + /// Filters out Kbs that don't have an InstallationRebootBehavior of + /// 'NeverReboots' when this is set to true. + /// + + /// This is used to install patches that were published on or before this given + /// max published date. + /// + + /// This is used to include patches that match the given patch name masks. + /// Alphanumeric strings and wildcard expressions consisting of * and ? are + /// only supported as input values in the list. Null, empty and only + /// whitespaces strings as inputs values are not supported. + /// + + /// This is used to exclude patches that match the given patch name masks. + /// Alphanumeric strings and wildcard expressions consisting of * and ? are + /// only supported as input values in the list. Null, empty and only + /// whitespaces strings as inputs values are not supported. + /// + public WindowsParameters(System.Collections.Generic.IList classificationsToInclude = default(System.Collections.Generic.IList), System.Collections.Generic.IList kbNumbersToInclude = default(System.Collections.Generic.IList), System.Collections.Generic.IList kbNumbersToExclude = default(System.Collections.Generic.IList), bool? excludeKbsRequiringReboot = default(bool?), System.DateTime? maxPatchPublishDate = default(System.DateTime?), System.Collections.Generic.IList patchNameMasksToInclude = default(System.Collections.Generic.IList), System.Collections.Generic.IList patchNameMasksToExclude = default(System.Collections.Generic.IList)) + { - ClassificationsToInclude = classificationsToInclude; - KbNumbersToInclude = kbNumbersToInclude; - KbNumbersToExclude = kbNumbersToExclude; - ExcludeKbsRequiringReboot = excludeKbsRequiringReboot; - MaxPatchPublishDate = maxPatchPublishDate; - PatchNameMasksToInclude = patchNameMasksToInclude; - PatchNameMasksToExclude = patchNameMasksToExclude; + this.ClassificationsToInclude = classificationsToInclude; + this.KbNumbersToInclude = kbNumbersToInclude; + this.KbNumbersToExclude = kbNumbersToExclude; + this.ExcludeKbsRequiringReboot = excludeKbsRequiringReboot; + this.MaxPatchPublishDate = maxPatchPublishDate; + this.PatchNameMasksToInclude = patchNameMasksToInclude; + this.PatchNameMasksToExclude = patchNameMasksToExclude; CustomInit(); } @@ -71,59 +70,56 @@ public WindowsParameters() /// partial void CustomInit(); + /// - /// Gets or sets the update classifications to select when installing - /// patches for Windows. + /// Gets or sets the update classifications to select when installing patches + /// for Windows. /// - [JsonProperty(PropertyName = "classificationsToInclude")] - public IList ClassificationsToInclude { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "classificationsToInclude")] + public System.Collections.Generic.IList ClassificationsToInclude {get; set; } /// /// Gets or sets kbs to include in the patch operation /// - [JsonProperty(PropertyName = "kbNumbersToInclude")] - public IList KbNumbersToInclude { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "kbNumbersToInclude")] + public System.Collections.Generic.IList KbNumbersToInclude {get; set; } /// /// Gets or sets kbs to exclude in the patch operation /// - [JsonProperty(PropertyName = "kbNumbersToExclude")] - public IList KbNumbersToExclude { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "kbNumbersToExclude")] + public System.Collections.Generic.IList KbNumbersToExclude {get; set; } /// - /// Gets or sets filters out Kbs that don't have an - /// InstallationRebootBehavior of 'NeverReboots' when this is set to - /// true. + /// Gets or sets filters out Kbs that don't have an InstallationRebootBehavior + /// of 'NeverReboots' when this is set to true. /// - [JsonProperty(PropertyName = "excludeKbsRequiringReboot")] - public bool? ExcludeKbsRequiringReboot { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "excludeKbsRequiringReboot")] + public bool? ExcludeKbsRequiringReboot {get; set; } /// - /// Gets or sets this is used to install patches that were published on - /// or before this given max published date. + /// Gets or sets this is used to install patches that were published on or + /// before this given max published date. /// - [JsonProperty(PropertyName = "maxPatchPublishDate")] - public System.DateTime? MaxPatchPublishDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maxPatchPublishDate")] + public System.DateTime? MaxPatchPublishDate {get; set; } /// - /// Gets or sets this is used to include patches that match the given - /// patch name masks. Alphanumeric strings and wildcard expressions - /// consisting of * and ? are only supported as input values in the - /// list. Null, empty and only whitespaces strings as inputs values are - /// not supported. + /// Gets or sets this is used to include patches that match the given patch + /// name masks. Alphanumeric strings and wildcard expressions consisting of * + /// and ? are only supported as input values in the list. Null, empty and only + /// whitespaces strings as inputs values are not supported. /// - [JsonProperty(PropertyName = "patchNameMasksToInclude")] - public IList PatchNameMasksToInclude { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "patchNameMasksToInclude")] + public System.Collections.Generic.IList PatchNameMasksToInclude {get; set; } /// - /// Gets or sets this is used to exclude patches that match the given - /// patch name masks. Alphanumeric strings and wildcard expressions - /// consisting of * and ? are only supported as input values in the - /// list. Null, empty and only whitespaces strings as inputs values are - /// not supported. + /// Gets or sets this is used to exclude patches that match the given patch + /// name masks. Alphanumeric strings and wildcard expressions consisting of * + /// and ? are only supported as input values in the list. Null, empty and only + /// whitespaces strings as inputs values are not supported. /// - [JsonProperty(PropertyName = "patchNameMasksToExclude")] - public IList PatchNameMasksToExclude { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "patchNameMasksToExclude")] + public System.Collections.Generic.IList PatchNameMasksToExclude {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsPatchAssessmentMode.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsPatchAssessmentMode.cs index 04cbb5056aa2..e5857646de49 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsPatchAssessmentMode.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsPatchAssessmentMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for WindowsPatchAssessmentMode. /// + + public static class WindowsPatchAssessmentMode { public const string ImageDefault = "ImageDefault"; public const string AutomaticByPlatform = "AutomaticByPlatform"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.cs index d4720aae929a..b778cb7bdfff 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for WindowsVMGuestPatchAutomaticByPlatformRebootSetting. /// + + public static class WindowsVMGuestPatchAutomaticByPlatformRebootSetting { public const string Unknown = "Unknown"; @@ -21,4 +18,4 @@ public static class WindowsVMGuestPatchAutomaticByPlatformRebootSetting public const string Never = "Never"; public const string Always = "Always"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsVMGuestPatchAutomaticByPlatformSettings.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsVMGuestPatchAutomaticByPlatformSettings.cs index dfc23363798a..27d098cde5c8 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsVMGuestPatchAutomaticByPlatformSettings.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsVMGuestPatchAutomaticByPlatformSettings.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +14,7 @@ namespace Microsoft.Azure.Management.Compute.Models public partial class WindowsVMGuestPatchAutomaticByPlatformSettings { /// - /// Initializes a new instance of the - /// WindowsVMGuestPatchAutomaticByPlatformSettings class. + /// Initializes a new instance of the WindowsVMGuestPatchAutomaticByPlatformSettings class. /// public WindowsVMGuestPatchAutomaticByPlatformSettings() { @@ -29,18 +22,20 @@ public WindowsVMGuestPatchAutomaticByPlatformSettings() } /// - /// Initializes a new instance of the - /// WindowsVMGuestPatchAutomaticByPlatformSettings class. + /// Initializes a new instance of the WindowsVMGuestPatchAutomaticByPlatformSettings class. /// - /// Specifies the reboot setting for all - /// AutomaticByPlatform patch installation operations. Possible values - /// include: 'Unknown', 'IfRequired', 'Never', 'Always' - /// Enables - /// customer to schedule patching without accidental upgrades + + /// Specifies the reboot setting for all AutomaticByPlatform patch installation + /// operations. + /// Possible values include: 'Unknown', 'IfRequired', 'Never', 'Always' + + /// Enables customer to schedule patching without accidental upgrades + /// public WindowsVMGuestPatchAutomaticByPlatformSettings(string rebootSetting = default(string), bool? bypassPlatformSafetyChecksOnUserSchedule = default(bool?)) + { - RebootSetting = rebootSetting; - BypassPlatformSafetyChecksOnUserSchedule = bypassPlatformSafetyChecksOnUserSchedule; + this.RebootSetting = rebootSetting; + this.BypassPlatformSafetyChecksOnUserSchedule = bypassPlatformSafetyChecksOnUserSchedule; CustomInit(); } @@ -49,20 +44,19 @@ public WindowsVMGuestPatchAutomaticByPlatformSettings() /// partial void CustomInit(); + /// - /// Gets or sets specifies the reboot setting for all - /// AutomaticByPlatform patch installation operations. Possible values - /// include: 'Unknown', 'IfRequired', 'Never', 'Always' + /// Gets or sets specifies the reboot setting for all AutomaticByPlatform patch + /// installation operations. Possible values include: 'Unknown', 'IfRequired', 'Never', 'Always' /// - [JsonProperty(PropertyName = "rebootSetting")] - public string RebootSetting { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "rebootSetting")] + public string RebootSetting {get; set; } /// - /// Gets or sets enables customer to schedule patching without - /// accidental upgrades + /// Gets or sets enables customer to schedule patching without accidental + /// upgrades /// - [JsonProperty(PropertyName = "bypassPlatformSafetyChecksOnUserSchedule")] - public bool? BypassPlatformSafetyChecksOnUserSchedule { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "bypassPlatformSafetyChecksOnUserSchedule")] + public bool? BypassPlatformSafetyChecksOnUserSchedule {get; set; } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsVMGuestPatchMode.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsVMGuestPatchMode.cs index e3c4970c7b0f..a9df21a7291f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsVMGuestPatchMode.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/WindowsVMGuestPatchMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for WindowsVMGuestPatchMode. /// + + public static class WindowsVMGuestPatchMode { public const string Manual = "Manual"; public const string AutomaticByOS = "AutomaticByOS"; public const string AutomaticByPlatform = "AutomaticByPlatform"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ZonalPlatformFaultDomainAlignMode.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ZonalPlatformFaultDomainAlignMode.cs index 2e05b8ba8def..fb944aee7a2f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ZonalPlatformFaultDomainAlignMode.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ZonalPlatformFaultDomainAlignMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ZonalPlatformFaultDomainAlignMode. /// + + public static class ZonalPlatformFaultDomainAlignMode { public const string Aligned = "Aligned"; public const string Unaligned = "Unaligned"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ZoneAllocationPolicy.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ZoneAllocationPolicy.cs index 54641380bcf5..545eefb8a2b0 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ZoneAllocationPolicy.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ZoneAllocationPolicy.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { - using Newtonsoft.Json; using System.Linq; /// - /// The configuration parameters for zone allocation of a virtual machine - /// scale set. + /// The configuration parameters for zone allocation of a virtual machine scale + /// set. /// public partial class ZoneAllocationPolicy { @@ -30,16 +24,19 @@ public ZoneAllocationPolicy() /// /// Initializes a new instance of the ZoneAllocationPolicy class. /// - /// The maximum number of availability zones - /// to use if the ZonePlacementPolicy is 'Auto'. If not specified, all - /// availability zones will be used. - /// The configuration - /// parameters used to limit the number of virtual machines per - /// availability zone in the virtual machine scale set. + + /// The maximum number of availability zones to use if the ZonePlacementPolicy + /// is 'Auto'. If not specified, all availability zones will be used. + /// + + /// The configuration parameters used to limit the number of virtual machines + /// per availability zone in the virtual machine scale set. + /// public ZoneAllocationPolicy(int? maxZoneCount = default(int?), MaxInstancePercentPerZonePolicy maxInstancePercentPerZonePolicy = default(MaxInstancePercentPerZonePolicy)) + { - MaxZoneCount = maxZoneCount; - MaxInstancePercentPerZonePolicy = maxInstancePercentPerZonePolicy; + this.MaxZoneCount = maxZoneCount; + this.MaxInstancePercentPerZonePolicy = maxInstancePercentPerZonePolicy; CustomInit(); } @@ -48,34 +45,33 @@ public ZoneAllocationPolicy() /// partial void CustomInit(); + /// /// Gets or sets the maximum number of availability zones to use if the - /// ZonePlacementPolicy is 'Auto'. If not specified, all availability - /// zones will be used. + /// ZonePlacementPolicy is 'Auto'. If not specified, all availability zones + /// will be used. /// - [JsonProperty(PropertyName = "maxZoneCount")] - public int? MaxZoneCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maxZoneCount")] + public int? MaxZoneCount {get; set; } /// - /// Gets or sets the configuration parameters used to limit the number - /// of virtual machines per availability zone in the virtual machine - /// scale set. + /// Gets or sets the configuration parameters used to limit the number of + /// virtual machines per availability zone in the virtual machine scale set. /// - [JsonProperty(PropertyName = "maxInstancePercentPerZonePolicy")] - public MaxInstancePercentPerZonePolicy MaxInstancePercentPerZonePolicy { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "maxInstancePercentPerZonePolicy")] + public MaxInstancePercentPerZonePolicy MaxInstancePercentPerZonePolicy {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (MaxInstancePercentPerZonePolicy != null) + if (this.MaxInstancePercentPerZonePolicy != null) { - MaxInstancePercentPerZonePolicy.Validate(); + this.MaxInstancePercentPerZonePolicy.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Models/ZonePlacementPolicyType.cs b/src/Compute/Compute.Management.Sdk/Generated/Models/ZonePlacementPolicyType.cs index 61ec4aea8bae..db5b2c973107 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Models/ZonePlacementPolicyType.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Models/ZonePlacementPolicyType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.Compute.Models /// /// Defines values for ZonePlacementPolicyType. /// + + public static class ZonePlacementPolicyType { public const string Any = "Any"; @@ -22,4 +19,4 @@ public static class ZonePlacementPolicyType /// public const string Auto = "Auto"; } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/Operations.cs b/src/Compute/Compute.Management.Sdk/Generated/Operations.cs index d283710ea619..bec298e7067c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/Operations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/Operations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// Operations operations. /// - internal partial class Operations : IServiceOperations, IOperations + internal partial class Operations : Microsoft.Rest.IServiceOperations, IOperations { /// /// Initializes a new instance of the Operations class. @@ -36,13 +24,13 @@ internal partial class Operations : IServiceOperations, /// /// Thrown when a required parameter is null /// - internal Operations(ComputeManagementClient client) + internal Operations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,33 +47,47 @@ internal Operations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Compute/operations").ToString(); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -95,25 +97,24 @@ internal Operations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -125,55 +126,56 @@ internal Operations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -183,9 +185,10 @@ internal Operations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -196,24 +199,28 @@ internal Operations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/OperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/OperationsExtensions.cs index 0702941d0fee..c2c5fe6a2367 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/OperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/OperationsExtensions.cs @@ -1,55 +1,43 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for Operations. + /// Extension methods for Operations /// public static partial class OperationsExtensions { - /// - /// List the operations for the provider - /// - /// - /// The operations group for this extension method. - /// - public static IEnumerable List(this IOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } + /// + /// List the operations for the provider + /// + /// + /// The operations group for this extension method. + /// + public static System.Collections.Generic.IEnumerable List(this IOperations operations) + { + return ((IOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// List the operations for the provider - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List the operations for the provider + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/ProximityPlacementGroupsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ProximityPlacementGroupsOperations.cs index 7e1910dd916c..ebb68821a752 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ProximityPlacementGroupsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ProximityPlacementGroupsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ProximityPlacementGroupsOperations operations. /// - internal partial class ProximityPlacementGroupsOperations : IServiceOperations, IProximityPlacementGroupsOperations + internal partial class ProximityPlacementGroupsOperations : Microsoft.Rest.IServiceOperations, IProximityPlacementGroupsOperations { /// /// Initializes a new instance of the ProximityPlacementGroupsOperations class. @@ -36,13 +24,13 @@ internal partial class ProximityPlacementGroupsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ProximityPlacementGroupsOperations(ComputeManagementClient client) + internal ProximityPlacementGroupsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -74,29 +62,38 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -106,25 +103,24 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -136,55 +132,56 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -194,9 +191,10 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -207,25 +205,29 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all proximity placement groups in a resource group. /// @@ -238,13 +240,13 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -253,46 +255,55 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -302,25 +313,24 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -332,55 +342,56 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -390,9 +401,10 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -403,25 +415,29 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves information about a proximity placement group . /// @@ -441,13 +457,13 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -456,53 +472,64 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, string includeColocationStatus = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, string includeColocationStatus = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (proximityPlacementGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "proximityPlacementGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "proximityPlacementGroupName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("proximityPlacementGroupName", proximityPlacementGroupName); tracingParameters.Add("includeColocationStatus", includeColocationStatus); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{proximityPlacementGroupName}", System.Uri.EscapeDataString(proximityPlacementGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -516,25 +543,24 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -546,55 +572,56 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -604,9 +631,10 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -617,25 +645,29 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a proximity placement group. /// @@ -654,13 +686,13 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -669,61 +701,71 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, ProximityPlacementGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, ProximityPlacementGroup parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + parameters.Validate(); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (proximityPlacementGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "proximityPlacementGroupName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "proximityPlacementGroupName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("proximityPlacementGroupName", proximityPlacementGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{proximityPlacementGroupName}", System.Uri.EscapeDataString(proximityPlacementGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -733,25 +775,24 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -763,61 +804,62 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -827,9 +869,10 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -840,16 +883,16 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -858,25 +901,29 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update a proximity placement group. /// @@ -895,13 +942,13 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -910,58 +957,68 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (proximityPlacementGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "proximityPlacementGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "proximityPlacementGroupName"); } + string apiVersion = "2025-04-01"; ProximityPlacementGroupUpdate parameters = new ProximityPlacementGroupUpdate(); - if (tags != null) + if(tags != null) { parameters.Tags = tags; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("proximityPlacementGroupName", proximityPlacementGroupName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{proximityPlacementGroupName}", System.Uri.EscapeDataString(proximityPlacementGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -971,25 +1028,24 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1001,61 +1057,62 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1065,9 +1122,10 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1078,25 +1136,29 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete a proximity placement group. /// @@ -1112,10 +1174,10 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1124,52 +1186,62 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string proximityPlacementGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (proximityPlacementGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "proximityPlacementGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "proximityPlacementGroupName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("proximityPlacementGroupName", proximityPlacementGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{proximityPlacementGroupName}", System.Uri.EscapeDataString(proximityPlacementGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1179,25 +1251,24 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1209,55 +1280,56 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1267,20 +1339,25 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all proximity placement groups in a subscription. /// @@ -1293,13 +1370,13 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1308,51 +1385,54 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1364,55 +1444,56 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1422,9 +1503,10 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1435,25 +1517,29 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all proximity placement groups in a resource group. /// @@ -1466,13 +1552,13 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1481,51 +1567,54 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1537,55 +1626,56 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1595,9 +1685,10 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1608,24 +1699,28 @@ internal ProximityPlacementGroupsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/ProximityPlacementGroupsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/ProximityPlacementGroupsOperationsExtensions.cs index 6ee92e7b4b65..db0bad2d2e39 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ProximityPlacementGroupsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ProximityPlacementGroupsOperationsExtensions.cs @@ -1,334 +1,303 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ProximityPlacementGroupsOperations. + /// Extension methods for ProximityPlacementGroupsOperations /// public static partial class ProximityPlacementGroupsOperationsExtensions { - /// - /// Lists all proximity placement groups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListBySubscription(this IProximityPlacementGroupsOperations operations) - { - return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all proximity placement groups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IProximityPlacementGroupsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all proximity placement groups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage ListByResourceGroup(this IProximityPlacementGroupsOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } + /// + /// Lists all proximity placement groups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscription(this IProximityPlacementGroupsOperations operations) + { + return ((IProximityPlacementGroupsOperations)operations).ListBySubscriptionAsync().GetAwaiter().GetResult(); + } - /// - /// Lists all proximity placement groups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IProximityPlacementGroupsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all proximity placement groups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this IProximityPlacementGroupsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all proximity placement groups in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IProximityPlacementGroupsOperations operations, string resourceGroupName) + { + return ((IProximityPlacementGroupsOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Retrieves information about a proximity placement group . - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// includeColocationStatus=true enables fetching the colocation status of all - /// the resources in the proximity placement group. - /// - public static ProximityPlacementGroup Get(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, string includeColocationStatus = default(string)) + /// + /// Lists all proximity placement groups in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IProximityPlacementGroupsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, proximityPlacementGroupName, includeColocationStatus).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves information about a proximity placement group . + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the proximity placement group. + /// + /// + /// includeColocationStatus=true enables fetching the colocation status of all + /// the resources in the proximity placement group. + /// + public static ProximityPlacementGroup Get(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, string includeColocationStatus = default(string)) + { + return ((IProximityPlacementGroupsOperations)operations).GetAsync(resourceGroupName, proximityPlacementGroupName, includeColocationStatus).GetAwaiter().GetResult(); + } - /// - /// Retrieves information about a proximity placement group . - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// includeColocationStatus=true enables fetching the colocation status of all - /// the resources in the proximity placement group. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, string includeColocationStatus = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves information about a proximity placement group . + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the proximity placement group. + /// + /// + /// includeColocationStatus=true enables fetching the colocation status of all + /// the resources in the proximity placement group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, string includeColocationStatus = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, proximityPlacementGroupName, includeColocationStatus, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, proximityPlacementGroupName, includeColocationStatus, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Create or update a proximity placement group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the proximity placement group. + /// + public static ProximityPlacementGroup CreateOrUpdate(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, ProximityPlacementGroup parameters) + { + return ((IProximityPlacementGroupsOperations)operations).CreateOrUpdateAsync(resourceGroupName, proximityPlacementGroupName, parameters).GetAwaiter().GetResult(); + } - /// - /// Create or update a proximity placement group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// Parameters supplied to the Create Proximity Placement Group operation. - /// - public static ProximityPlacementGroup CreateOrUpdate(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, ProximityPlacementGroup parameters) + /// + /// Create or update a proximity placement group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the proximity placement group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, ProximityPlacementGroup parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, proximityPlacementGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, proximityPlacementGroupName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update a proximity placement group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the proximity placement group. + /// + public static ProximityPlacementGroup Update(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { + return ((IProximityPlacementGroupsOperations)operations).UpdateAsync(resourceGroupName, proximityPlacementGroupName, tags).GetAwaiter().GetResult(); + } - /// - /// Create or update a proximity placement group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// Parameters supplied to the Create Proximity Placement Group operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, ProximityPlacementGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update a proximity placement group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the proximity placement group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, proximityPlacementGroupName, tags, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, proximityPlacementGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete a proximity placement group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the proximity placement group. + /// + public static void Delete(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName) + { + ((IProximityPlacementGroupsOperations)operations).DeleteAsync(resourceGroupName, proximityPlacementGroupName).GetAwaiter().GetResult(); + } - /// - /// Update a proximity placement group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// Resource tags - /// - public static ProximityPlacementGroup Update(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, IDictionary tags = default(IDictionary)) - { - return operations.UpdateAsync(resourceGroupName, proximityPlacementGroupName, tags).GetAwaiter().GetResult(); - } - - /// - /// Update a proximity placement group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// Resource tags - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, proximityPlacementGroupName, tags, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Delete a proximity placement group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the proximity placement group. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, proximityPlacementGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all proximity placement groups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionNext(this IProximityPlacementGroupsOperations operations, string nextPageLink) + { + return ((IProximityPlacementGroupsOperations)operations).ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Delete a proximity placement group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the proximity placement group. - /// - public static void Delete(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName) + /// + /// Lists all proximity placement groups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionNextAsync(this IProximityPlacementGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, proximityPlacementGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists all proximity placement groups in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IProximityPlacementGroupsOperations operations, string nextPageLink) + { + return ((IProximityPlacementGroupsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Delete a proximity placement group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the proximity placement group. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IProximityPlacementGroupsOperations operations, string resourceGroupName, string proximityPlacementGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all proximity placement groups in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IProximityPlacementGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, proximityPlacementGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Lists all proximity placement groups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this IProximityPlacementGroupsOperations operations, string nextPageLink) - { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all proximity placement groups in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this IProximityPlacementGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all proximity placement groups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IProximityPlacementGroupsOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all proximity placement groups in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IProximityPlacementGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/ResourceSkusOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/ResourceSkusOperations.cs index 8d62052c1f02..35c6e5a69538 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ResourceSkusOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ResourceSkusOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ResourceSkusOperations operations. /// - internal partial class ResourceSkusOperations : IServiceOperations, IResourceSkusOperations + internal partial class ResourceSkusOperations : Microsoft.Rest.IServiceOperations, IResourceSkusOperations { /// /// Initializes a new instance of the ResourceSkusOperations class. @@ -36,13 +24,13 @@ internal partial class ResourceSkusOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ResourceSkusOperations(ComputeManagementClient client) + internal ResourceSkusOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -66,13 +54,13 @@ internal ResourceSkusOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -81,31 +69,42 @@ internal ResourceSkusOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string filter = default(string), string includeExtendedLocations = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string filter = default(string), string includeExtendedLocations = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + + string apiVersion = "2021-07-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); tracingParameters.Add("includeExtendedLocations", includeExtendedLocations); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -123,25 +122,24 @@ internal ResourceSkusOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -153,50 +151,51 @@ internal ResourceSkusOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -206,9 +205,10 @@ internal ResourceSkusOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -219,25 +219,29 @@ internal ResourceSkusOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the list of Microsoft.Compute SKUs available for your Subscription. /// @@ -250,13 +254,13 @@ internal ResourceSkusOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -265,51 +269,54 @@ internal ResourceSkusOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -321,50 +328,51 @@ internal ResourceSkusOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -374,9 +382,10 @@ internal ResourceSkusOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -387,24 +396,28 @@ internal ResourceSkusOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/ResourceSkusOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/ResourceSkusOperationsExtensions.cs index 817c32a97875..437780ba065c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/ResourceSkusOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/ResourceSkusOperationsExtensions.cs @@ -1,101 +1,90 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ResourceSkusOperations. + /// Extension methods for ResourceSkusOperations /// public static partial class ResourceSkusOperationsExtensions { - /// - /// Gets the list of Microsoft.Compute SKUs available for your Subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The filter to apply on the operation. Only **location** filter is supported - /// currently. - /// - /// - /// To Include Extended Locations information or not in the response. - /// - public static IPage List(this IResourceSkusOperations operations, string filter = default(string), string includeExtendedLocations = default(string)) - { - return operations.ListAsync(filter, includeExtendedLocations).GetAwaiter().GetResult(); - } + /// + /// Gets the list of Microsoft.Compute SKUs available for your Subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The filter to apply on the operation. Only **location** filter is supported + /// currently. + /// + /// + /// To Include Extended Locations information or not in the response. + /// + public static Microsoft.Rest.Azure.IPage List(this IResourceSkusOperations operations, string filter = default(string), string includeExtendedLocations = default(string)) + { + return ((IResourceSkusOperations)operations).ListAsync(filter, includeExtendedLocations).GetAwaiter().GetResult(); + } - /// - /// Gets the list of Microsoft.Compute SKUs available for your Subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The filter to apply on the operation. Only **location** filter is supported - /// currently. - /// - /// - /// To Include Extended Locations information or not in the response. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IResourceSkusOperations operations, string filter = default(string), string includeExtendedLocations = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the list of Microsoft.Compute SKUs available for your Subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The filter to apply on the operation. Only **location** filter is supported + /// currently. + /// + /// + /// To Include Extended Locations information or not in the response. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IResourceSkusOperations operations, string filter = default(string), string includeExtendedLocations = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(filter, includeExtendedLocations, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(filter, includeExtendedLocations, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets the list of Microsoft.Compute SKUs available for your Subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IResourceSkusOperations operations, string nextPageLink) + { + return ((IResourceSkusOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets the list of Microsoft.Compute SKUs available for your Subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IResourceSkusOperations operations, string nextPageLink) + /// + /// Gets the list of Microsoft.Compute SKUs available for your Subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IResourceSkusOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets the list of Microsoft.Compute SKUs available for your Subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IResourceSkusOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/RestorePointCollectionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/RestorePointCollectionsOperations.cs index ed1d47bca1e7..dba3edd70e41 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/RestorePointCollectionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/RestorePointCollectionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// RestorePointCollectionsOperations operations. /// - internal partial class RestorePointCollectionsOperations : IServiceOperations, IRestorePointCollectionsOperations + internal partial class RestorePointCollectionsOperations : Microsoft.Rest.IServiceOperations, IRestorePointCollectionsOperations { /// /// Initializes a new instance of the RestorePointCollectionsOperations class. @@ -36,13 +24,13 @@ internal partial class RestorePointCollectionsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal RestorePointCollectionsOperations(ComputeManagementClient client) + internal RestorePointCollectionsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -62,13 +50,13 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -77,29 +65,38 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/restorePointCollections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -109,25 +106,24 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -139,55 +135,56 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -197,9 +194,10 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -210,25 +208,29 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the list of restore point collections in a resource group. /// @@ -241,13 +243,13 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -256,46 +258,55 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -305,25 +316,24 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -335,55 +345,56 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -393,9 +404,10 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -406,25 +418,29 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to get the restore point collection. /// @@ -437,7 +453,7 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// /// The expand expression to apply on the operation. If expand=restorePoints, /// server will return all contained restore points in the - /// restorePointCollection. Possible values include: 'restorePoints' + /// restorePointCollection. /// /// /// Headers that will be added to request. @@ -445,13 +461,13 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -460,53 +476,64 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (restorePointCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restorePointCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "restorePointCollectionName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("restorePointCollectionName", restorePointCollectionName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{restorePointCollectionName}", System.Uri.EscapeDataString(restorePointCollectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -520,25 +547,24 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -550,55 +576,56 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -608,9 +635,10 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -621,25 +649,29 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to create or update the restore point collection. Please /// refer to https://aka.ms/RestorePoints for more details. When updating a @@ -661,13 +693,13 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -676,61 +708,71 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, RestorePointCollection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, RestorePointCollection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (restorePointCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restorePointCollectionName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "restorePointCollectionName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("restorePointCollectionName", restorePointCollectionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{restorePointCollectionName}", System.Uri.EscapeDataString(restorePointCollectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -740,25 +782,24 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -770,61 +811,62 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -834,9 +876,10 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -847,16 +890,16 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -865,25 +908,29 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to update the restore point collection. /// @@ -902,13 +949,13 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -917,57 +964,67 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, RestorePointCollectionUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, RestorePointCollectionUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (restorePointCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restorePointCollectionName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "restorePointCollectionName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("restorePointCollectionName", restorePointCollectionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{restorePointCollectionName}", System.Uri.EscapeDataString(restorePointCollectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -977,25 +1034,24 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1007,61 +1063,62 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1071,9 +1128,10 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1084,25 +1142,29 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to delete the restore point collection. This operation will /// also delete all the contained restore points. @@ -1114,16 +1176,16 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// The name of the restore point collection. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1142,10 +1204,10 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1154,52 +1216,62 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (restorePointCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restorePointCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "restorePointCollectionName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("restorePointCollectionName", restorePointCollectionName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{restorePointCollectionName}", System.Uri.EscapeDataString(restorePointCollectionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1209,25 +1281,24 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1239,55 +1310,56 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1297,20 +1369,25 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the list of restore point collections in the subscription. Use /// nextLink property in the response to get the next page of restore point @@ -1326,13 +1403,13 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1341,51 +1418,54 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1397,55 +1477,56 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1455,9 +1536,10 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1468,25 +1550,29 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the list of restore point collections in a resource group. /// @@ -1499,13 +1585,13 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1514,51 +1600,54 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1570,55 +1659,56 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1628,9 +1718,10 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1641,24 +1732,28 @@ internal RestorePointCollectionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/RestorePointCollectionsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/RestorePointCollectionsOperationsExtensions.cs index dc33eb00e4d8..bae6065c972e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/RestorePointCollectionsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/RestorePointCollectionsOperationsExtensions.cs @@ -1,393 +1,361 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for RestorePointCollectionsOperations. + /// Extension methods for RestorePointCollectionsOperations /// public static partial class RestorePointCollectionsOperationsExtensions { - /// - /// Gets the list of restore point collections in the subscription. Use - /// nextLink property in the response to get the next page of restore point - /// collections. Do this till nextLink is not null to fetch all the restore - /// point collections. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this IRestorePointCollectionsOperations operations) - { - return operations.ListAllAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets the list of restore point collections in the subscription. Use - /// nextLink property in the response to get the next page of restore point - /// collections. Do this till nextLink is not null to fetch all the restore - /// point collections. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this IRestorePointCollectionsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the list of restore point collections in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage List(this IRestorePointCollectionsOperations operations, string resourceGroupName) - { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets the list of restore point collections in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IRestorePointCollectionsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to get the restore point collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// The expand expression to apply on the operation. If expand=restorePoints, - /// server will return all contained restore points in the - /// restorePointCollection. Possible values include: 'restorePoints' - /// - public static RestorePointCollection Get(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, restorePointCollectionName, expand).GetAwaiter().GetResult(); - } - - /// - /// The operation to get the restore point collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// The expand expression to apply on the operation. If expand=restorePoints, - /// server will return all contained restore points in the - /// restorePointCollection. Possible values include: 'restorePoints' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to create or update the restore point collection. Please - /// refer to https://aka.ms/RestorePoints for more details. When updating a - /// restore point collection, only tags may be modified. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// Parameters supplied to the Create or Update restore point collection - /// operation. - /// - public static RestorePointCollection CreateOrUpdate(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName, RestorePointCollection parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, restorePointCollectionName, parameters).GetAwaiter().GetResult(); - } - - /// - /// The operation to create or update the restore point collection. Please - /// refer to https://aka.ms/RestorePoints for more details. When updating a - /// restore point collection, only tags may be modified. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// Parameters supplied to the Create or Update restore point collection - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName, RestorePointCollection parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Gets the list of restore point collections in the subscription. Use + /// nextLink property in the response to get the next page of restore point + /// collections. Do this till nextLink is not null to fetch all the restore + /// point collections. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this IRestorePointCollectionsOperations operations) + { + return ((IRestorePointCollectionsOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } - /// - /// The operation to update the restore point collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// Parameters supplied to the Update restore point collection operation. - /// - public static RestorePointCollection Update(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName, RestorePointCollectionUpdate parameters) + /// + /// Gets the list of restore point collections in the subscription. Use + /// nextLink property in the response to get the next page of restore point + /// collections. Do this till nextLink is not null to fetch all the restore + /// point collections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this IRestorePointCollectionsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(resourceGroupName, restorePointCollectionName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets the list of restore point collections in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage List(this IRestorePointCollectionsOperations operations, string resourceGroupName) + { + return ((IRestorePointCollectionsOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// The operation to update the restore point collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// Parameters supplied to the Update restore point collection operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName, RestorePointCollectionUpdate parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the list of restore point collections in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IRestorePointCollectionsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// The operation to get the restore point collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + /// + /// The expand expression to apply on the operation. If expand=restorePoints, + /// server will return all contained restore points in the + /// restorePointCollection. + /// + public static RestorePointCollection Get(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName, string expand = default(string)) + { + return ((IRestorePointCollectionsOperations)operations).GetAsync(resourceGroupName, restorePointCollectionName, expand).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the restore point collection. This operation will - /// also delete all the contained restore points. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - public static void Delete(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName) + /// + /// The operation to get the restore point collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + /// + /// The expand expression to apply on the operation. If expand=restorePoints, + /// server will return all contained restore points in the + /// restorePointCollection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, expand, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, restorePointCollectionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to create or update the restore point collection. Please + /// refer to https://aka.ms/RestorePoints for more details. When updating a + /// restore point collection, only tags may be modified. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + public static RestorePointCollection CreateOrUpdate(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName, RestorePointCollection parameters) + { + return ((IRestorePointCollectionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, restorePointCollectionName, parameters).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the restore point collection. This operation will - /// also delete all the contained restore points. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to create or update the restore point collection. Please + /// refer to https://aka.ms/RestorePoints for more details. When updating a + /// restore point collection, only tags may be modified. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName, RestorePointCollection parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// The operation to update the restore point collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + public static RestorePointCollection Update(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName, RestorePointCollectionUpdate parameters) + { + return ((IRestorePointCollectionsOperations)operations).UpdateAsync(resourceGroupName, restorePointCollectionName, parameters).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the restore point collection. This operation will - /// also delete all the contained restore points. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - public static void BeginDelete(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName) + /// + /// The operation to update the restore point collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName, RestorePointCollectionUpdate parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, restorePointCollectionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to delete the restore point collection. This operation will + /// also delete all the contained restore points. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + public static void Delete(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName) + { + ((IRestorePointCollectionsOperations)operations).DeleteAsync(resourceGroupName, restorePointCollectionName).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the restore point collection. This operation will - /// also delete all the contained restore points. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the list of restore point collections in the subscription. Use - /// nextLink property in the response to get the next page of restore point - /// collections. Do this till nextLink is not null to fetch all the restore - /// point collections. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this IRestorePointCollectionsOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } + /// + /// The operation to delete the restore point collection. This operation will + /// also delete all the contained restore points. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to delete the restore point collection. This operation will + /// also delete all the contained restore points. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + public static void BeginDelete(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName) + { + ((IRestorePointCollectionsOperations)operations).BeginDeleteAsync(resourceGroupName, restorePointCollectionName).GetAwaiter().GetResult(); + } - /// - /// Gets the list of restore point collections in the subscription. Use - /// nextLink property in the response to get the next page of restore point - /// collections. Do this till nextLink is not null to fetch all the restore - /// point collections. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this IRestorePointCollectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// The operation to delete the restore point collection. This operation will + /// also delete all the contained restore points. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IRestorePointCollectionsOperations operations, string resourceGroupName, string restorePointCollectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the list of restore point collections in the subscription. Use + /// nextLink property in the response to get the next page of restore point + /// collections. Do this till nextLink is not null to fetch all the restore + /// point collections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this IRestorePointCollectionsOperations operations, string nextPageLink) + { + return ((IRestorePointCollectionsOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets the list of restore point collections in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IRestorePointCollectionsOperations operations, string nextPageLink) + /// + /// Gets the list of restore point collections in the subscription. Use + /// nextLink property in the response to get the next page of restore point + /// collections. Do this till nextLink is not null to fetch all the restore + /// point collections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this IRestorePointCollectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets the list of restore point collections in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRestorePointCollectionsOperations operations, string nextPageLink) + { + return ((IRestorePointCollectionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets the list of restore point collections in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IRestorePointCollectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the list of restore point collections in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IRestorePointCollectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/RestorePointsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/RestorePointsOperations.cs index 1e4af1a407cd..7a23f3afa5f5 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/RestorePointsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/RestorePointsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// RestorePointsOperations operations. /// - internal partial class RestorePointsOperations : IServiceOperations, IRestorePointsOperations + internal partial class RestorePointsOperations : Microsoft.Rest.IServiceOperations, IRestorePointsOperations { /// /// Initializes a new instance of the RestorePointsOperations class. @@ -36,13 +24,13 @@ internal partial class RestorePointsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal RestorePointsOperations(ComputeManagementClient client) + internal RestorePointsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,9 +51,8 @@ internal RestorePointsOperations(ComputeManagementClient client) /// The name of the restore point. /// /// - /// The expand expression to apply on the operation. 'InstanceView' retrieves - /// information about the run-time state of a restore point. Possible values - /// include: 'instanceView' + /// The expand expression to apply on the operation. 'InstanceView' retrieves + /// information about the run-time state of a restore point. /// /// /// Headers that will be added to request. @@ -73,13 +60,13 @@ internal RestorePointsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -88,59 +75,71 @@ internal RestorePointsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (restorePointCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restorePointCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "restorePointCollectionName"); } + if (restorePointName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restorePointName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "restorePointName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("restorePointCollectionName", restorePointCollectionName); tracingParameters.Add("restorePointName", restorePointName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{restorePointCollectionName}", System.Uri.EscapeDataString(restorePointCollectionName)); _url = _url.Replace("{restorePointName}", System.Uri.EscapeDataString(restorePointName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -154,25 +153,24 @@ internal RestorePointsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -184,55 +182,56 @@ internal RestorePointsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -242,9 +241,10 @@ internal RestorePointsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -255,25 +255,29 @@ internal RestorePointsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to create the restore point. Updating properties of an /// existing restore point is not allowed @@ -291,16 +295,16 @@ internal RestorePointsOperations(ComputeManagementClient client) /// Parameters supplied to the Create restore point operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, RestorePoint parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, RestorePoint parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -316,16 +320,16 @@ internal RestorePointsOperations(ComputeManagementClient client) /// The name of the restore point. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, restorePointName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, restorePointName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -350,13 +354,13 @@ internal RestorePointsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -365,67 +369,78 @@ internal RestorePointsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, RestorePoint parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, RestorePoint parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (restorePointCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restorePointCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "restorePointCollectionName"); } + if (restorePointName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restorePointName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "restorePointName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("restorePointCollectionName", restorePointCollectionName); tracingParameters.Add("restorePointName", restorePointName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{restorePointCollectionName}", System.Uri.EscapeDataString(restorePointCollectionName)); _url = _url.Replace("{restorePointName}", System.Uri.EscapeDataString(restorePointName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -435,25 +450,24 @@ internal RestorePointsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -465,61 +479,62 @@ internal RestorePointsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -529,9 +544,10 @@ internal RestorePointsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -542,38 +558,42 @@ internal RestorePointsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to delete the restore point. /// @@ -592,10 +612,10 @@ internal RestorePointsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -604,58 +624,69 @@ internal RestorePointsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string restorePointCollectionName, string restorePointName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (restorePointCollectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restorePointCollectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "restorePointCollectionName"); } + if (restorePointName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restorePointName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "restorePointName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("restorePointCollectionName", restorePointCollectionName); tracingParameters.Add("restorePointName", restorePointName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{restorePointCollectionName}", System.Uri.EscapeDataString(restorePointCollectionName)); _url = _url.Replace("{restorePointName}", System.Uri.EscapeDataString(restorePointName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -665,25 +696,24 @@ internal RestorePointsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -695,55 +725,56 @@ internal RestorePointsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -753,19 +784,24 @@ internal RestorePointsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/RestorePointsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/RestorePointsOperationsExtensions.cs index 0074497a476d..293b8a448c98 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/RestorePointsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/RestorePointsOperationsExtensions.cs @@ -1,275 +1,247 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for RestorePointsOperations. + /// Extension methods for RestorePointsOperations /// public static partial class RestorePointsOperationsExtensions { - /// - /// The operation to get the restore point. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// The name of the restore point. - /// - /// - /// The expand expression to apply on the operation. 'InstanceView' retrieves - /// information about the run-time state of a restore point. Possible values - /// include: 'instanceView' - /// - public static RestorePoint Get(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, restorePointCollectionName, restorePointName, expand).GetAwaiter().GetResult(); - } - - /// - /// The operation to get the restore point. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// The name of the restore point. - /// - /// - /// The expand expression to apply on the operation. 'InstanceView' retrieves - /// information about the run-time state of a restore point. Possible values - /// include: 'instanceView' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, restorePointName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to create the restore point. Updating properties of an - /// existing restore point is not allowed - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// The name of the restore point. - /// - /// - /// Parameters supplied to the Create restore point operation. - /// - public static RestorePoint Create(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName, RestorePoint parameters) - { - return operations.CreateAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters).GetAwaiter().GetResult(); - } - - /// - /// The operation to create the restore point. Updating properties of an - /// existing restore point is not allowed - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// The name of the restore point. - /// - /// - /// Parameters supplied to the Create restore point operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName, RestorePoint parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to delete the restore point. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// The name of the restore point. - /// - public static void Delete(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName) - { - operations.DeleteAsync(resourceGroupName, restorePointCollectionName, restorePointName).GetAwaiter().GetResult(); - } + /// + /// The operation to get the restore point. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + /// + /// The name of the restore point. + /// + /// + /// The expand expression to apply on the operation. 'InstanceView' retrieves + /// information about the run-time state of a restore point. + /// + public static RestorePoint Get(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName, string expand = default(string)) + { + return ((IRestorePointsOperations)operations).GetAsync(resourceGroupName, restorePointCollectionName, restorePointName, expand).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the restore point. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// The name of the restore point. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to get the restore point. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + /// + /// The name of the restore point. + /// + /// + /// The expand expression to apply on the operation. 'InstanceView' retrieves + /// information about the run-time state of a restore point. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, restorePointName, expand, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, restorePointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// The operation to create the restore point. Updating properties of an + /// existing restore point is not allowed + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + /// + /// The name of the restore point. + /// + public static RestorePoint Create(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName, RestorePoint parameters) + { + return ((IRestorePointsOperations)operations).CreateAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters).GetAwaiter().GetResult(); + } - /// - /// The operation to create the restore point. Updating properties of an - /// existing restore point is not allowed - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// The name of the restore point. - /// - /// - /// Parameters supplied to the Create restore point operation. - /// - public static RestorePoint BeginCreate(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName, RestorePoint parameters) + /// + /// The operation to create the restore point. Updating properties of an + /// existing restore point is not allowed + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + /// + /// The name of the restore point. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateAsync(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName, RestorePoint parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to delete the restore point. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + /// + /// The name of the restore point. + /// + public static void Delete(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName) + { + ((IRestorePointsOperations)operations).DeleteAsync(resourceGroupName, restorePointCollectionName, restorePointName).GetAwaiter().GetResult(); + } - /// - /// The operation to create the restore point. Updating properties of an - /// existing restore point is not allowed - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// The name of the restore point. - /// - /// - /// Parameters supplied to the Create restore point operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateAsync(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName, RestorePoint parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to delete the restore point. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// The name of the restore point. - /// - public static void BeginDelete(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName) - { - operations.BeginDeleteAsync(resourceGroupName, restorePointCollectionName, restorePointName).GetAwaiter().GetResult(); - } + /// + /// The operation to delete the restore point. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + /// + /// The name of the restore point. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, restorePointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to create the restore point. Updating properties of an + /// existing restore point is not allowed + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + /// + /// The name of the restore point. + /// + public static RestorePoint BeginCreate(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName, RestorePoint parameters) + { + return ((IRestorePointsOperations)operations).BeginCreateAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the restore point. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the restore point collection. - /// - /// - /// The name of the restore point. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to create the restore point. Updating properties of an + /// existing restore point is not allowed + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + /// + /// The name of the restore point. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateAsync(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName, RestorePoint parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, restorePointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// The operation to delete the restore point. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + /// + /// The name of the restore point. + /// + public static void BeginDelete(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName) + { + ((IRestorePointsOperations)operations).BeginDeleteAsync(resourceGroupName, restorePointCollectionName, restorePointName).GetAwaiter().GetResult(); + } + /// + /// The operation to delete the restore point. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the restore point collection. + /// + /// + /// The name of the restore point. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IRestorePointsOperations operations, string resourceGroupName, string restorePointCollectionName, string restorePointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, restorePointCollectionName, restorePointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/SdkInfo_ComputeManagementClient.cs b/src/Compute/Compute.Management.Sdk/Generated/SdkInfo_ComputeManagementClient.cs deleted file mode 100644 index 0796b395cbf1..000000000000 --- a/src/Compute/Compute.Management.Sdk/Generated/SdkInfo_ComputeManagementClient.cs +++ /dev/null @@ -1,73 +0,0 @@ - -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_ComputeManagementClient - { - get - { - return new Tuple[] - { - new Tuple("Compute", "AvailabilitySets", "2025-04-01"), - new Tuple("Compute", "CapacityReservationGroups", "2025-04-01"), - new Tuple("Compute", "CapacityReservations", "2025-04-01"), - new Tuple("Compute", "CommunityGalleries", "2024-03-03"), - new Tuple("Compute", "CommunityGalleryImageVersions", "2024-03-03"), - new Tuple("Compute", "CommunityGalleryImages", "2024-03-03"), - new Tuple("Compute", "DedicatedHostGroups", "2025-04-01"), - new Tuple("Compute", "DedicatedHosts", "2025-04-01"), - new Tuple("Compute", "DiskAccesses", "2025-01-02"), - new Tuple("Compute", "DiskEncryptionSets", "2025-01-02"), - new Tuple("Compute", "DiskRestorePoint", "2025-01-02"), - new Tuple("Compute", "Disks", "2025-01-02"), - new Tuple("Compute", "Galleries", "2024-03-03"), - new Tuple("Compute", "GalleryApplicationVersions", "2024-03-03"), - new Tuple("Compute", "GalleryApplications", "2024-03-03"), - new Tuple("Compute", "GalleryImageVersions", "2024-03-03"), - new Tuple("Compute", "GalleryImages", "2024-03-03"), - new Tuple("Compute", "GalleryInVMAccessControlProfileVersions", "2024-03-03"), - new Tuple("Compute", "GalleryInVMAccessControlProfiles", "2024-03-03"), - new Tuple("Compute", "GallerySharingProfile", "2024-03-03"), - new Tuple("Compute", "Images", "2025-04-01"), - new Tuple("Compute", "LogAnalytics", "2025-04-01"), - new Tuple("Compute", "Operations", "2025-04-01"), - new Tuple("Compute", "ProximityPlacementGroups", "2025-04-01"), - new Tuple("Compute", "ResourceSkus", "2021-07-01"), - new Tuple("Compute", "RestorePointCollections", "2025-04-01"), - new Tuple("Compute", "RestorePoints", "2025-04-01"), - new Tuple("Compute", "SharedGalleries", "2024-03-03"), - new Tuple("Compute", "SharedGalleryImageVersions", "2024-03-03"), - new Tuple("Compute", "SharedGalleryImages", "2024-03-03"), - new Tuple("Compute", "Snapshots", "2025-01-02"), - new Tuple("Compute", "SoftDeletedResource", "2024-03-03"), - new Tuple("Compute", "SshPublicKeys", "2025-04-01"), - new Tuple("Compute", "Usage", "2025-04-01"), - new Tuple("Compute", "VirtualMachineExtensionImages", "2025-04-01"), - new Tuple("Compute", "VirtualMachineExtensions", "2025-04-01"), - new Tuple("Compute", "VirtualMachineImages", "2025-04-01"), - new Tuple("Compute", "VirtualMachineImagesEdgeZone", "2025-04-01"), - new Tuple("Compute", "VirtualMachineRunCommands", "2025-04-01"), - new Tuple("Compute", "VirtualMachineScaleSetExtensions", "2025-04-01"), - new Tuple("Compute", "VirtualMachineScaleSetRollingUpgrades", "2025-04-01"), - new Tuple("Compute", "VirtualMachineScaleSetVMExtensions", "2025-04-01"), - new Tuple("Compute", "VirtualMachineScaleSetVMRunCommands", "2025-04-01"), - new Tuple("Compute", "VirtualMachineScaleSetVMs", "2025-04-01"), - new Tuple("Compute", "VirtualMachineScaleSets", "2025-04-01"), - new Tuple("Compute", "VirtualMachineSizes", "2025-04-01"), - new Tuple("Compute", "VirtualMachines", "2025-04-01"), - }.AsEnumerable(); - } - } - } -} diff --git a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleriesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleriesOperations.cs index 6552611ea185..32d20c1fcdd4 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleriesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleriesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// SharedGalleriesOperations operations. /// - internal partial class SharedGalleriesOperations : IServiceOperations, ISharedGalleriesOperations + internal partial class SharedGalleriesOperations : Microsoft.Rest.IServiceOperations, ISharedGalleriesOperations { /// /// Initializes a new instance of the SharedGalleriesOperations class. @@ -36,13 +24,13 @@ internal partial class SharedGalleriesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SharedGalleriesOperations(ComputeManagementClient client) + internal SharedGalleriesOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -58,7 +46,7 @@ internal SharedGalleriesOperations(ComputeManagementClient client) /// /// /// The query parameter to decide what shared galleries to fetch when doing - /// listing operations. Possible values include: 'tenant' + /// listing operations. /// /// /// Headers that will be added to request. @@ -66,13 +54,13 @@ internal SharedGalleriesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -81,43 +69,53 @@ internal SharedGalleriesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, string sharedTo = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string sharedTo = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("sharedTo", sharedTo); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -131,25 +129,24 @@ internal SharedGalleriesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -161,55 +158,56 @@ internal SharedGalleriesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -219,9 +217,10 @@ internal SharedGalleriesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -232,25 +231,29 @@ internal SharedGalleriesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get a shared gallery by subscription id or tenant id. /// @@ -266,13 +269,13 @@ internal SharedGalleriesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -281,48 +284,58 @@ internal SharedGalleriesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string location, string galleryUniqueName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string galleryUniqueName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (galleryUniqueName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryUniqueName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryUniqueName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("galleryUniqueName", galleryUniqueName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{galleryUniqueName}", System.Uri.EscapeDataString(galleryUniqueName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -332,25 +345,24 @@ internal SharedGalleriesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -362,55 +374,56 @@ internal SharedGalleriesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -420,9 +433,10 @@ internal SharedGalleriesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -433,25 +447,29 @@ internal SharedGalleriesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List shared galleries by subscription id or tenant id. /// @@ -464,13 +482,13 @@ internal SharedGalleriesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -479,51 +497,54 @@ internal SharedGalleriesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -535,55 +556,56 @@ internal SharedGalleriesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -593,9 +615,10 @@ internal SharedGalleriesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -606,24 +629,28 @@ internal SharedGalleriesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleriesOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleriesOperationsExtensions.cs index 4da33fea85ca..76474a356433 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleriesOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleriesOperationsExtensions.cs @@ -1,141 +1,129 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SharedGalleriesOperations. + /// Extension methods for SharedGalleriesOperations /// public static partial class SharedGalleriesOperationsExtensions { - /// - /// List shared galleries by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The query parameter to decide what shared galleries to fetch when doing - /// listing operations. Possible values include: 'tenant' - /// - public static IPage List(this ISharedGalleriesOperations operations, string location, string sharedTo = default(string)) - { - return operations.ListAsync(location, sharedTo).GetAwaiter().GetResult(); - } - - /// - /// List shared galleries by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The query parameter to decide what shared galleries to fetch when doing - /// listing operations. Possible values include: 'tenant' - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ISharedGalleriesOperations operations, string location, string sharedTo = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(location, sharedTo, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List shared galleries by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The query parameter to decide what shared galleries to fetch when doing + /// listing operations. + /// + public static Microsoft.Rest.Azure.IPage List(this ISharedGalleriesOperations operations, string location, string sharedTo = default(string)) + { + return ((ISharedGalleriesOperations)operations).ListAsync(location, sharedTo).GetAwaiter().GetResult(); + } - /// - /// Get a shared gallery by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The unique name of the Shared Gallery. - /// - public static SharedGallery Get(this ISharedGalleriesOperations operations, string location, string galleryUniqueName) + /// + /// List shared galleries by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The query parameter to decide what shared galleries to fetch when doing + /// listing operations. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ISharedGalleriesOperations operations, string location, string sharedTo = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, sharedTo, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(location, galleryUniqueName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get a shared gallery by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The unique name of the Shared Gallery. + /// + public static SharedGallery Get(this ISharedGalleriesOperations operations, string location, string galleryUniqueName) + { + return ((ISharedGalleriesOperations)operations).GetAsync(location, galleryUniqueName).GetAwaiter().GetResult(); + } - /// - /// Get a shared gallery by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The unique name of the Shared Gallery. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISharedGalleriesOperations operations, string location, string galleryUniqueName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get a shared gallery by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The unique name of the Shared Gallery. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISharedGalleriesOperations operations, string location, string galleryUniqueName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, galleryUniqueName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(location, galleryUniqueName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List shared galleries by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ISharedGalleriesOperations operations, string nextPageLink) + { + return ((ISharedGalleriesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List shared galleries by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ISharedGalleriesOperations operations, string nextPageLink) + /// + /// List shared galleries by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ISharedGalleriesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// List shared galleries by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ISharedGalleriesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImageVersionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImageVersionsOperations.cs index 66732d27d1f8..cd76935fbaf7 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImageVersionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImageVersionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// SharedGalleryImageVersionsOperations operations. /// - internal partial class SharedGalleryImageVersionsOperations : IServiceOperations, ISharedGalleryImageVersionsOperations + internal partial class SharedGalleryImageVersionsOperations : Microsoft.Rest.IServiceOperations, ISharedGalleryImageVersionsOperations { /// /// Initializes a new instance of the SharedGalleryImageVersionsOperations class. @@ -36,13 +24,13 @@ internal partial class SharedGalleryImageVersionsOperations : IServiceOperations /// /// Thrown when a required parameter is null /// - internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) + internal SharedGalleryImageVersionsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,7 +53,7 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) /// /// /// The query parameter to decide what shared galleries to fetch when doing - /// listing operations. Possible values include: 'tenant' + /// listing operations. /// /// /// Headers that will be added to request. @@ -73,13 +61,13 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -88,55 +76,67 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, string galleryUniqueName, string galleryImageName, string sharedTo = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string galleryUniqueName, string galleryImageName, string sharedTo = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (galleryUniqueName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryUniqueName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryUniqueName"); } + if (galleryImageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } + + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("galleryUniqueName", galleryUniqueName); tracingParameters.Add("galleryImageName", galleryImageName); tracingParameters.Add("sharedTo", sharedTo); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{galleryUniqueName}", System.Uri.EscapeDataString(galleryUniqueName)); _url = _url.Replace("{galleryImageName}", System.Uri.EscapeDataString(galleryImageName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -150,25 +150,24 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -180,55 +179,56 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -238,9 +238,10 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -251,25 +252,29 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get a shared gallery image version by subscription id or tenant id. /// @@ -295,13 +300,13 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -310,60 +315,72 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string location, string galleryUniqueName, string galleryImageName, string galleryImageVersionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string galleryUniqueName, string galleryImageName, string galleryImageVersionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (galleryUniqueName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryUniqueName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryUniqueName"); } + if (galleryImageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } + if (galleryImageVersionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageVersionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageVersionName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("galleryUniqueName", galleryUniqueName); tracingParameters.Add("galleryImageName", galleryImageName); tracingParameters.Add("galleryImageVersionName", galleryImageVersionName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{galleryUniqueName}", System.Uri.EscapeDataString(galleryUniqueName)); _url = _url.Replace("{galleryImageName}", System.Uri.EscapeDataString(galleryImageName)); _url = _url.Replace("{galleryImageVersionName}", System.Uri.EscapeDataString(galleryImageVersionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -373,25 +390,24 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -403,55 +419,56 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -461,9 +478,10 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -474,25 +492,29 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List shared gallery image versions by subscription id or tenant id. /// @@ -505,13 +527,13 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -520,51 +542,54 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -576,55 +601,56 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -634,9 +660,10 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -647,24 +674,28 @@ internal SharedGalleryImageVersionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImageVersionsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImageVersionsOperationsExtensions.cs index 9d9ec2f80ab3..878ac189f308 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImageVersionsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImageVersionsOperationsExtensions.cs @@ -1,175 +1,163 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SharedGalleryImageVersionsOperations. + /// Extension methods for SharedGalleryImageVersionsOperations /// public static partial class SharedGalleryImageVersionsOperationsExtensions { - /// - /// List shared gallery image versions by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The unique name of the Shared Gallery. - /// - /// - /// The name of the Shared Gallery Image Definition from which the Image - /// Versions are to be listed. - /// - /// - /// The query parameter to decide what shared galleries to fetch when doing - /// listing operations. Possible values include: 'tenant' - /// - public static IPage List(this ISharedGalleryImageVersionsOperations operations, string location, string galleryUniqueName, string galleryImageName, string sharedTo = default(string)) - { - return operations.ListAsync(location, galleryUniqueName, galleryImageName, sharedTo).GetAwaiter().GetResult(); - } - - /// - /// List shared gallery image versions by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The unique name of the Shared Gallery. - /// - /// - /// The name of the Shared Gallery Image Definition from which the Image - /// Versions are to be listed. - /// - /// - /// The query parameter to decide what shared galleries to fetch when doing - /// listing operations. Possible values include: 'tenant' - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ISharedGalleryImageVersionsOperations operations, string location, string galleryUniqueName, string galleryImageName, string sharedTo = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(location, galleryUniqueName, galleryImageName, sharedTo, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List shared gallery image versions by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The unique name of the Shared Gallery. + /// + /// + /// The name of the Shared Gallery Image Definition from which the Image + /// Versions are to be listed. + /// + /// + /// The query parameter to decide what shared galleries to fetch when doing + /// listing operations. + /// + public static Microsoft.Rest.Azure.IPage List(this ISharedGalleryImageVersionsOperations operations, string location, string galleryUniqueName, string galleryImageName, string sharedTo = default(string)) + { + return ((ISharedGalleryImageVersionsOperations)operations).ListAsync(location, galleryUniqueName, galleryImageName, sharedTo).GetAwaiter().GetResult(); + } - /// - /// Get a shared gallery image version by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The unique name of the Shared Gallery. - /// - /// - /// The name of the Shared Gallery Image Definition from which the Image - /// Versions are to be listed. - /// - /// - /// The name of the gallery image version to be created. Needs to follow - /// semantic version name pattern: The allowed characters are digit and period. - /// Digits must be within the range of a 32-bit integer. Format: - /// <MajorVersion>.<MinorVersion>.<Patch> - /// - public static SharedGalleryImageVersion Get(this ISharedGalleryImageVersionsOperations operations, string location, string galleryUniqueName, string galleryImageName, string galleryImageVersionName) + /// + /// List shared gallery image versions by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The unique name of the Shared Gallery. + /// + /// + /// The name of the Shared Gallery Image Definition from which the Image + /// Versions are to be listed. + /// + /// + /// The query parameter to decide what shared galleries to fetch when doing + /// listing operations. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ISharedGalleryImageVersionsOperations operations, string location, string galleryUniqueName, string galleryImageName, string sharedTo = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, galleryUniqueName, galleryImageName, sharedTo, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(location, galleryUniqueName, galleryImageName, galleryImageVersionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get a shared gallery image version by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The unique name of the Shared Gallery. + /// + /// + /// The name of the Shared Gallery Image Definition from which the Image + /// Versions are to be listed. + /// + /// + /// The name of the gallery image version to be created. Needs to follow + /// semantic version name pattern: The allowed characters are digit and period. + /// Digits must be within the range of a 32-bit integer. Format: + /// <MajorVersion>.<MinorVersion>.<Patch> + /// + public static SharedGalleryImageVersion Get(this ISharedGalleryImageVersionsOperations operations, string location, string galleryUniqueName, string galleryImageName, string galleryImageVersionName) + { + return ((ISharedGalleryImageVersionsOperations)operations).GetAsync(location, galleryUniqueName, galleryImageName, galleryImageVersionName).GetAwaiter().GetResult(); + } - /// - /// Get a shared gallery image version by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The unique name of the Shared Gallery. - /// - /// - /// The name of the Shared Gallery Image Definition from which the Image - /// Versions are to be listed. - /// - /// - /// The name of the gallery image version to be created. Needs to follow - /// semantic version name pattern: The allowed characters are digit and period. - /// Digits must be within the range of a 32-bit integer. Format: - /// <MajorVersion>.<MinorVersion>.<Patch> - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISharedGalleryImageVersionsOperations operations, string location, string galleryUniqueName, string galleryImageName, string galleryImageVersionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get a shared gallery image version by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The unique name of the Shared Gallery. + /// + /// + /// The name of the Shared Gallery Image Definition from which the Image + /// Versions are to be listed. + /// + /// + /// The name of the gallery image version to be created. Needs to follow + /// semantic version name pattern: The allowed characters are digit and period. + /// Digits must be within the range of a 32-bit integer. Format: + /// <MajorVersion>.<MinorVersion>.<Patch> + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISharedGalleryImageVersionsOperations operations, string location, string galleryUniqueName, string galleryImageName, string galleryImageVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, galleryUniqueName, galleryImageName, galleryImageVersionName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(location, galleryUniqueName, galleryImageName, galleryImageVersionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List shared gallery image versions by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ISharedGalleryImageVersionsOperations operations, string nextPageLink) + { + return ((ISharedGalleryImageVersionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List shared gallery image versions by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ISharedGalleryImageVersionsOperations operations, string nextPageLink) + /// + /// List shared gallery image versions by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ISharedGalleryImageVersionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// List shared gallery image versions by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ISharedGalleryImageVersionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImagesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImagesOperations.cs index 592f0a0d9cb6..62aaac943e9f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImagesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImagesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// SharedGalleryImagesOperations operations. /// - internal partial class SharedGalleryImagesOperations : IServiceOperations, ISharedGalleryImagesOperations + internal partial class SharedGalleryImagesOperations : Microsoft.Rest.IServiceOperations, ISharedGalleryImagesOperations { /// /// Initializes a new instance of the SharedGalleryImagesOperations class. @@ -36,13 +24,13 @@ internal partial class SharedGalleryImagesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SharedGalleryImagesOperations(ComputeManagementClient client) + internal SharedGalleryImagesOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -61,7 +49,7 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) /// /// /// The query parameter to decide what shared galleries to fetch when doing - /// listing operations. Possible values include: 'tenant' + /// listing operations. /// /// /// Headers that will be added to request. @@ -69,13 +57,13 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -84,49 +72,60 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, string galleryUniqueName, string sharedTo = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string galleryUniqueName, string sharedTo = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (galleryUniqueName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryUniqueName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryUniqueName"); } + + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("galleryUniqueName", galleryUniqueName); tracingParameters.Add("sharedTo", sharedTo); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{galleryUniqueName}", System.Uri.EscapeDataString(galleryUniqueName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -140,25 +139,24 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -170,55 +168,56 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -228,9 +227,10 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -241,25 +241,29 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get a shared gallery image by subscription id or tenant id. /// @@ -279,13 +283,13 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -294,54 +298,65 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string location, string galleryUniqueName, string galleryImageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string galleryUniqueName, string galleryImageName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (galleryUniqueName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryUniqueName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryUniqueName"); } + if (galleryImageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryImageName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryImageName"); } + string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("galleryUniqueName", galleryUniqueName); tracingParameters.Add("galleryImageName", galleryImageName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{galleryUniqueName}", System.Uri.EscapeDataString(galleryUniqueName)); _url = _url.Replace("{galleryImageName}", System.Uri.EscapeDataString(galleryImageName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -351,25 +366,24 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -381,55 +395,56 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -439,9 +454,10 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -452,25 +468,29 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List shared gallery images by subscription id or tenant id. /// @@ -483,13 +503,13 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -498,51 +518,54 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -554,55 +577,56 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -612,9 +636,10 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -625,24 +650,28 @@ internal SharedGalleryImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImagesOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImagesOperationsExtensions.cs index 52290ed7b8e9..2f319fd06591 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImagesOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SharedGalleryImagesOperationsExtensions.cs @@ -1,155 +1,143 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SharedGalleryImagesOperations. + /// Extension methods for SharedGalleryImagesOperations /// public static partial class SharedGalleryImagesOperationsExtensions { - /// - /// List shared gallery images by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The unique name of the Shared Gallery. - /// - /// - /// The query parameter to decide what shared galleries to fetch when doing - /// listing operations. Possible values include: 'tenant' - /// - public static IPage List(this ISharedGalleryImagesOperations operations, string location, string galleryUniqueName, string sharedTo = default(string)) - { - return operations.ListAsync(location, galleryUniqueName, sharedTo).GetAwaiter().GetResult(); - } - - /// - /// List shared gallery images by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The unique name of the Shared Gallery. - /// - /// - /// The query parameter to decide what shared galleries to fetch when doing - /// listing operations. Possible values include: 'tenant' - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ISharedGalleryImagesOperations operations, string location, string galleryUniqueName, string sharedTo = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(location, galleryUniqueName, sharedTo, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List shared gallery images by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The unique name of the Shared Gallery. + /// + /// + /// The query parameter to decide what shared galleries to fetch when doing + /// listing operations. + /// + public static Microsoft.Rest.Azure.IPage List(this ISharedGalleryImagesOperations operations, string location, string galleryUniqueName, string sharedTo = default(string)) + { + return ((ISharedGalleryImagesOperations)operations).ListAsync(location, galleryUniqueName, sharedTo).GetAwaiter().GetResult(); + } - /// - /// Get a shared gallery image by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The unique name of the Shared Gallery. - /// - /// - /// The name of the Shared Gallery Image Definition from which the Image - /// Versions are to be listed. - /// - public static SharedGalleryImage Get(this ISharedGalleryImagesOperations operations, string location, string galleryUniqueName, string galleryImageName) + /// + /// List shared gallery images by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The unique name of the Shared Gallery. + /// + /// + /// The query parameter to decide what shared galleries to fetch when doing + /// listing operations. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ISharedGalleryImagesOperations operations, string location, string galleryUniqueName, string sharedTo = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, galleryUniqueName, sharedTo, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(location, galleryUniqueName, galleryImageName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get a shared gallery image by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The unique name of the Shared Gallery. + /// + /// + /// The name of the Shared Gallery Image Definition from which the Image + /// Versions are to be listed. + /// + public static SharedGalleryImage Get(this ISharedGalleryImagesOperations operations, string location, string galleryUniqueName, string galleryImageName) + { + return ((ISharedGalleryImagesOperations)operations).GetAsync(location, galleryUniqueName, galleryImageName).GetAwaiter().GetResult(); + } - /// - /// Get a shared gallery image by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The unique name of the Shared Gallery. - /// - /// - /// The name of the Shared Gallery Image Definition from which the Image - /// Versions are to be listed. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISharedGalleryImagesOperations operations, string location, string galleryUniqueName, string galleryImageName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get a shared gallery image by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The unique name of the Shared Gallery. + /// + /// + /// The name of the Shared Gallery Image Definition from which the Image + /// Versions are to be listed. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISharedGalleryImagesOperations operations, string location, string galleryUniqueName, string galleryImageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, galleryUniqueName, galleryImageName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(location, galleryUniqueName, galleryImageName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List shared gallery images by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ISharedGalleryImagesOperations operations, string nextPageLink) + { + return ((ISharedGalleryImagesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List shared gallery images by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ISharedGalleryImagesOperations operations, string nextPageLink) + /// + /// List shared gallery images by subscription id or tenant id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ISharedGalleryImagesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// List shared gallery images by subscription id or tenant id. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ISharedGalleryImagesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/SnapshotsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/SnapshotsOperations.cs index 7359a46a57f0..5ad10df1cafa 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SnapshotsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SnapshotsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// SnapshotsOperations operations. /// - internal partial class SnapshotsOperations : IServiceOperations, ISnapshotsOperations + internal partial class SnapshotsOperations : Microsoft.Rest.IServiceOperations, ISnapshotsOperations { /// /// Initializes a new instance of the SnapshotsOperations class. @@ -36,13 +24,13 @@ internal partial class SnapshotsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SnapshotsOperations(ComputeManagementClient client) + internal SnapshotsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -74,29 +62,38 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -106,25 +103,24 @@ internal SnapshotsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -136,55 +132,56 @@ internal SnapshotsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -194,9 +191,10 @@ internal SnapshotsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -207,25 +205,29 @@ internal SnapshotsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists snapshots under a resource group. /// @@ -238,13 +240,13 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -253,46 +255,55 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -302,25 +313,24 @@ internal SnapshotsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -332,55 +342,56 @@ internal SnapshotsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -390,9 +401,10 @@ internal SnapshotsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -403,25 +415,29 @@ internal SnapshotsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets information about a snapshot. /// @@ -429,7 +445,7 @@ internal SnapshotsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be changed + /// The name of the snapshot that is being created. The name can't be changed /// after the snapshot is created. Supported characters for the name are a-z, /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// @@ -439,13 +455,13 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -454,52 +470,62 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (snapshotName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("snapshotName", snapshotName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{snapshotName}", System.Uri.EscapeDataString(snapshotName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -509,25 +535,24 @@ internal SnapshotsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -539,55 +564,56 @@ internal SnapshotsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -597,9 +623,10 @@ internal SnapshotsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -610,25 +637,29 @@ internal SnapshotsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a snapshot. /// @@ -636,7 +667,7 @@ internal SnapshotsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be changed + /// The name of the snapshot that is being created. The name can't be changed /// after the snapshot is created. Supported characters for the name are a-z, /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// @@ -644,16 +675,16 @@ internal SnapshotsOperations(ComputeManagementClient client) /// Snapshot object supplied in the body of the Put disk operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Snapshot snapshot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Snapshot snapshot, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, snapshotName, snapshot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, snapshotName, snapshot, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -663,7 +694,7 @@ internal SnapshotsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be changed + /// The name of the snapshot that is being created. The name can't be changed /// after the snapshot is created. Supported characters for the name are a-z, /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// @@ -671,16 +702,16 @@ internal SnapshotsOperations(ComputeManagementClient client) /// Snapshot object supplied in the body of the Patch snapshot operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string snapshotName, SnapshotUpdate snapshot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string snapshotName, SnapshotUpdate snapshot, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, snapshotName, snapshot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, snapshotName, snapshot, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -690,21 +721,21 @@ internal SnapshotsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be changed + /// The name of the snapshot that is being created. The name can't be changed /// after the snapshot is created. Supported characters for the name are a-z, /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, snapshotName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, snapshotName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -714,7 +745,7 @@ internal SnapshotsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be changed + /// The name of the snapshot that is being created. The name can't be changed /// after the snapshot is created. Supported characters for the name are a-z, /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// @@ -723,16 +754,16 @@ internal SnapshotsOperations(ComputeManagementClient client) /// operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GrantAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, GrantAccessData grantAccessData, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GrantAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, GrantAccessData grantAccessData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGrantAccessWithHttpMessagesAsync(resourceGroupName, snapshotName, grantAccessData, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGrantAccessWithHttpMessagesAsync(resourceGroupName, snapshotName, grantAccessData, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -742,21 +773,21 @@ internal SnapshotsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be changed + /// The name of the snapshot that is being created. The name can't be changed /// after the snapshot is created. Supported characters for the name are a-z, /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task RevokeAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task RevokeAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRevokeAccessWithHttpMessagesAsync(resourceGroupName, snapshotName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRevokeAccessWithHttpMessagesAsync(resourceGroupName, snapshotName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -766,7 +797,7 @@ internal SnapshotsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be changed + /// The name of the snapshot that is being created. The name can't be changed /// after the snapshot is created. Supported characters for the name are a-z, /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// @@ -779,13 +810,13 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -794,61 +825,71 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Snapshot snapshot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Snapshot snapshot, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (snapshot == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshot"); + } + if (snapshot != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + snapshot.Validate(); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (snapshotName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotName"); - } - if (snapshot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshot"); - } - if (snapshot != null) - { - snapshot.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("snapshotName", snapshotName); + tracingParameters.Add("snapshot", snapshot); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{snapshotName}", System.Uri.EscapeDataString(snapshotName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -858,25 +899,24 @@ internal SnapshotsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -888,61 +928,62 @@ internal SnapshotsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(snapshot != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(snapshot, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(snapshot, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -952,9 +993,10 @@ internal SnapshotsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -965,25 +1007,29 @@ internal SnapshotsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates (patches) a snapshot. /// @@ -991,7 +1037,7 @@ internal SnapshotsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be changed + /// The name of the snapshot that is being created. The name can't be changed /// after the snapshot is created. Supported characters for the name are a-z, /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// @@ -1004,13 +1050,13 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1019,57 +1065,67 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string snapshotName, SnapshotUpdate snapshot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string snapshotName, SnapshotUpdate snapshot, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (snapshot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshot"); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (snapshotName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotName"); - } - if (snapshot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshot"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("snapshotName", snapshotName); + tracingParameters.Add("snapshot", snapshot); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{snapshotName}", System.Uri.EscapeDataString(snapshotName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1079,25 +1135,24 @@ internal SnapshotsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1109,61 +1164,62 @@ internal SnapshotsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(snapshot != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(snapshot, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(snapshot, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1173,9 +1229,10 @@ internal SnapshotsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1186,25 +1243,29 @@ internal SnapshotsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a snapshot. /// @@ -1212,7 +1273,7 @@ internal SnapshotsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be changed + /// The name of the snapshot that is being created. The name can't be changed /// after the snapshot is created. Supported characters for the name are a-z, /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// @@ -1222,10 +1283,10 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1234,52 +1295,62 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (snapshotName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("snapshotName", snapshotName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{snapshotName}", System.Uri.EscapeDataString(snapshotName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1289,25 +1360,24 @@ internal SnapshotsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1319,55 +1389,56 @@ internal SnapshotsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1377,20 +1448,25 @@ internal SnapshotsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Grants access to a snapshot. /// @@ -1398,7 +1474,7 @@ internal SnapshotsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be changed + /// The name of the snapshot that is being created. The name can't be changed /// after the snapshot is created. Supported characters for the name are a-z, /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// @@ -1412,13 +1488,13 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1427,61 +1503,71 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGrantAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, GrantAccessData grantAccessData, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGrantAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, GrantAccessData grantAccessData, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (grantAccessData == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "grantAccessData"); } + if (grantAccessData != null) + { + grantAccessData.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (snapshotName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotName"); - } - if (grantAccessData == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "grantAccessData"); - } - if (grantAccessData != null) - { - grantAccessData.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("snapshotName", snapshotName); + tracingParameters.Add("grantAccessData", grantAccessData); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGrantAccess", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGrantAccess", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{snapshotName}", System.Uri.EscapeDataString(snapshotName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1491,25 +1577,24 @@ internal SnapshotsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1521,61 +1606,62 @@ internal SnapshotsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(grantAccessData != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(grantAccessData, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(grantAccessData, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1585,9 +1671,10 @@ internal SnapshotsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1598,25 +1685,29 @@ internal SnapshotsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Revokes access to a snapshot. /// @@ -1624,7 +1715,7 @@ internal SnapshotsOperations(ComputeManagementClient client) /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the snapshot that is being created. The name can't be changed + /// The name of the snapshot that is being created. The name can't be changed /// after the snapshot is created. Supported characters for the name are a-z, /// A-Z, 0-9, _ and -. The max name length is 80 characters. /// @@ -1634,10 +1725,10 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1646,52 +1737,62 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRevokeAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginRevokeAccessWithHttpMessagesAsync(string resourceGroupName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (snapshotName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); } + string apiVersion = "2025-01-02"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("snapshotName", snapshotName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRevokeAccess", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRevokeAccess", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{snapshotName}", System.Uri.EscapeDataString(snapshotName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1701,25 +1802,24 @@ internal SnapshotsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1731,55 +1831,56 @@ internal SnapshotsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1789,20 +1890,25 @@ internal SnapshotsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists snapshots under a subscription. /// @@ -1815,13 +1921,13 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1830,51 +1936,54 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1886,55 +1995,56 @@ internal SnapshotsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1944,9 +2054,10 @@ internal SnapshotsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1957,25 +2068,29 @@ internal SnapshotsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists snapshots under a resource group. /// @@ -1988,13 +2103,13 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2003,51 +2118,54 @@ internal SnapshotsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2059,55 +2177,56 @@ internal SnapshotsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2117,9 +2236,10 @@ internal SnapshotsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2130,24 +2250,28 @@ internal SnapshotsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/SnapshotsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/SnapshotsOperationsExtensions.cs index 0ae6ee072ac8..4a6f7e7d6a30 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SnapshotsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SnapshotsOperationsExtensions.cs @@ -1,667 +1,603 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SnapshotsOperations. + /// Extension methods for SnapshotsOperations /// public static partial class SnapshotsOperationsExtensions { - /// - /// Lists snapshots under a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this ISnapshotsOperations operations) + /// + /// Lists snapshots under a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this ISnapshotsOperations operations) + { + return ((ISnapshotsOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists snapshots under a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ISnapshotsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync().GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Lists snapshots under a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ISnapshotsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists snapshots under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage ListByResourceGroup(this ISnapshotsOperations operations, string resourceGroupName) + } + /// + /// Lists snapshots under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this ISnapshotsOperations operations, string resourceGroupName) + { + return ((ISnapshotsOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists snapshots under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this ISnapshotsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Lists snapshots under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this ISnapshotsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets information about a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - public static Snapshot Get(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName) + } + /// + /// Gets information about a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + public static Snapshot Get(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName) + { + return ((ISnapshotsOperations)operations).GetAsync(resourceGroupName, snapshotName).GetAwaiter().GetResult(); + } + + /// + /// Gets information about a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, snapshotName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, snapshotName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets information about a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Creates or updates a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + public static Snapshot CreateOrUpdate(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, Snapshot snapshot) + { + return ((ISnapshotsOperations)operations).CreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, Snapshot snapshot, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, snapshotName, snapshot, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, snapshotName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Creates or updates a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - /// - /// Snapshot object supplied in the body of the Put disk operation. - /// - public static Snapshot CreateOrUpdate(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, Snapshot snapshot) + } + /// + /// Updates (patches) a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + public static Snapshot Update(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, SnapshotUpdate snapshot) + { + return ((ISnapshotsOperations)operations).UpdateAsync(resourceGroupName, snapshotName, snapshot).GetAwaiter().GetResult(); + } + + /// + /// Updates (patches) a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, SnapshotUpdate snapshot, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, snapshotName, snapshot, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Creates or updates a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - /// - /// Snapshot object supplied in the body of the Put disk operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, Snapshot snapshot, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Deletes a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + public static void Delete(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName) + { + ((ISnapshotsOperations)operations).DeleteAsync(resourceGroupName, snapshotName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Grants access to a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + public static AccessUri GrantAccess(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, GrantAccessData grantAccessData) + { + return ((ISnapshotsOperations)operations).GrantAccessAsync(resourceGroupName, snapshotName, grantAccessData).GetAwaiter().GetResult(); + } + + /// + /// Grants access to a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GrantAccessAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, GrantAccessData grantAccessData, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GrantAccessWithHttpMessagesAsync(resourceGroupName, snapshotName, grantAccessData, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, snapshotName, snapshot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Updates (patches) a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - /// - /// Snapshot object supplied in the body of the Patch snapshot operation. - /// - public static Snapshot Update(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, SnapshotUpdate snapshot) + } + /// + /// Revokes access to a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + public static void RevokeAccess(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName) + { + ((ISnapshotsOperations)operations).RevokeAccessAsync(resourceGroupName, snapshotName).GetAwaiter().GetResult(); + } + + /// + /// Revokes access to a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RevokeAccessAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.RevokeAccessWithHttpMessagesAsync(resourceGroupName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + public static Snapshot BeginCreateOrUpdate(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, Snapshot snapshot) + { + return ((ISnapshotsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, Snapshot snapshot, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, snapshotName, snapshot, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(resourceGroupName, snapshotName, snapshot).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Updates (patches) a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - /// - /// Snapshot object supplied in the body of the Patch snapshot operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, SnapshotUpdate snapshot, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Updates (patches) a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + public static Snapshot BeginUpdate(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, SnapshotUpdate snapshot) + { + return ((ISnapshotsOperations)operations).BeginUpdateAsync(resourceGroupName, snapshotName, snapshot).GetAwaiter().GetResult(); + } + + /// + /// Updates (patches) a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, SnapshotUpdate snapshot, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, snapshotName, snapshot, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, snapshotName, snapshot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Deletes a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - public static void Delete(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName) + } + /// + /// Deletes a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + public static void BeginDelete(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName) + { + ((ISnapshotsOperations)operations).BeginDeleteAsync(resourceGroupName, snapshotName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Grants access to a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + public static AccessUri BeginGrantAccess(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, GrantAccessData grantAccessData) + { + return ((ISnapshotsOperations)operations).BeginGrantAccessAsync(resourceGroupName, snapshotName, grantAccessData).GetAwaiter().GetResult(); + } + + /// + /// Grants access to a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGrantAccessAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, GrantAccessData grantAccessData, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGrantAccessWithHttpMessagesAsync(resourceGroupName, snapshotName, grantAccessData, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, snapshotName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Deletes a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, CancellationToken cancellationToken = default(CancellationToken)) + } + /// + /// Revokes access to a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + public static void BeginRevokeAccess(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName) + { + ((ISnapshotsOperations)operations).BeginRevokeAccessAsync(resourceGroupName, snapshotName).GetAwaiter().GetResult(); + } + + /// + /// Revokes access to a snapshot. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the snapshot that is being created. The name can't be changed + /// after the snapshot is created. Supported characters for the name are a-z, + /// A-Z, 0-9, _ and -. The max name length is 80 characters. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRevokeAccessAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginRevokeAccessWithHttpMessagesAsync(resourceGroupName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists snapshots under a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ISnapshotsOperations operations, string nextPageLink) + { + return ((ISnapshotsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists snapshots under a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ISnapshotsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } - - /// - /// Grants access to a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - /// - /// Access data object supplied in the body of the get snapshot access - /// operation. - /// - public static AccessUri GrantAccess(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, GrantAccessData grantAccessData) - { - return operations.GrantAccessAsync(resourceGroupName, snapshotName, grantAccessData).GetAwaiter().GetResult(); - } - - /// - /// Grants access to a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - /// - /// Access data object supplied in the body of the get snapshot access - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task GrantAccessAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, GrantAccessData grantAccessData, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GrantAccessWithHttpMessagesAsync(resourceGroupName, snapshotName, grantAccessData, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Revokes access to a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - public static void RevokeAccess(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName) - { - operations.RevokeAccessAsync(resourceGroupName, snapshotName).GetAwaiter().GetResult(); - } - - /// - /// Revokes access to a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - /// - /// The cancellation token. - /// - public static async Task RevokeAccessAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RevokeAccessWithHttpMessagesAsync(resourceGroupName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - /// - /// Snapshot object supplied in the body of the Put disk operation. - /// - public static Snapshot BeginCreateOrUpdate(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, Snapshot snapshot) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - /// - /// Snapshot object supplied in the body of the Put disk operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, Snapshot snapshot, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, snapshotName, snapshot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates (patches) a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - /// - /// Snapshot object supplied in the body of the Patch snapshot operation. - /// - public static Snapshot BeginUpdate(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, SnapshotUpdate snapshot) + } + /// + /// Lists snapshots under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this ISnapshotsOperations operations, string nextPageLink) + { + return ((ISnapshotsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists snapshots under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this ISnapshotsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginUpdateAsync(resourceGroupName, snapshotName, snapshot).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Updates (patches) a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - /// - /// Snapshot object supplied in the body of the Patch snapshot operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, SnapshotUpdate snapshot, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, snapshotName, snapshot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - public static void BeginDelete(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName) - { - operations.BeginDeleteAsync(resourceGroupName, snapshotName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Grants access to a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - /// - /// Access data object supplied in the body of the get snapshot access - /// operation. - /// - public static AccessUri BeginGrantAccess(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, GrantAccessData grantAccessData) - { - return operations.BeginGrantAccessAsync(resourceGroupName, snapshotName, grantAccessData).GetAwaiter().GetResult(); - } - - /// - /// Grants access to a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - /// - /// Access data object supplied in the body of the get snapshot access - /// operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGrantAccessAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, GrantAccessData grantAccessData, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGrantAccessWithHttpMessagesAsync(resourceGroupName, snapshotName, grantAccessData, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Revokes access to a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - public static void BeginRevokeAccess(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName) - { - operations.BeginRevokeAccessAsync(resourceGroupName, snapshotName).GetAwaiter().GetResult(); - } - - /// - /// Revokes access to a snapshot. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the snapshot that is being created. The name can't be changed - /// after the snapshot is created. Supported characters for the name are a-z, - /// A-Z, 0-9, _ and -. The max name length is 80 characters. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRevokeAccessAsync(this ISnapshotsOperations operations, string resourceGroupName, string snapshotName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRevokeAccessWithHttpMessagesAsync(resourceGroupName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists snapshots under a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ISnapshotsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists snapshots under a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this ISnapshotsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists snapshots under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this ISnapshotsOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists snapshots under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this ISnapshotsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperations.cs index a62e91e9cf85..94308b5947b2 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// SoftDeletedResourceOperations operations. /// - internal partial class SoftDeletedResourceOperations : IServiceOperations, ISoftDeletedResourceOperations + internal partial class SoftDeletedResourceOperations : Microsoft.Rest.IServiceOperations, ISoftDeletedResourceOperations { /// /// Initializes a new instance of the SoftDeletedResourceOperations class. @@ -36,13 +24,13 @@ internal partial class SoftDeletedResourceOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SoftDeletedResourceOperations(ComputeManagementClient client) + internal SoftDeletedResourceOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -73,13 +61,13 @@ internal SoftDeletedResourceOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -88,78 +76,88 @@ internal SoftDeletedResourceOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByArtifactNameWithHttpMessagesAsync(string resourceGroupName, string galleryName, string artifactType, string artifactName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByArtifactNameWithHttpMessagesAsync(string resourceGroupName, string galleryName, string artifactType, string artifactName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (galleryName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "galleryName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "galleryName"); } + if (artifactType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "artifactType"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "artifactType"); } if (artifactType != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(artifactType, "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$")) { - throw new ValidationException(ValidationRules.Pattern, "artifactType", "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "artifactType", "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$"); } } if (artifactName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "artifactName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "artifactName"); } if (artifactName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(artifactName, "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$")) { - throw new ValidationException(ValidationRules.Pattern, "artifactName", "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "artifactName", "^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$"); } } string apiVersion = "2024-03-03"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("galleryName", galleryName); tracingParameters.Add("artifactType", artifactType); tracingParameters.Add("artifactName", artifactName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByArtifactName", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByArtifactName", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/softdeletedartifacttypes/{artifactType}/artifacts/{artifactName}/versions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{galleryName}", System.Uri.EscapeDataString(galleryName)); _url = _url.Replace("{artifactType}", System.Uri.EscapeDataString(artifactType)); _url = _url.Replace("{artifactName}", System.Uri.EscapeDataString(artifactName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -169,25 +167,24 @@ internal SoftDeletedResourceOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -199,55 +196,56 @@ internal SoftDeletedResourceOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -257,9 +255,10 @@ internal SoftDeletedResourceOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -270,25 +269,29 @@ internal SoftDeletedResourceOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List soft-deleted resources of an artifact in the gallery, such as /// soft-deleted gallery image version of an image. @@ -302,13 +305,13 @@ internal SoftDeletedResourceOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -317,51 +320,54 @@ internal SoftDeletedResourceOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByArtifactNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByArtifactNameNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByArtifactNameNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByArtifactNameNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -373,55 +379,56 @@ internal SoftDeletedResourceOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -431,9 +438,10 @@ internal SoftDeletedResourceOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -444,24 +452,28 @@ internal SoftDeletedResourceOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperationsExtensions.cs index a1f3cb509591..1188787cfd9c 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SoftDeletedResourceOperationsExtensions.cs @@ -1,117 +1,106 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SoftDeletedResourceOperations. + /// Extension methods for SoftDeletedResourceOperations /// public static partial class SoftDeletedResourceOperationsExtensions { - /// - /// List soft-deleted resources of an artifact in the gallery, such as - /// soft-deleted gallery image version of an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The type of the artifact to be listed, such as gallery image version. - /// - /// - /// The artifact name to be listed. If artifact type is Images, then the - /// artifact name should be the gallery image name. - /// - public static IPage ListByArtifactName(this ISoftDeletedResourceOperations operations, string resourceGroupName, string galleryName, string artifactType, string artifactName) - { - return operations.ListByArtifactNameAsync(resourceGroupName, galleryName, artifactType, artifactName).GetAwaiter().GetResult(); - } + /// + /// List soft-deleted resources of an artifact in the gallery, such as + /// soft-deleted gallery image version of an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The type of the artifact to be listed, such as gallery image version. + /// + /// + /// The artifact name to be listed. If artifact type is Images, then the + /// artifact name should be the gallery image name. + /// + public static Microsoft.Rest.Azure.IPage ListByArtifactName(this ISoftDeletedResourceOperations operations, string resourceGroupName, string galleryName, string artifactType, string artifactName) + { + return ((ISoftDeletedResourceOperations)operations).ListByArtifactNameAsync(resourceGroupName, galleryName, artifactType, artifactName).GetAwaiter().GetResult(); + } - /// - /// List soft-deleted resources of an artifact in the gallery, such as - /// soft-deleted gallery image version of an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Shared Image Gallery. - /// - /// - /// The type of the artifact to be listed, such as gallery image version. - /// - /// - /// The artifact name to be listed. If artifact type is Images, then the - /// artifact name should be the gallery image name. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByArtifactNameAsync(this ISoftDeletedResourceOperations operations, string resourceGroupName, string galleryName, string artifactType, string artifactName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List soft-deleted resources of an artifact in the gallery, such as + /// soft-deleted gallery image version of an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Shared Image Gallery. + /// + /// + /// The type of the artifact to be listed, such as gallery image version. + /// + /// + /// The artifact name to be listed. If artifact type is Images, then the + /// artifact name should be the gallery image name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByArtifactNameAsync(this ISoftDeletedResourceOperations operations, string resourceGroupName, string galleryName, string artifactType, string artifactName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByArtifactNameWithHttpMessagesAsync(resourceGroupName, galleryName, artifactType, artifactName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByArtifactNameWithHttpMessagesAsync(resourceGroupName, galleryName, artifactType, artifactName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List soft-deleted resources of an artifact in the gallery, such as + /// soft-deleted gallery image version of an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByArtifactNameNext(this ISoftDeletedResourceOperations operations, string nextPageLink) + { + return ((ISoftDeletedResourceOperations)operations).ListByArtifactNameNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List soft-deleted resources of an artifact in the gallery, such as - /// soft-deleted gallery image version of an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByArtifactNameNext(this ISoftDeletedResourceOperations operations, string nextPageLink) + /// + /// List soft-deleted resources of an artifact in the gallery, such as + /// soft-deleted gallery image version of an image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByArtifactNameNextAsync(this ISoftDeletedResourceOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByArtifactNameNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByArtifactNameNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// List soft-deleted resources of an artifact in the gallery, such as - /// soft-deleted gallery image version of an image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByArtifactNameNextAsync(this ISoftDeletedResourceOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByArtifactNameNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/SshPublicKeysOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/SshPublicKeysOperations.cs index 89b1bcb46946..e11e59dcfa24 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SshPublicKeysOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SshPublicKeysOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// SshPublicKeysOperations operations. /// - internal partial class SshPublicKeysOperations : IServiceOperations, ISshPublicKeysOperations + internal partial class SshPublicKeysOperations : Microsoft.Rest.IServiceOperations, ISshPublicKeysOperations { /// /// Initializes a new instance of the SshPublicKeysOperations class. @@ -36,13 +24,13 @@ internal partial class SshPublicKeysOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SshPublicKeysOperations(ComputeManagementClient client) + internal SshPublicKeysOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -60,13 +48,13 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -75,29 +63,38 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -107,25 +104,24 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -137,55 +133,56 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -195,9 +192,10 @@ internal SshPublicKeysOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -208,25 +206,29 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the SSH public keys in the specified resource group. Use the /// nextLink property in the response to get the next page of SSH public keys. @@ -240,13 +242,13 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -255,46 +257,55 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -304,25 +315,24 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -334,55 +344,56 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -392,9 +403,10 @@ internal SshPublicKeysOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -405,25 +417,29 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves information about an SSH public key. /// @@ -439,13 +455,13 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -454,52 +470,62 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (sshPublicKeyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "sshPublicKeyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "sshPublicKeyName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("sshPublicKeyName", sshPublicKeyName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{sshPublicKeyName}", System.Uri.EscapeDataString(sshPublicKeyName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -509,25 +535,24 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -539,55 +564,56 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -597,9 +623,10 @@ internal SshPublicKeysOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -610,25 +637,29 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates a new SSH public key resource. /// @@ -647,13 +678,13 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -662,61 +693,71 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, SshPublicKeyResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, SshPublicKeyResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (sshPublicKeyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "sshPublicKeyName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "sshPublicKeyName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("sshPublicKeyName", sshPublicKeyName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{sshPublicKeyName}", System.Uri.EscapeDataString(sshPublicKeyName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -726,25 +767,24 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -756,61 +796,62 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -820,9 +861,10 @@ internal SshPublicKeysOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -833,16 +875,16 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -851,25 +893,29 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates a new SSH public key resource. /// @@ -888,13 +934,13 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -903,57 +949,67 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, SshPublicKeyUpdateResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, SshPublicKeyUpdateResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (sshPublicKeyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "sshPublicKeyName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "sshPublicKeyName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("sshPublicKeyName", sshPublicKeyName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{sshPublicKeyName}", System.Uri.EscapeDataString(sshPublicKeyName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -963,25 +1019,24 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -993,61 +1048,62 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1057,9 +1113,10 @@ internal SshPublicKeysOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1070,25 +1127,29 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete an SSH public key. /// @@ -1104,10 +1165,10 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1116,52 +1177,62 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (sshPublicKeyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "sshPublicKeyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "sshPublicKeyName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("sshPublicKeyName", sshPublicKeyName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{sshPublicKeyName}", System.Uri.EscapeDataString(sshPublicKeyName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1171,25 +1242,24 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1201,55 +1271,56 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1259,20 +1330,25 @@ internal SshPublicKeysOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Generates and returns a public/private key pair and populates the SSH /// public key resource with the public key. The length of the key will be 3072 @@ -1287,8 +1363,7 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// /// The encryption type of the SSH keys to be generated. See SshEncryptionTypes - /// for possible set of values. If not provided, will default to RSA. Possible - /// values include: 'RSA', 'Ed25519' + /// for possible set of values. If not provided, will default to RSA /// /// /// Headers that will be added to request. @@ -1296,13 +1371,13 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1311,59 +1386,68 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GenerateKeyPairWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, string encryptionType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GenerateKeyPairWithHttpMessagesAsync(string resourceGroupName, string sshPublicKeyName, string encryptionType = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (sshPublicKeyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "sshPublicKeyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "sshPublicKeyName"); } + string apiVersion = "2025-04-01"; - SshGenerateKeyPairInputParameters parameters = default(SshGenerateKeyPairInputParameters); - if (encryptionType != null) + SshGenerateKeyPairInputParameters parameters = new SshGenerateKeyPairInputParameters(); + if(encryptionType != null) { - parameters = new SshGenerateKeyPairInputParameters(); parameters.EncryptionType = encryptionType; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("sshPublicKeyName", sshPublicKeyName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GenerateKeyPair", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GenerateKeyPair", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}/generateKeyPair").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{sshPublicKeyName}", System.Uri.EscapeDataString(sshPublicKeyName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1373,25 +1457,24 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1403,61 +1486,62 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1467,9 +1551,10 @@ internal SshPublicKeysOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1480,25 +1565,29 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the SSH public keys in the subscription. Use the nextLink /// property in the response to get the next page of SSH public keys. @@ -1512,13 +1601,13 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1527,51 +1616,54 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1583,55 +1675,56 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1641,9 +1734,10 @@ internal SshPublicKeysOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1654,25 +1748,29 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the SSH public keys in the specified resource group. Use the /// nextLink property in the response to get the next page of SSH public keys. @@ -1686,13 +1784,13 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1701,51 +1799,54 @@ internal SshPublicKeysOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1757,55 +1858,56 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1815,9 +1917,10 @@ internal SshPublicKeysOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1828,24 +1931,28 @@ internal SshPublicKeysOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/SshPublicKeysOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/SshPublicKeysOperationsExtensions.cs index accf927bcede..9ea284c7730a 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/SshPublicKeysOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/SshPublicKeysOperationsExtensions.cs @@ -1,388 +1,348 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SshPublicKeysOperations. + /// Extension methods for SshPublicKeysOperations /// public static partial class SshPublicKeysOperationsExtensions { - /// - /// Lists all of the SSH public keys in the subscription. Use the nextLink - /// property in the response to get the next page of SSH public keys. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListBySubscription(this ISshPublicKeysOperations operations) - { - return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all of the SSH public keys in the subscription. Use the nextLink - /// property in the response to get the next page of SSH public keys. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this ISshPublicKeysOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all of the SSH public keys in the specified resource group. Use the - /// nextLink property in the response to get the next page of SSH public keys. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage ListByResourceGroup(this ISshPublicKeysOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the SSH public keys in the specified resource group. Use the - /// nextLink property in the response to get the next page of SSH public keys. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this ISshPublicKeysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves information about an SSH public key. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the SSH public key. - /// - public static SshPublicKeyResource Get(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName) - { - return operations.GetAsync(resourceGroupName, sshPublicKeyName).GetAwaiter().GetResult(); - } + /// + /// Lists all of the SSH public keys in the subscription. Use the nextLink + /// property in the response to get the next page of SSH public keys. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscription(this ISshPublicKeysOperations operations) + { + return ((ISshPublicKeysOperations)operations).ListBySubscriptionAsync().GetAwaiter().GetResult(); + } - /// - /// Retrieves information about an SSH public key. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the SSH public key. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all of the SSH public keys in the subscription. Use the nextLink + /// property in the response to get the next page of SSH public keys. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this ISshPublicKeysOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, sshPublicKeyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all of the SSH public keys in the specified resource group. Use the + /// nextLink property in the response to get the next page of SSH public keys. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this ISshPublicKeysOperations operations, string resourceGroupName) + { + return ((ISshPublicKeysOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Creates a new SSH public key resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the SSH public key. - /// - /// - /// Parameters supplied to create the SSH public key. - /// - public static SshPublicKeyResource Create(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName, SshPublicKeyResource parameters) + /// + /// Lists all of the SSH public keys in the specified resource group. Use the + /// nextLink property in the response to get the next page of SSH public keys. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this ISshPublicKeysOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateAsync(resourceGroupName, sshPublicKeyName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Retrieves information about an SSH public key. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the SSH public key. + /// + public static SshPublicKeyResource Get(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName) + { + return ((ISshPublicKeysOperations)operations).GetAsync(resourceGroupName, sshPublicKeyName).GetAwaiter().GetResult(); + } - /// - /// Creates a new SSH public key resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the SSH public key. - /// - /// - /// Parameters supplied to create the SSH public key. - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName, SshPublicKeyResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Retrieves information about an SSH public key. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the SSH public key. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, sshPublicKeyName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, sshPublicKeyName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates a new SSH public key resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the SSH public key. + /// + public static SshPublicKeyResource Create(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName, SshPublicKeyResource parameters) + { + return ((ISshPublicKeysOperations)operations).CreateAsync(resourceGroupName, sshPublicKeyName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates a new SSH public key resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the SSH public key. - /// - /// - /// Parameters supplied to update the SSH public key. - /// - public static SshPublicKeyResource Update(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName, SshPublicKeyUpdateResource parameters) + /// + /// Creates a new SSH public key resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the SSH public key. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateAsync(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName, SshPublicKeyResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, sshPublicKeyName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(resourceGroupName, sshPublicKeyName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Updates a new SSH public key resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the SSH public key. + /// + public static SshPublicKeyResource Update(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName, SshPublicKeyUpdateResource parameters) + { + return ((ISshPublicKeysOperations)operations).UpdateAsync(resourceGroupName, sshPublicKeyName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates a new SSH public key resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the SSH public key. - /// - /// - /// Parameters supplied to update the SSH public key. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName, SshPublicKeyUpdateResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Updates a new SSH public key resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the SSH public key. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName, SshPublicKeyUpdateResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, sshPublicKeyName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, sshPublicKeyName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete an SSH public key. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the SSH public key. + /// + public static void Delete(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName) + { + ((ISshPublicKeysOperations)operations).DeleteAsync(resourceGroupName, sshPublicKeyName).GetAwaiter().GetResult(); + } - /// - /// Delete an SSH public key. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the SSH public key. - /// - public static void Delete(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName) - { - operations.DeleteAsync(resourceGroupName, sshPublicKeyName).GetAwaiter().GetResult(); - } - - /// - /// Delete an SSH public key. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the SSH public key. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, sshPublicKeyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Generates and returns a public/private key pair and populates the SSH - /// public key resource with the public key. The length of the key will be 3072 - /// bits. This operation can only be performed once per SSH public key - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the SSH public key. - /// - /// - /// The encryption type of the SSH keys to be generated. See SshEncryptionTypes - /// for possible set of values. If not provided, will default to RSA. Possible - /// values include: 'RSA', 'Ed25519' - /// - public static SshPublicKeyGenerateKeyPairResult GenerateKeyPair(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName, string encryptionType = default(string)) - { - return operations.GenerateKeyPairAsync(resourceGroupName, sshPublicKeyName, encryptionType).GetAwaiter().GetResult(); - } + /// + /// Delete an SSH public key. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the SSH public key. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, sshPublicKeyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Generates and returns a public/private key pair and populates the SSH + /// public key resource with the public key. The length of the key will be 3072 + /// bits. This operation can only be performed once per SSH public key + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the SSH public key. + /// + public static SshPublicKeyGenerateKeyPairResult GenerateKeyPair(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName, string encryptionType = default(string)) + { + return ((ISshPublicKeysOperations)operations).GenerateKeyPairAsync(resourceGroupName, sshPublicKeyName, encryptionType).GetAwaiter().GetResult(); + } - /// - /// Generates and returns a public/private key pair and populates the SSH - /// public key resource with the public key. The length of the key will be 3072 - /// bits. This operation can only be performed once per SSH public key - /// resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the SSH public key. - /// - /// - /// The encryption type of the SSH keys to be generated. See SshEncryptionTypes - /// for possible set of values. If not provided, will default to RSA. Possible - /// values include: 'RSA', 'Ed25519' - /// - /// - /// The cancellation token. - /// - public static async Task GenerateKeyPairAsync(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName, string encryptionType = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Generates and returns a public/private key pair and populates the SSH + /// public key resource with the public key. The length of the key will be 3072 + /// bits. This operation can only be performed once per SSH public key + /// resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the SSH public key. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GenerateKeyPairAsync(this ISshPublicKeysOperations operations, string resourceGroupName, string sshPublicKeyName, string encryptionType = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GenerateKeyPairWithHttpMessagesAsync(resourceGroupName, sshPublicKeyName, encryptionType, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GenerateKeyPairWithHttpMessagesAsync(resourceGroupName, sshPublicKeyName, encryptionType, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all of the SSH public keys in the subscription. Use the nextLink + /// property in the response to get the next page of SSH public keys. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionNext(this ISshPublicKeysOperations operations, string nextPageLink) + { + return ((ISshPublicKeysOperations)operations).ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists all of the SSH public keys in the subscription. Use the nextLink - /// property in the response to get the next page of SSH public keys. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this ISshPublicKeysOperations operations, string nextPageLink) + /// + /// Lists all of the SSH public keys in the subscription. Use the nextLink + /// property in the response to get the next page of SSH public keys. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionNextAsync(this ISshPublicKeysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Lists all of the SSH public keys in the specified resource group. Use the + /// nextLink property in the response to get the next page of SSH public keys. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this ISshPublicKeysOperations operations, string nextPageLink) + { + return ((ISshPublicKeysOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists all of the SSH public keys in the subscription. Use the nextLink - /// property in the response to get the next page of SSH public keys. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this ISshPublicKeysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all of the SSH public keys in the specified resource group. Use the + /// nextLink property in the response to get the next page of SSH public keys. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this ISshPublicKeysOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Lists all of the SSH public keys in the specified resource group. Use the - /// nextLink property in the response to get the next page of SSH public keys. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this ISshPublicKeysOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the SSH public keys in the specified resource group. Use the - /// nextLink property in the response to get the next page of SSH public keys. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this ISshPublicKeysOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/UsageOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/UsageOperations.cs index 4fca8896efc5..9c92348df612 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/UsageOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/UsageOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// UsageOperations operations. /// - internal partial class UsageOperations : IServiceOperations, IUsageOperations + internal partial class UsageOperations : Microsoft.Rest.IServiceOperations, IUsageOperations { /// /// Initializes a new instance of the UsageOperations class. @@ -36,13 +24,13 @@ internal partial class UsageOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal UsageOperations(ComputeManagementClient client) + internal UsageOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -64,13 +52,13 @@ internal UsageOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -79,42 +67,51 @@ internal UsageOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -124,25 +121,24 @@ internal UsageOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -154,55 +150,56 @@ internal UsageOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -212,9 +209,10 @@ internal UsageOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -225,25 +223,29 @@ internal UsageOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets, for the specified location, the current compute resource usage /// information as well as the limits for compute resources under the @@ -258,13 +260,13 @@ internal UsageOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -273,51 +275,54 @@ internal UsageOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -329,55 +334,56 @@ internal UsageOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -387,9 +393,10 @@ internal UsageOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -400,24 +407,28 @@ internal UsageOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/UsageOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/UsageOperationsExtensions.cs index c8c19f4fd180..741c5ec73c78 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/UsageOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/UsageOperationsExtensions.cs @@ -1,101 +1,90 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for UsageOperations. + /// Extension methods for UsageOperations /// public static partial class UsageOperationsExtensions { - /// - /// Gets, for the specified location, the current compute resource usage - /// information as well as the limits for compute resources under the - /// subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - public static IPage List(this IUsageOperations operations, string location) - { - return operations.ListAsync(location).GetAwaiter().GetResult(); - } + /// + /// Gets, for the specified location, the current compute resource usage + /// information as well as the limits for compute resources under the + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + public static Microsoft.Rest.Azure.IPage List(this IUsageOperations operations, string location) + { + return ((IUsageOperations)operations).ListAsync(location).GetAwaiter().GetResult(); + } - /// - /// Gets, for the specified location, the current compute resource usage - /// information as well as the limits for compute resources under the - /// subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IUsageOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets, for the specified location, the current compute resource usage + /// information as well as the limits for compute resources under the + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IUsageOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets, for the specified location, the current compute resource usage + /// information as well as the limits for compute resources under the + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IUsageOperations operations, string nextPageLink) + { + return ((IUsageOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets, for the specified location, the current compute resource usage - /// information as well as the limits for compute resources under the - /// subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IUsageOperations operations, string nextPageLink) + /// + /// Gets, for the specified location, the current compute resource usage + /// information as well as the limits for compute resources under the + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IUsageOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets, for the specified location, the current compute resource usage - /// information as well as the limits for compute resources under the - /// subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IUsageOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineExtensionImagesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineExtensionImagesOperations.cs index 234f63f58b55..fdea7a3a399f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineExtensionImagesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineExtensionImagesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineExtensionImagesOperations operations. /// - internal partial class VirtualMachineExtensionImagesOperations : IServiceOperations, IVirtualMachineExtensionImagesOperations + internal partial class VirtualMachineExtensionImagesOperations : Microsoft.Rest.IServiceOperations, IVirtualMachineExtensionImagesOperations { /// /// Initializes a new instance of the VirtualMachineExtensionImagesOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualMachineExtensionImagesOperations : IServiceOperati /// /// Thrown when a required parameter is null /// - internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) + internal VirtualMachineExtensionImagesOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -57,6 +45,7 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) /// The name of Azure region. /// /// + /// /// /// /// Headers that will be added to request. @@ -64,13 +53,13 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -79,48 +68,58 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListTypesWithHttpMessagesAsync(string location, string publisherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListTypesWithHttpMessagesAsync(string location, string publisherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (publisherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publisherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publisherName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("publisherName", publisherName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTypes", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListTypes", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{publisherName}", System.Uri.EscapeDataString(publisherName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -130,25 +129,24 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -160,55 +158,56 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -218,9 +217,10 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -231,25 +231,29 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a list of virtual machine extension image versions. /// @@ -257,15 +261,19 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) /// The name of Azure region. /// /// + /// /// /// + /// /// /// /// The filter to apply on the operation. /// /// + /// /// /// + /// /// /// /// Headers that will be added to request. @@ -273,13 +281,13 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -288,39 +296,49 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVersionsWithHttpMessagesAsync(string location, string publisherName, string type, string filter = default(string), int? top = default(int?), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListVersionsWithHttpMessagesAsync(string location, string publisherName, string type, string filter = default(string), int? top = default(int?), string orderby = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (publisherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publisherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publisherName"); } + if (type == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "type"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "type"); } + + + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("publisherName", publisherName); @@ -328,17 +346,21 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) tracingParameters.Add("filter", filter); tracingParameters.Add("top", top); tracingParameters.Add("orderby", orderby); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVersions", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVersions", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{publisherName}", System.Uri.EscapeDataString(publisherName)); _url = _url.Replace("{type}", System.Uri.EscapeDataString(type)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -349,7 +371,7 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"')))); } if (orderby != null) { @@ -360,25 +382,24 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -390,55 +411,56 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -448,9 +470,10 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -461,25 +484,29 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a virtual machine extension image. /// @@ -487,10 +514,13 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) /// The name of Azure region. /// /// + /// /// /// + /// /// /// + /// /// /// /// Headers that will be added to request. @@ -498,13 +528,13 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -513,60 +543,72 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string location, string publisherName, string type, string version, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string publisherName, string type, string version, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (publisherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publisherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publisherName"); } + if (type == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "type"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "type"); } + if (version == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "version"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "version"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("publisherName", publisherName); tracingParameters.Add("type", type); tracingParameters.Add("version", version); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{publisherName}", System.Uri.EscapeDataString(publisherName)); _url = _url.Replace("{type}", System.Uri.EscapeDataString(type)); _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -576,25 +618,24 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -606,55 +647,56 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -664,9 +706,10 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -677,24 +720,28 @@ internal VirtualMachineExtensionImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineExtensionImagesOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineExtensionImagesOperationsExtensions.cs index 45ffaadda3e2..267379040157 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineExtensionImagesOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineExtensionImagesOperationsExtensions.cs @@ -1,167 +1,169 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualMachineExtensionImagesOperations. + /// Extension methods for VirtualMachineExtensionImagesOperations /// public static partial class VirtualMachineExtensionImagesOperationsExtensions { - /// - /// Gets a list of virtual machine extension image types. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// - public static IList ListTypes(this IVirtualMachineExtensionImagesOperations operations, string location, string publisherName) - { - return operations.ListTypesAsync(location, publisherName).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of virtual machine extension image types. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task> ListTypesAsync(this IVirtualMachineExtensionImagesOperations operations, string location, string publisherName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTypesWithHttpMessagesAsync(location, publisherName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Gets a list of virtual machine extension image types. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// + /// + public static System.Collections.Generic.IList ListTypes(this IVirtualMachineExtensionImagesOperations operations, string location, string publisherName) + { + return ((IVirtualMachineExtensionImagesOperations)operations).ListTypesAsync(location, publisherName).GetAwaiter().GetResult(); + } - /// - /// Gets a list of virtual machine extension image versions. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// - /// - /// - /// - /// The filter to apply on the operation. - /// - /// - /// - /// - /// - public static IList ListVersions(this IVirtualMachineExtensionImagesOperations operations, string location, string publisherName, string type, string filter = default(string), int? top = default(int?), string orderby = default(string)) + /// + /// Gets a list of virtual machine extension image types. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListTypesAsync(this IVirtualMachineExtensionImagesOperations operations, string location, string publisherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListTypesWithHttpMessagesAsync(location, publisherName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListVersionsAsync(location, publisherName, type, filter, top, orderby).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets a list of virtual machine extension image versions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// + /// + /// + /// + /// + /// + /// The filter to apply on the operation. + /// + /// + /// + /// + /// + /// + /// + public static System.Collections.Generic.IList ListVersions(this IVirtualMachineExtensionImagesOperations operations, string location, string publisherName, string type, string filter = default(string), int? top = default(int?), string orderby = default(string)) + { + return ((IVirtualMachineExtensionImagesOperations)operations).ListVersionsAsync(location, publisherName, type, filter, top, orderby).GetAwaiter().GetResult(); + } - /// - /// Gets a list of virtual machine extension image versions. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// - /// - /// - /// - /// The filter to apply on the operation. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task> ListVersionsAsync(this IVirtualMachineExtensionImagesOperations operations, string location, string publisherName, string type, string filter = default(string), int? top = default(int?), string orderby = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a list of virtual machine extension image versions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// + /// + /// + /// + /// + /// + /// The filter to apply on the operation. + /// + /// + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListVersionsAsync(this IVirtualMachineExtensionImagesOperations operations, string location, string publisherName, string type, string filter = default(string), int? top = default(int?), string orderby = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListVersionsWithHttpMessagesAsync(location, publisherName, type, filter, top, orderby, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListVersionsWithHttpMessagesAsync(location, publisherName, type, filter, top, orderby, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets a virtual machine extension image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static VirtualMachineExtensionImage Get(this IVirtualMachineExtensionImagesOperations operations, string location, string publisherName, string type, string version) + { + return ((IVirtualMachineExtensionImagesOperations)operations).GetAsync(location, publisherName, type, version).GetAwaiter().GetResult(); + } - /// - /// Gets a virtual machine extension image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// - /// - /// - /// - /// - public static VirtualMachineExtensionImage Get(this IVirtualMachineExtensionImagesOperations operations, string location, string publisherName, string type, string version) + /// + /// Gets a virtual machine extension image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualMachineExtensionImagesOperations operations, string location, string publisherName, string type, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, publisherName, type, version, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(location, publisherName, type, version).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets a virtual machine extension image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualMachineExtensionImagesOperations operations, string location, string publisherName, string type, string version, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(location, publisherName, type, version, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineExtensionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineExtensionsOperations.cs index c23c876f7f15..c154cfac491d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineExtensionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineExtensionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineExtensionsOperations operations. /// - internal partial class VirtualMachineExtensionsOperations : IServiceOperations, IVirtualMachineExtensionsOperations + internal partial class VirtualMachineExtensionsOperations : Microsoft.Rest.IServiceOperations, IVirtualMachineExtensionsOperations { /// /// Initializes a new instance of the VirtualMachineExtensionsOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualMachineExtensionsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualMachineExtensionsOperations(ComputeManagementClient client) + internal VirtualMachineExtensionsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,13 +56,13 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,53 +71,64 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string vmName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string vmName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -143,25 +142,24 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -173,55 +171,56 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -231,9 +230,10 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -244,25 +244,29 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to get the extension. /// @@ -284,13 +288,13 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -299,59 +303,71 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + if (vmExtensionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmExtensionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmExtensionName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); tracingParameters.Add("vmExtensionName", vmExtensionName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); _url = _url.Replace("{vmExtensionName}", System.Uri.EscapeDataString(vmExtensionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -365,25 +381,24 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -395,55 +410,56 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -453,9 +469,10 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -466,25 +483,29 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to create or update the extension. /// @@ -501,16 +522,16 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) /// Parameters supplied to the Create Virtual Machine Extension operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtension extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -529,16 +550,16 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) /// Parameters supplied to the Update Virtual Machine Extension operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -554,16 +575,16 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) /// The name of the virtual machine extension. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -587,13 +608,13 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -602,67 +623,78 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtension extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (extensionParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "extensionParameters"); + } + if (extensionParameters != null) + { + extensionParameters.Validate(); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + if (vmExtensionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmExtensionName"); - } - if (extensionParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "extensionParameters"); - } - if (extensionParameters != null) - { - extensionParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmExtensionName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); tracingParameters.Add("vmExtensionName", vmExtensionName); + tracingParameters.Add("extensionParameters", extensionParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); _url = _url.Replace("{vmExtensionName}", System.Uri.EscapeDataString(vmExtensionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -672,25 +704,24 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -702,61 +733,62 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(extensionParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(extensionParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(extensionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -766,9 +798,10 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -779,16 +812,16 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -797,38 +830,42 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to update the extension. /// @@ -850,13 +887,13 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -865,63 +902,74 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (extensionParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "extensionParameters"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + if (vmExtensionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmExtensionName"); - } - if (extensionParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "extensionParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmExtensionName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); tracingParameters.Add("vmExtensionName", vmExtensionName); + tracingParameters.Add("extensionParameters", extensionParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); _url = _url.Replace("{vmExtensionName}", System.Uri.EscapeDataString(vmExtensionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -931,25 +979,24 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -961,61 +1008,62 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(extensionParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(extensionParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(extensionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1025,9 +1073,10 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1038,38 +1087,42 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to delete the extension. /// @@ -1088,10 +1141,10 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1100,58 +1153,69 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, string vmExtensionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + if (vmExtensionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmExtensionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmExtensionName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); tracingParameters.Add("vmExtensionName", vmExtensionName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); _url = _url.Replace("{vmExtensionName}", System.Uri.EscapeDataString(vmExtensionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1161,25 +1225,24 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1191,55 +1254,56 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1249,19 +1313,24 @@ internal VirtualMachineExtensionsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineExtensionsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineExtensionsOperationsExtensions.cs index 2d29f0423bc6..26f478a1bd77 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineExtensionsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineExtensionsOperationsExtensions.cs @@ -1,417 +1,376 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualMachineExtensionsOperations. + /// Extension methods for VirtualMachineExtensionsOperations /// public static partial class VirtualMachineExtensionsOperationsExtensions { - /// - /// The operation to get all extensions of a Virtual Machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The expand expression to apply on the operation. - /// - public static VirtualMachineExtensionsListResult List(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string expand = default(string)) - { - return operations.ListAsync(resourceGroupName, vmName, expand).GetAwaiter().GetResult(); - } - - /// - /// The operation to get all extensions of a Virtual Machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The expand expression to apply on the operation. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vmName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to get the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// The expand expression to apply on the operation. - /// - public static VirtualMachineExtension Get(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, vmName, vmExtensionName, expand).GetAwaiter().GetResult(); - } - - /// - /// The operation to get the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// The expand expression to apply on the operation. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to create or update the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// Parameters supplied to the Create Virtual Machine Extension operation. - /// - public static VirtualMachineExtension CreateOrUpdate(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtension extensionParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); - } + /// + /// The operation to get all extensions of a Virtual Machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The expand expression to apply on the operation. + /// + public static VirtualMachineExtensionsListResult List(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string expand = default(string)) + { + return ((IVirtualMachineExtensionsOperations)operations).ListAsync(resourceGroupName, vmName, expand).GetAwaiter().GetResult(); + } - /// - /// The operation to create or update the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// Parameters supplied to the Create Virtual Machine Extension operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtension extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to get all extensions of a Virtual Machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAsync(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vmName, expand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// The operation to get the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + /// + /// The expand expression to apply on the operation. + /// + public static VirtualMachineExtension Get(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, string expand = default(string)) + { + return ((IVirtualMachineExtensionsOperations)operations).GetAsync(resourceGroupName, vmName, vmExtensionName, expand).GetAwaiter().GetResult(); + } - /// - /// The operation to update the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// Parameters supplied to the Update Virtual Machine Extension operation. - /// - public static VirtualMachineExtension Update(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) + /// + /// The operation to get the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to create or update the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + public static VirtualMachineExtension CreateOrUpdate(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtension extensionParameters) + { + return ((IVirtualMachineExtensionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); + } - /// - /// The operation to update the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// Parameters supplied to the Update Virtual Machine Extension operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to create or update the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtension extensionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// The operation to update the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + public static VirtualMachineExtension Update(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) + { + return ((IVirtualMachineExtensionsOperations)operations).UpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - public static void Delete(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName) + /// + /// The operation to update the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, vmName, vmExtensionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to delete the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + public static void Delete(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName) + { + ((IVirtualMachineExtensionsOperations)operations).DeleteAsync(resourceGroupName, vmName, vmExtensionName).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The operation to create or update the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// Parameters supplied to the Create Virtual Machine Extension operation. - /// - public static VirtualMachineExtension BeginCreateOrUpdate(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtension extensionParameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); - } - - /// - /// The operation to create or update the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// Parameters supplied to the Create Virtual Machine Extension operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtension extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to update the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// Parameters supplied to the Update Virtual Machine Extension operation. - /// - public static VirtualMachineExtension BeginUpdate(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) - { - return operations.BeginUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); - } - - /// - /// The operation to update the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// Parameters supplied to the Update Virtual Machine Extension operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// The operation to delete the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to create or update the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + public static VirtualMachineExtension BeginCreateOrUpdate(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtension extensionParameters) + { + return ((IVirtualMachineExtensionsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - public static void BeginDelete(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName) + /// + /// The operation to create or update the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtension extensionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, vmName, vmExtensionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to update the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + public static VirtualMachineExtension BeginUpdate(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) + { + return ((IVirtualMachineExtensionsOperations)operations).BeginUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to update the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// The operation to delete the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + public static void BeginDelete(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName) + { + ((IVirtualMachineExtensionsOperations)operations).BeginDeleteAsync(resourceGroupName, vmName, vmExtensionName).GetAwaiter().GetResult(); + } + /// + /// The operation to delete the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualMachineExtensionsOperations operations, string resourceGroupName, string vmName, string vmExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmName, vmExtensionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineImagesEdgeZoneOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineImagesEdgeZoneOperations.cs index ba1ed83011e6..0c4e454e67fc 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineImagesEdgeZoneOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineImagesEdgeZoneOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineImagesEdgeZoneOperations operations. /// - internal partial class VirtualMachineImagesEdgeZoneOperations : IServiceOperations, IVirtualMachineImagesEdgeZoneOperations + internal partial class VirtualMachineImagesEdgeZoneOperations : Microsoft.Rest.IServiceOperations, IVirtualMachineImagesEdgeZoneOperations { /// /// Initializes a new instance of the VirtualMachineImagesEdgeZoneOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualMachineImagesEdgeZoneOperations : IServiceOperatio /// /// Thrown when a required parameter is null /// - internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) + internal VirtualMachineImagesEdgeZoneOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -66,13 +54,13 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -81,48 +69,58 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPublishersWithHttpMessagesAsync(string location, string edgeZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListPublishersWithHttpMessagesAsync(string location, string edgeZone, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (edgeZone == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "edgeZone"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "edgeZone"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("edgeZone", edgeZone); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublishers", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListPublishers", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{edgeZone}", System.Uri.EscapeDataString(edgeZone)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -132,25 +130,24 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -162,55 +159,56 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -220,9 +218,10 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -233,25 +232,29 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a list of virtual machine image offers for the specified location, /// edge zone and publisher. @@ -271,13 +274,13 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -286,54 +289,65 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListOffersWithHttpMessagesAsync(string location, string edgeZone, string publisherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListOffersWithHttpMessagesAsync(string location, string edgeZone, string publisherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (edgeZone == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "edgeZone"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "edgeZone"); } + if (publisherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publisherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publisherName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("edgeZone", edgeZone); tracingParameters.Add("publisherName", publisherName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListOffers", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListOffers", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{edgeZone}", System.Uri.EscapeDataString(edgeZone)); _url = _url.Replace("{publisherName}", System.Uri.EscapeDataString(publisherName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -343,25 +357,24 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -373,55 +386,56 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -431,9 +445,10 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -444,25 +459,29 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a list of virtual machine image SKUs for the specified location, edge /// zone, publisher, and offer. @@ -485,13 +504,13 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -500,60 +519,72 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSkusWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListSkusWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (edgeZone == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "edgeZone"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "edgeZone"); } + if (publisherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publisherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publisherName"); } + if (offer == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "offer"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "offer"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("edgeZone", edgeZone); tracingParameters.Add("publisherName", publisherName); tracingParameters.Add("offer", offer); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSkus", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSkus", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{edgeZone}", System.Uri.EscapeDataString(edgeZone)); _url = _url.Replace("{publisherName}", System.Uri.EscapeDataString(publisherName)); _url = _url.Replace("{offer}", System.Uri.EscapeDataString(offer)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -563,25 +594,24 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -593,55 +623,56 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -651,9 +682,10 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -664,25 +696,29 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a list of all virtual machine image versions for the specified /// location, edge zone, publisher, offer, and SKU. @@ -718,13 +754,13 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -733,47 +769,59 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (edgeZone == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "edgeZone"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "edgeZone"); } + if (publisherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publisherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publisherName"); } + if (offer == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "offer"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "offer"); } + if (skus == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "skus"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "skus"); } + + + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("edgeZone", edgeZone); @@ -783,19 +831,23 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) tracingParameters.Add("expand", expand); tracingParameters.Add("top", top); tracingParameters.Add("orderby", orderby); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{edgeZone}", System.Uri.EscapeDataString(edgeZone)); _url = _url.Replace("{publisherName}", System.Uri.EscapeDataString(publisherName)); _url = _url.Replace("{offer}", System.Uri.EscapeDataString(offer)); _url = _url.Replace("{skus}", System.Uri.EscapeDataString(skus)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -806,7 +858,7 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"')))); } if (orderby != null) { @@ -817,25 +869,24 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -847,55 +898,56 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -905,9 +957,10 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -918,25 +971,29 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a virtual machine image in an edge zone. /// @@ -964,13 +1021,13 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -979,51 +1036,61 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, string skus, string version, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string edgeZone, string publisherName, string offer, string skus, string version, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (edgeZone == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "edgeZone"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "edgeZone"); } + if (publisherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publisherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publisherName"); } + if (offer == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "offer"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "offer"); } + if (skus == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "skus"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "skus"); } + if (version == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "version"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "version"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("edgeZone", edgeZone); @@ -1031,11 +1098,14 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) tracingParameters.Add("offer", offer); tracingParameters.Add("skus", skus); tracingParameters.Add("version", version); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{edgeZone}", System.Uri.EscapeDataString(edgeZone)); @@ -1043,8 +1113,9 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) _url = _url.Replace("{offer}", System.Uri.EscapeDataString(offer)); _url = _url.Replace("{skus}", System.Uri.EscapeDataString(skus)); _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1054,25 +1125,24 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1084,55 +1154,56 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1142,9 +1213,10 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1155,24 +1227,28 @@ internal VirtualMachineImagesEdgeZoneOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineImagesEdgeZoneOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineImagesEdgeZoneOperationsExtensions.cs index 7de8001583ac..273dc0294a71 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineImagesEdgeZoneOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineImagesEdgeZoneOperationsExtensions.cs @@ -1,315 +1,299 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualMachineImagesEdgeZoneOperations. + /// Extension methods for VirtualMachineImagesEdgeZoneOperations /// public static partial class VirtualMachineImagesEdgeZoneOperationsExtensions { - /// - /// Gets a list of virtual machine image publishers for the specified Azure - /// location and edge zone. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The name of the edge zone. - /// - public static IList ListPublishers(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone) - { - return operations.ListPublishersAsync(location, edgeZone).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of virtual machine image publishers for the specified Azure - /// location and edge zone. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The name of the edge zone. - /// - /// - /// The cancellation token. - /// - public static async Task> ListPublishersAsync(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListPublishersWithHttpMessagesAsync(location, edgeZone, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of virtual machine image offers for the specified location, - /// edge zone and publisher. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The name of the edge zone. - /// - /// - /// A valid image publisher. - /// - public static IList ListOffers(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName) - { - return operations.ListOffersAsync(location, edgeZone, publisherName).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of virtual machine image offers for the specified location, - /// edge zone and publisher. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The name of the edge zone. - /// - /// - /// A valid image publisher. - /// - /// - /// The cancellation token. - /// - public static async Task> ListOffersAsync(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListOffersWithHttpMessagesAsync(location, edgeZone, publisherName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Gets a list of virtual machine image publishers for the specified Azure + /// location and edge zone. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the edge zone. + /// + public static System.Collections.Generic.IList ListPublishers(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone) + { + return ((IVirtualMachineImagesEdgeZoneOperations)operations).ListPublishersAsync(location, edgeZone).GetAwaiter().GetResult(); + } - /// - /// Gets a list of virtual machine image SKUs for the specified location, edge - /// zone, publisher, and offer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The name of the edge zone. - /// - /// - /// A valid image publisher. - /// - /// - /// A valid image publisher offer. - /// - public static IList ListSkus(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer) + /// + /// Gets a list of virtual machine image publishers for the specified Azure + /// location and edge zone. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListPublishersAsync(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListPublishersWithHttpMessagesAsync(location, edgeZone, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListSkusAsync(location, edgeZone, publisherName, offer).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets a list of virtual machine image offers for the specified location, + /// edge zone and publisher. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + public static System.Collections.Generic.IList ListOffers(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName) + { + return ((IVirtualMachineImagesEdgeZoneOperations)operations).ListOffersAsync(location, edgeZone, publisherName).GetAwaiter().GetResult(); + } - /// - /// Gets a list of virtual machine image SKUs for the specified location, edge - /// zone, publisher, and offer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The name of the edge zone. - /// - /// - /// A valid image publisher. - /// - /// - /// A valid image publisher offer. - /// - /// - /// The cancellation token. - /// - public static async Task> ListSkusAsync(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a list of virtual machine image offers for the specified location, + /// edge zone and publisher. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListOffersAsync(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListOffersWithHttpMessagesAsync(location, edgeZone, publisherName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListSkusWithHttpMessagesAsync(location, edgeZone, publisherName, offer, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets a list of virtual machine image SKUs for the specified location, edge + /// zone, publisher, and offer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + public static System.Collections.Generic.IList ListSkus(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer) + { + return ((IVirtualMachineImagesEdgeZoneOperations)operations).ListSkusAsync(location, edgeZone, publisherName, offer).GetAwaiter().GetResult(); + } - /// - /// Gets a list of all virtual machine image versions for the specified - /// location, edge zone, publisher, offer, and SKU. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The name of the edge zone. - /// - /// - /// A valid image publisher. - /// - /// - /// A valid image publisher offer. - /// - /// - /// A valid image SKU. - /// - /// - /// The expand expression to apply on the operation. - /// - /// - /// An integer value specifying the number of images to return that matches - /// supplied values. - /// - /// - /// Specifies the order of the results returned. Formatted as an OData query. - /// - public static IList List(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string)) + /// + /// Gets a list of virtual machine image SKUs for the specified location, edge + /// zone, publisher, and offer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListSkusAsync(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListSkusWithHttpMessagesAsync(location, edgeZone, publisherName, offer, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(location, edgeZone, publisherName, offer, skus, expand, top, orderby).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets a list of all virtual machine image versions for the specified + /// location, edge zone, publisher, offer, and SKU. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// A valid image SKU. + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// An integer value specifying the number of images to return that matches + /// supplied values. + /// + /// + /// Specifies the order of the results returned. Formatted as an OData query. + /// + public static System.Collections.Generic.IList List(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string)) + { + return ((IVirtualMachineImagesEdgeZoneOperations)operations).ListAsync(location, edgeZone, publisherName, offer, skus, expand, top, orderby).GetAwaiter().GetResult(); + } - /// - /// Gets a list of all virtual machine image versions for the specified - /// location, edge zone, publisher, offer, and SKU. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The name of the edge zone. - /// - /// - /// A valid image publisher. - /// - /// - /// A valid image publisher offer. - /// - /// - /// A valid image SKU. - /// - /// - /// The expand expression to apply on the operation. - /// - /// - /// An integer value specifying the number of images to return that matches - /// supplied values. - /// - /// - /// Specifies the order of the results returned. Formatted as an OData query. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a list of all virtual machine image versions for the specified + /// location, edge zone, publisher, offer, and SKU. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// A valid image SKU. + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// An integer value specifying the number of images to return that matches + /// supplied values. + /// + /// + /// Specifies the order of the results returned. Formatted as an OData query. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, edgeZone, publisherName, offer, skus, expand, top, orderby, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(location, edgeZone, publisherName, offer, skus, expand, top, orderby, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets a virtual machine image in an edge zone. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// A valid image SKU. + /// + /// + /// A valid image SKU version. + /// + public static VirtualMachineImage Get(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer, string skus, string version) + { + return ((IVirtualMachineImagesEdgeZoneOperations)operations).GetAsync(location, edgeZone, publisherName, offer, skus, version).GetAwaiter().GetResult(); + } - /// - /// Gets a virtual machine image in an edge zone. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The name of the edge zone. - /// - /// - /// A valid image publisher. - /// - /// - /// A valid image publisher offer. - /// - /// - /// A valid image SKU. - /// - /// - /// A valid image SKU version. - /// - public static VirtualMachineImage Get(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer, string skus, string version) + /// + /// Gets a virtual machine image in an edge zone. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// A valid image SKU. + /// + /// + /// A valid image SKU version. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer, string skus, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, edgeZone, publisherName, offer, skus, version, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(location, edgeZone, publisherName, offer, skus, version).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets a virtual machine image in an edge zone. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The name of the edge zone. - /// - /// - /// A valid image publisher. - /// - /// - /// A valid image publisher offer. - /// - /// - /// A valid image SKU. - /// - /// - /// A valid image SKU version. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualMachineImagesEdgeZoneOperations operations, string location, string edgeZone, string publisherName, string offer, string skus, string version, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(location, edgeZone, publisherName, offer, skus, version, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineImagesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineImagesOperations.cs index fc5c29334684..eaca6cdcadfe 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineImagesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineImagesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineImagesOperations operations. /// - internal partial class VirtualMachineImagesOperations : IServiceOperations, IVirtualMachineImagesOperations + internal partial class VirtualMachineImagesOperations : Microsoft.Rest.IServiceOperations, IVirtualMachineImagesOperations { /// /// Initializes a new instance of the VirtualMachineImagesOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualMachineImagesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualMachineImagesOperations(ComputeManagementClient client) + internal VirtualMachineImagesOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -66,13 +54,13 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -81,48 +69,58 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByEdgeZoneWithHttpMessagesAsync(string location, string edgeZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListByEdgeZoneWithHttpMessagesAsync(string location, string edgeZone, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (edgeZone == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "edgeZone"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "edgeZone"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("edgeZone", edgeZone); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByEdgeZone", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByEdgeZone", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/vmimages").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{edgeZone}", System.Uri.EscapeDataString(edgeZone)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -132,25 +130,24 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -162,55 +159,56 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -220,9 +218,10 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -233,25 +232,29 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a list of virtual machine image publishers for the specified Azure /// location. @@ -265,13 +268,13 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -280,42 +283,51 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPublishersWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListPublishersWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublishers", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListPublishers", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -325,25 +337,24 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -355,55 +366,56 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -413,9 +425,10 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -426,25 +439,29 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a list of virtual machine image offers for the specified location and /// publisher. @@ -461,13 +478,13 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -476,48 +493,58 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListOffersWithHttpMessagesAsync(string location, string publisherName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListOffersWithHttpMessagesAsync(string location, string publisherName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (publisherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publisherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publisherName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("publisherName", publisherName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListOffers", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListOffers", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{publisherName}", System.Uri.EscapeDataString(publisherName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -527,25 +554,24 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -557,55 +583,56 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -615,9 +642,10 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -628,25 +656,29 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a list of virtual machine image SKUs for the specified location, /// publisher, and offer. @@ -666,13 +698,13 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -681,54 +713,65 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSkusWithHttpMessagesAsync(string location, string publisherName, string offer, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListSkusWithHttpMessagesAsync(string location, string publisherName, string offer, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (publisherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publisherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publisherName"); } + if (offer == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "offer"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "offer"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("publisherName", publisherName); tracingParameters.Add("offer", offer); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSkus", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSkus", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{publisherName}", System.Uri.EscapeDataString(publisherName)); _url = _url.Replace("{offer}", System.Uri.EscapeDataString(offer)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -738,25 +781,24 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -768,55 +810,56 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -826,9 +869,10 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -839,25 +883,29 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a list of all virtual machine image versions for the specified /// location, publisher, offer, and SKU. @@ -878,8 +926,10 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) /// The expand expression to apply on the operation. /// /// + /// /// /// + /// /// /// /// Headers that will be added to request. @@ -887,13 +937,13 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -902,43 +952,54 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (publisherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publisherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publisherName"); } + if (offer == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "offer"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "offer"); } + if (skus == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "skus"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "skus"); } + + + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("publisherName", publisherName); @@ -947,18 +1008,22 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) tracingParameters.Add("expand", expand); tracingParameters.Add("top", top); tracingParameters.Add("orderby", orderby); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{publisherName}", System.Uri.EscapeDataString(publisherName)); _url = _url.Replace("{offer}", System.Uri.EscapeDataString(offer)); _url = _url.Replace("{skus}", System.Uri.EscapeDataString(skus)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -969,7 +1034,7 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"')))); } if (orderby != null) { @@ -980,25 +1045,24 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1010,55 +1074,56 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1068,9 +1133,10 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1081,25 +1147,29 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a virtual machine image. /// @@ -1124,13 +1194,13 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1139,66 +1209,79 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string location, string publisherName, string offer, string skus, string version, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string publisherName, string offer, string skus, string version, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (publisherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publisherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publisherName"); } + if (offer == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "offer"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "offer"); } + if (skus == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "skus"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "skus"); } + if (version == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "version"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "version"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("publisherName", publisherName); tracingParameters.Add("offer", offer); tracingParameters.Add("skus", skus); tracingParameters.Add("version", version); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{publisherName}", System.Uri.EscapeDataString(publisherName)); _url = _url.Replace("{offer}", System.Uri.EscapeDataString(offer)); _url = _url.Replace("{skus}", System.Uri.EscapeDataString(skus)); _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1208,25 +1291,24 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1238,55 +1320,56 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1296,9 +1379,10 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1309,25 +1393,29 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The name of Azure region. /// @@ -1344,8 +1432,10 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) /// The expand expression to apply on the operation. /// /// + /// /// /// + /// /// /// /// Headers that will be added to request. @@ -1353,13 +1443,13 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1368,47 +1458,58 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithPropertiesWithHttpMessagesAsync(string location, string publisherName, string offer, string skus, string expand, int? top = default(int?), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithPropertiesWithHttpMessagesAsync(string location, string publisherName, string offer, string skus, string expand, int? top = default(int?), string orderby = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (publisherName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publisherName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "publisherName"); } + if (offer == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "offer"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "offer"); } + if (skus == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "skus"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "skus"); } + if (expand == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "expand"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "expand"); } + + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("publisherName", publisherName); @@ -1417,18 +1518,22 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) tracingParameters.Add("expand", expand); tracingParameters.Add("top", top); tracingParameters.Add("orderby", orderby); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWithProperties", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListWithProperties", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{publisherName}", System.Uri.EscapeDataString(publisherName)); _url = _url.Replace("{offer}", System.Uri.EscapeDataString(offer)); _url = _url.Replace("{skus}", System.Uri.EscapeDataString(skus)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1439,7 +1544,7 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) } if (top != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(top, this.Client.SerializationSettings).Trim('"')))); } if (orderby != null) { @@ -1450,25 +1555,24 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1480,55 +1584,56 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1538,9 +1643,10 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1551,24 +1657,28 @@ internal VirtualMachineImagesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineImagesOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineImagesOperationsExtensions.cs index 520083cd7ed3..7f9e2ba23504 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineImagesOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineImagesOperationsExtensions.cs @@ -1,381 +1,377 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualMachineImagesOperations. + /// Extension methods for VirtualMachineImagesOperations /// public static partial class VirtualMachineImagesOperationsExtensions { - /// - /// Gets a list of all virtual machine image versions for the specified edge - /// zone - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The name of the edge zone. - /// - public static VmImagesInEdgeZoneListResult ListByEdgeZone(this IVirtualMachineImagesOperations operations, string location, string edgeZone) - { - return operations.ListByEdgeZoneAsync(location, edgeZone).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all virtual machine image versions for the specified edge - /// zone - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The name of the edge zone. - /// - /// - /// The cancellation token. - /// - public static async Task ListByEdgeZoneAsync(this IVirtualMachineImagesOperations operations, string location, string edgeZone, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByEdgeZoneWithHttpMessagesAsync(location, edgeZone, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of virtual machine image publishers for the specified Azure - /// location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - public static IList ListPublishers(this IVirtualMachineImagesOperations operations, string location) - { - return operations.ListPublishersAsync(location).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of virtual machine image publishers for the specified Azure - /// location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The cancellation token. - /// - public static async Task> ListPublishersAsync(this IVirtualMachineImagesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListPublishersWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of virtual machine image offers for the specified location and - /// publisher. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// A valid image publisher. - /// - public static IList ListOffers(this IVirtualMachineImagesOperations operations, string location, string publisherName) - { - return operations.ListOffersAsync(location, publisherName).GetAwaiter().GetResult(); - } + /// + /// Gets a list of all virtual machine image versions for the specified edge + /// zone + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the edge zone. + /// + public static VmImagesInEdgeZoneListResult ListByEdgeZone(this IVirtualMachineImagesOperations operations, string location, string edgeZone) + { + return ((IVirtualMachineImagesOperations)operations).ListByEdgeZoneAsync(location, edgeZone).GetAwaiter().GetResult(); + } - /// - /// Gets a list of virtual machine image offers for the specified location and - /// publisher. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// A valid image publisher. - /// - /// - /// The cancellation token. - /// - public static async Task> ListOffersAsync(this IVirtualMachineImagesOperations operations, string location, string publisherName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a list of all virtual machine image versions for the specified edge + /// zone + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the edge zone. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListByEdgeZoneAsync(this IVirtualMachineImagesOperations operations, string location, string edgeZone, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByEdgeZoneWithHttpMessagesAsync(location, edgeZone, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListOffersWithHttpMessagesAsync(location, publisherName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets a list of virtual machine image publishers for the specified Azure + /// location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + public static System.Collections.Generic.IList ListPublishers(this IVirtualMachineImagesOperations operations, string location) + { + return ((IVirtualMachineImagesOperations)operations).ListPublishersAsync(location).GetAwaiter().GetResult(); + } - /// - /// Gets a list of virtual machine image SKUs for the specified location, - /// publisher, and offer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// A valid image publisher. - /// - /// - /// A valid image publisher offer. - /// - public static IList ListSkus(this IVirtualMachineImagesOperations operations, string location, string publisherName, string offer) + /// + /// Gets a list of virtual machine image publishers for the specified Azure + /// location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListPublishersAsync(this IVirtualMachineImagesOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListPublishersWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListSkusAsync(location, publisherName, offer).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets a list of virtual machine image offers for the specified location and + /// publisher. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// A valid image publisher. + /// + public static System.Collections.Generic.IList ListOffers(this IVirtualMachineImagesOperations operations, string location, string publisherName) + { + return ((IVirtualMachineImagesOperations)operations).ListOffersAsync(location, publisherName).GetAwaiter().GetResult(); + } - /// - /// Gets a list of virtual machine image SKUs for the specified location, - /// publisher, and offer. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// A valid image publisher. - /// - /// - /// A valid image publisher offer. - /// - /// - /// The cancellation token. - /// - public static async Task> ListSkusAsync(this IVirtualMachineImagesOperations operations, string location, string publisherName, string offer, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a list of virtual machine image offers for the specified location and + /// publisher. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// A valid image publisher. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListOffersAsync(this IVirtualMachineImagesOperations operations, string location, string publisherName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListOffersWithHttpMessagesAsync(location, publisherName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListSkusWithHttpMessagesAsync(location, publisherName, offer, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets a list of virtual machine image SKUs for the specified location, + /// publisher, and offer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + public static System.Collections.Generic.IList ListSkus(this IVirtualMachineImagesOperations operations, string location, string publisherName, string offer) + { + return ((IVirtualMachineImagesOperations)operations).ListSkusAsync(location, publisherName, offer).GetAwaiter().GetResult(); + } - /// - /// Gets a list of all virtual machine image versions for the specified - /// location, publisher, offer, and SKU. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// A valid image publisher. - /// - /// - /// A valid image publisher offer. - /// - /// - /// A valid image SKU. - /// - /// - /// The expand expression to apply on the operation. - /// - /// - /// - /// - /// - public static IList List(this IVirtualMachineImagesOperations operations, string location, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string)) + /// + /// Gets a list of virtual machine image SKUs for the specified location, + /// publisher, and offer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListSkusAsync(this IVirtualMachineImagesOperations operations, string location, string publisherName, string offer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListSkusWithHttpMessagesAsync(location, publisherName, offer, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(location, publisherName, offer, skus, expand, top, orderby).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets a list of all virtual machine image versions for the specified + /// location, publisher, offer, and SKU. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// A valid image SKU. + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// + /// + /// + /// + /// + public static System.Collections.Generic.IList List(this IVirtualMachineImagesOperations operations, string location, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string)) + { + return ((IVirtualMachineImagesOperations)operations).ListAsync(location, publisherName, offer, skus, expand, top, orderby).GetAwaiter().GetResult(); + } - /// - /// Gets a list of all virtual machine image versions for the specified - /// location, publisher, offer, and SKU. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// A valid image publisher. - /// - /// - /// A valid image publisher offer. - /// - /// - /// A valid image SKU. - /// - /// - /// The expand expression to apply on the operation. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualMachineImagesOperations operations, string location, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a list of all virtual machine image versions for the specified + /// location, publisher, offer, and SKU. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// A valid image SKU. + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualMachineImagesOperations operations, string location, string publisherName, string offer, string skus, string expand = default(string), int? top = default(int?), string orderby = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, publisherName, offer, skus, expand, top, orderby, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(location, publisherName, offer, skus, expand, top, orderby, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets a virtual machine image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// A valid image SKU. + /// + /// + /// A valid image SKU version. + /// + public static VirtualMachineImage Get(this IVirtualMachineImagesOperations operations, string location, string publisherName, string offer, string skus, string version) + { + return ((IVirtualMachineImagesOperations)operations).GetAsync(location, publisherName, offer, skus, version).GetAwaiter().GetResult(); + } - /// - /// Gets a virtual machine image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// A valid image publisher. - /// - /// - /// A valid image publisher offer. - /// - /// - /// A valid image SKU. - /// - /// - /// A valid image SKU version. - /// - public static VirtualMachineImage Get(this IVirtualMachineImagesOperations operations, string location, string publisherName, string offer, string skus, string version) + /// + /// Gets a virtual machine image. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// A valid image SKU. + /// + /// + /// A valid image SKU version. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualMachineImagesOperations operations, string location, string publisherName, string offer, string skus, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, publisherName, offer, skus, version, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(location, publisherName, offer, skus, version).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// A valid image SKU. + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// + /// + /// + /// + /// + public static System.Collections.Generic.IList ListWithProperties(this IVirtualMachineImagesOperations operations, string location, string publisherName, string offer, string skus, string expand, int? top = default(int?), string orderby = default(string)) + { + return ((IVirtualMachineImagesOperations)operations).ListWithPropertiesAsync(location, publisherName, offer, skus, expand, top, orderby).GetAwaiter().GetResult(); + } - /// - /// Gets a virtual machine image. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// A valid image publisher. - /// - /// - /// A valid image publisher offer. - /// - /// - /// A valid image SKU. - /// - /// - /// A valid image SKU version. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualMachineImagesOperations operations, string location, string publisherName, string offer, string skus, string version, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// A valid image publisher. + /// + /// + /// A valid image publisher offer. + /// + /// + /// A valid image SKU. + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListWithPropertiesAsync(this IVirtualMachineImagesOperations operations, string location, string publisherName, string offer, string skus, string expand, int? top = default(int?), string orderby = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithPropertiesWithHttpMessagesAsync(location, publisherName, offer, skus, expand, top, orderby, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(location, publisherName, offer, skus, version, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// A valid image publisher. - /// - /// - /// A valid image publisher offer. - /// - /// - /// A valid image SKU. - /// - /// - /// The expand expression to apply on the operation. - /// - /// - /// - /// - /// - public static IList ListWithProperties(this IVirtualMachineImagesOperations operations, string location, string publisherName, string offer, string skus, string expand, int? top = default(int?), string orderby = default(string)) - { - return operations.ListWithPropertiesAsync(location, publisherName, offer, skus, expand, top, orderby).GetAwaiter().GetResult(); - } - - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// A valid image publisher. - /// - /// - /// A valid image publisher offer. - /// - /// - /// A valid image SKU. - /// - /// - /// The expand expression to apply on the operation. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task> ListWithPropertiesAsync(this IVirtualMachineImagesOperations operations, string location, string publisherName, string offer, string skus, string expand, int? top = default(int?), string orderby = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithPropertiesWithHttpMessagesAsync(location, publisherName, offer, skus, expand, top, orderby, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineRunCommandsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineRunCommandsOperations.cs index d8179f2fbdb7..de22b9896e9e 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineRunCommandsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineRunCommandsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineRunCommandsOperations operations. /// - internal partial class VirtualMachineRunCommandsOperations : IServiceOperations, IVirtualMachineRunCommandsOperations + internal partial class VirtualMachineRunCommandsOperations : Microsoft.Rest.IServiceOperations, IVirtualMachineRunCommandsOperations { /// /// Initializes a new instance of the VirtualMachineRunCommandsOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualMachineRunCommandsOperations : IServiceOperations< /// /// Thrown when a required parameter is null /// - internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) + internal VirtualMachineRunCommandsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -62,13 +50,13 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -77,42 +65,51 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -122,25 +119,24 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -152,55 +148,56 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -210,9 +207,10 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -223,25 +221,29 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets specific run command for a subscription in a location. /// @@ -260,13 +262,13 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -275,48 +277,58 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string location, string commandId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string commandId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (commandId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "commandId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "commandId"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("commandId", commandId); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{commandId}", System.Uri.EscapeDataString(commandId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -326,25 +338,24 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -356,55 +367,56 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -414,9 +426,10 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -427,25 +440,29 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to get all run commands of a Virtual Machine. /// @@ -464,13 +481,13 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -479,53 +496,64 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVirtualMachineWithHttpMessagesAsync(string resourceGroupName, string vmName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVirtualMachineWithHttpMessagesAsync(string resourceGroupName, string vmName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVirtualMachine", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVirtualMachine", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -539,25 +567,24 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -569,55 +596,56 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -627,9 +655,10 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -640,25 +669,29 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to get the run command. /// @@ -680,13 +713,13 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -695,59 +728,71 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByVirtualMachineWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetByVirtualMachineWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + if (runCommandName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "runCommandName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "runCommandName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); tracingParameters.Add("runCommandName", runCommandName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByVirtualMachine", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetByVirtualMachine", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); _url = _url.Replace("{runCommandName}", System.Uri.EscapeDataString(runCommandName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -761,25 +806,24 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -791,55 +835,56 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -849,9 +894,10 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -862,25 +908,29 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to create or update the run command. /// @@ -897,16 +947,16 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// Parameters supplied to the Create Virtual Machine RunCommand operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommand runCommand, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommand runCommand, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, runCommand, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, runCommand, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -925,16 +975,16 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// Parameters supplied to the Update Virtual Machine RunCommand operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommandUpdate runCommand, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommandUpdate runCommand, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, runCommand, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, runCommand, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -950,16 +1000,16 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// The name of the VirtualMachineRunCommand /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -983,13 +1033,13 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -998,67 +1048,78 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommand runCommand, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommand runCommand, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (runCommand == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "runCommand"); + } + if (runCommand != null) + { + runCommand.Validate(); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + if (runCommandName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "runCommandName"); - } - if (runCommand == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "runCommand"); - } - if (runCommand != null) - { - runCommand.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "runCommandName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); tracingParameters.Add("runCommandName", runCommandName); + tracingParameters.Add("runCommand", runCommand); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); _url = _url.Replace("{runCommandName}", System.Uri.EscapeDataString(runCommandName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1068,25 +1129,24 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1098,61 +1158,62 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(runCommand != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(runCommand, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(runCommand, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1162,9 +1223,10 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1175,16 +1237,16 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1193,38 +1255,42 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to update the run command. /// @@ -1246,13 +1312,13 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1261,63 +1327,74 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommandUpdate runCommand, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommandUpdate runCommand, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (runCommand == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "runCommand"); } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + if (runCommandName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "runCommandName"); - } - if (runCommand == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "runCommand"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "runCommandName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); tracingParameters.Add("runCommandName", runCommandName); + tracingParameters.Add("runCommand", runCommand); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); _url = _url.Replace("{runCommandName}", System.Uri.EscapeDataString(runCommandName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1327,25 +1404,24 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1357,61 +1433,62 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(runCommand != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(runCommand, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(runCommand, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1421,9 +1498,10 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1434,38 +1512,42 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to delete the run command. /// @@ -1484,10 +1566,10 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1496,58 +1578,69 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, string runCommandName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + if (runCommandName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "runCommandName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "runCommandName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); tracingParameters.Add("runCommandName", runCommandName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); _url = _url.Replace("{runCommandName}", System.Uri.EscapeDataString(runCommandName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1557,25 +1650,24 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1587,55 +1679,56 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1645,20 +1738,25 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all available run commands for a subscription in a location. /// @@ -1671,13 +1769,13 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1686,51 +1784,54 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1742,55 +1843,56 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1800,9 +1902,10 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1813,25 +1916,29 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to get all run commands of a Virtual Machine. /// @@ -1844,13 +1951,13 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1859,51 +1966,54 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVirtualMachineNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVirtualMachineNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVirtualMachineNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVirtualMachineNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1915,55 +2025,56 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1973,9 +2084,10 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1986,24 +2098,28 @@ internal VirtualMachineRunCommandsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineRunCommandsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineRunCommandsOperationsExtensions.cs index 836bd786a25a..bd9c6322d3bb 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineRunCommandsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineRunCommandsOperationsExtensions.cs @@ -1,565 +1,520 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualMachineRunCommandsOperations. + /// Extension methods for VirtualMachineRunCommandsOperations /// public static partial class VirtualMachineRunCommandsOperationsExtensions { - /// - /// Lists all available run commands for a subscription in a location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - public static IPage List(this IVirtualMachineRunCommandsOperations operations, string location) - { - return operations.ListAsync(location).GetAwaiter().GetResult(); - } + /// + /// Lists all available run commands for a subscription in a location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualMachineRunCommandsOperations operations, string location) + { + return ((IVirtualMachineRunCommandsOperations)operations).ListAsync(location).GetAwaiter().GetResult(); + } - /// - /// Lists all available run commands for a subscription in a location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualMachineRunCommandsOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all available run commands for a subscription in a location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualMachineRunCommandsOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets specific run command for a subscription in a location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// Specifies a commandId of predefined built-in script. Command IDs available + /// for Linux are listed at + /// https://aka.ms/RunCommandManagedLinux#available-commands, Windows at + /// https://aka.ms/RunCommandManagedWindows#available-commands. + /// + public static RunCommandDocument Get(this IVirtualMachineRunCommandsOperations operations, string location, string commandId) + { + return ((IVirtualMachineRunCommandsOperations)operations).GetAsync(location, commandId).GetAwaiter().GetResult(); + } - /// - /// Gets specific run command for a subscription in a location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// Specifies a commandId of predefined built-in script. Command IDs available - /// for Linux are listed at - /// https://aka.ms/RunCommandManagedLinux#available-commands, Windows at - /// https://aka.ms/RunCommandManagedWindows#available-commands. - /// - public static RunCommandDocument Get(this IVirtualMachineRunCommandsOperations operations, string location, string commandId) + /// + /// Gets specific run command for a subscription in a location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// Specifies a commandId of predefined built-in script. Command IDs available + /// for Linux are listed at + /// https://aka.ms/RunCommandManagedLinux#available-commands, Windows at + /// https://aka.ms/RunCommandManagedWindows#available-commands. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualMachineRunCommandsOperations operations, string location, string commandId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, commandId, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(location, commandId).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to get all run commands of a Virtual Machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachine + /// + /// + /// The expand expression to apply on the operation. + /// + public static Microsoft.Rest.Azure.IPage ListByVirtualMachine(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string expand = default(string)) + { + return ((IVirtualMachineRunCommandsOperations)operations).ListByVirtualMachineAsync(resourceGroupName, vmName, expand).GetAwaiter().GetResult(); + } - /// - /// Gets specific run command for a subscription in a location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// Specifies a commandId of predefined built-in script. Command IDs available - /// for Linux are listed at - /// https://aka.ms/RunCommandManagedLinux#available-commands, Windows at - /// https://aka.ms/RunCommandManagedWindows#available-commands. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualMachineRunCommandsOperations operations, string location, string commandId, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to get all run commands of a Virtual Machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachine + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVirtualMachineAsync(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVirtualMachineWithHttpMessagesAsync(resourceGroupName, vmName, expand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(location, commandId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// The operation to get the run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachine + /// + /// + /// The name of the VirtualMachineRunCommand + /// + /// + /// The expand expression to apply on the operation. + /// + public static VirtualMachineRunCommand GetByVirtualMachine(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, string expand = default(string)) + { + return ((IVirtualMachineRunCommandsOperations)operations).GetByVirtualMachineAsync(resourceGroupName, vmName, runCommandName, expand).GetAwaiter().GetResult(); + } - /// - /// The operation to get all run commands of a Virtual Machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachine - /// - /// - /// The expand expression to apply on the operation. - /// - public static IPage ListByVirtualMachine(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string expand = default(string)) + /// + /// The operation to get the run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachine + /// + /// + /// The name of the VirtualMachineRunCommand + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetByVirtualMachineAsync(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetByVirtualMachineWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByVirtualMachineAsync(resourceGroupName, vmName, expand).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to create or update the run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachine + /// + /// + /// The name of the VirtualMachineRunCommand + /// + public static VirtualMachineRunCommand CreateOrUpdate(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommand runCommand) + { + return ((IVirtualMachineRunCommandsOperations)operations).CreateOrUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand).GetAwaiter().GetResult(); + } - /// - /// The operation to get all run commands of a Virtual Machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachine - /// - /// - /// The expand expression to apply on the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVirtualMachineAsync(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to create or update the run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachine + /// + /// + /// The name of the VirtualMachineRunCommand + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommand runCommand, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, runCommand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByVirtualMachineWithHttpMessagesAsync(resourceGroupName, vmName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// The operation to update the run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachine + /// + /// + /// The name of the VirtualMachineRunCommand + /// + public static VirtualMachineRunCommand Update(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommandUpdate runCommand) + { + return ((IVirtualMachineRunCommandsOperations)operations).UpdateAsync(resourceGroupName, vmName, runCommandName, runCommand).GetAwaiter().GetResult(); + } - /// - /// The operation to get the run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachine - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// The expand expression to apply on the operation. - /// - public static VirtualMachineRunCommand GetByVirtualMachine(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, string expand = default(string)) + /// + /// The operation to update the run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachine + /// + /// + /// The name of the VirtualMachineRunCommand + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommandUpdate runCommand, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, runCommand, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetByVirtualMachineAsync(resourceGroupName, vmName, runCommandName, expand).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to delete the run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachine + /// + /// + /// The name of the VirtualMachineRunCommand + /// + public static void Delete(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName) + { + ((IVirtualMachineRunCommandsOperations)operations).DeleteAsync(resourceGroupName, vmName, runCommandName).GetAwaiter().GetResult(); + } - /// - /// The operation to get the run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachine - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// The expand expression to apply on the operation. - /// - /// - /// The cancellation token. - /// - public static async Task GetByVirtualMachineAsync(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetByVirtualMachineWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// The operation to delete the run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachine + /// + /// + /// The name of the VirtualMachineRunCommand + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to create or update the run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachine + /// + /// + /// The name of the VirtualMachineRunCommand + /// + public static VirtualMachineRunCommand BeginCreateOrUpdate(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommand runCommand) + { + return ((IVirtualMachineRunCommandsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand).GetAwaiter().GetResult(); + } - /// - /// The operation to create or update the run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachine - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// Parameters supplied to the Create Virtual Machine RunCommand operation. - /// - public static VirtualMachineRunCommand CreateOrUpdate(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommand runCommand) + /// + /// The operation to create or update the run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachine + /// + /// + /// The name of the VirtualMachineRunCommand + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommand runCommand, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, runCommand, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to update the run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachine + /// + /// + /// The name of the VirtualMachineRunCommand + /// + public static VirtualMachineRunCommand BeginUpdate(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommandUpdate runCommand) + { + return ((IVirtualMachineRunCommandsOperations)operations).BeginUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand).GetAwaiter().GetResult(); + } - /// - /// The operation to create or update the run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachine - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// Parameters supplied to the Create Virtual Machine RunCommand operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommand runCommand, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to update the run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachine + /// + /// + /// The name of the VirtualMachineRunCommand + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommandUpdate runCommand, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, runCommand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, runCommand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// The operation to delete the run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachine + /// + /// + /// The name of the VirtualMachineRunCommand + /// + public static void BeginDelete(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName) + { + ((IVirtualMachineRunCommandsOperations)operations).BeginDeleteAsync(resourceGroupName, vmName, runCommandName).GetAwaiter().GetResult(); + } - /// - /// The operation to update the run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachine - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// Parameters supplied to the Update Virtual Machine RunCommand operation. - /// - public static VirtualMachineRunCommand Update(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommandUpdate runCommand) - { - return operations.UpdateAsync(resourceGroupName, vmName, runCommandName, runCommand).GetAwaiter().GetResult(); - } + /// + /// The operation to delete the run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachine + /// + /// + /// The name of the VirtualMachineRunCommand + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all available run commands for a subscription in a location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualMachineRunCommandsOperations operations, string nextPageLink) + { + return ((IVirtualMachineRunCommandsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// The operation to update the run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachine - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// Parameters supplied to the Update Virtual Machine RunCommand operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommandUpdate runCommand, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all available run commands for a subscription in a location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualMachineRunCommandsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, runCommand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// The operation to get all run commands of a Virtual Machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByVirtualMachineNext(this IVirtualMachineRunCommandsOperations operations, string nextPageLink) + { + return ((IVirtualMachineRunCommandsOperations)operations).ListByVirtualMachineNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachine - /// - /// - /// The name of the VirtualMachineRunCommand - /// - public static void Delete(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName) + /// + /// The operation to get all run commands of a Virtual Machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVirtualMachineNextAsync(this IVirtualMachineRunCommandsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVirtualMachineNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, vmName, runCommandName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// The operation to delete the run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachine - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The operation to create or update the run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachine - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// Parameters supplied to the Create Virtual Machine RunCommand operation. - /// - public static VirtualMachineRunCommand BeginCreateOrUpdate(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommand runCommand) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand).GetAwaiter().GetResult(); - } - - /// - /// The operation to create or update the run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachine - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// Parameters supplied to the Create Virtual Machine RunCommand operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommand runCommand, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, runCommand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to update the run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachine - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// Parameters supplied to the Update Virtual Machine RunCommand operation. - /// - public static VirtualMachineRunCommand BeginUpdate(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommandUpdate runCommand) - { - return operations.BeginUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand).GetAwaiter().GetResult(); - } - - /// - /// The operation to update the run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachine - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// Parameters supplied to the Update Virtual Machine RunCommand operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, VirtualMachineRunCommandUpdate runCommand, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, runCommand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to delete the run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachine - /// - /// - /// The name of the VirtualMachineRunCommand - /// - public static void BeginDelete(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName) - { - operations.BeginDeleteAsync(resourceGroupName, vmName, runCommandName).GetAwaiter().GetResult(); - } - - /// - /// The operation to delete the run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachine - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualMachineRunCommandsOperations operations, string resourceGroupName, string vmName, string runCommandName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmName, runCommandName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all available run commands for a subscription in a location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualMachineRunCommandsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all available run commands for a subscription in a location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualMachineRunCommandsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to get all run commands of a Virtual Machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByVirtualMachineNext(this IVirtualMachineRunCommandsOperations operations, string nextPageLink) - { - return operations.ListByVirtualMachineNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// The operation to get all run commands of a Virtual Machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVirtualMachineNextAsync(this IVirtualMachineRunCommandsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByVirtualMachineNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetExtensionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetExtensionsOperations.cs index dfd6d0187f2d..2ae49610b9ac 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetExtensionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetExtensionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineScaleSetExtensionsOperations operations. /// - internal partial class VirtualMachineScaleSetExtensionsOperations : IServiceOperations, IVirtualMachineScaleSetExtensionsOperations + internal partial class VirtualMachineScaleSetExtensionsOperations : Microsoft.Rest.IServiceOperations, IVirtualMachineScaleSetExtensionsOperations { /// /// Initializes a new instance of the VirtualMachineScaleSetExtensionsOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualMachineScaleSetExtensionsOperations : IServiceOper /// /// Thrown when a required parameter is null /// - internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient client) + internal VirtualMachineScaleSetExtensionsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,52 +68,62 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -135,25 +133,24 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -165,55 +162,56 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -223,9 +221,10 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -236,25 +235,29 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to get the extension. /// @@ -276,13 +279,13 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -291,59 +294,71 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (vmssExtensionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmssExtensionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmssExtensionName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("vmssExtensionName", vmssExtensionName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{vmssExtensionName}", System.Uri.EscapeDataString(vmssExtensionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -357,25 +372,24 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -387,55 +401,56 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -445,9 +460,10 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -458,25 +474,29 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to create or update an extension. /// @@ -493,16 +513,16 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie /// Parameters supplied to the Create VM scale set Extension operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -521,16 +541,16 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie /// Parameters supplied to the Update VM scale set Extension operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -546,16 +566,16 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie /// The name of the VM scale set extension. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -579,13 +599,13 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -594,67 +614,78 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (extensionParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "extensionParameters"); } + if (extensionParameters != null) + { + extensionParameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (vmssExtensionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmssExtensionName"); - } - if (extensionParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "extensionParameters"); - } - if (extensionParameters != null) - { - extensionParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmssExtensionName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("vmssExtensionName", vmssExtensionName); + tracingParameters.Add("extensionParameters", extensionParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{vmssExtensionName}", System.Uri.EscapeDataString(vmssExtensionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -664,25 +695,24 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -694,61 +724,62 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(extensionParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(extensionParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(extensionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -758,9 +789,10 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -771,16 +803,16 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -789,38 +821,42 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to update an extension. /// @@ -842,13 +878,13 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -857,63 +893,74 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (extensionParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "extensionParameters"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (vmssExtensionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmssExtensionName"); - } - if (extensionParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "extensionParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmssExtensionName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("vmssExtensionName", vmssExtensionName); + tracingParameters.Add("extensionParameters", extensionParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{vmssExtensionName}", System.Uri.EscapeDataString(vmssExtensionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -923,25 +970,24 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -953,61 +999,62 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(extensionParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(extensionParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(extensionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1017,9 +1064,10 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1030,16 +1078,16 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1048,38 +1096,42 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to delete the extension. /// @@ -1098,10 +1150,10 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1110,58 +1162,69 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (vmssExtensionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmssExtensionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmssExtensionName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("vmssExtensionName", vmssExtensionName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{vmssExtensionName}", System.Uri.EscapeDataString(vmssExtensionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1171,25 +1234,24 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1201,55 +1263,56 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1259,20 +1322,25 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a list of all extensions in a VM scale set. /// @@ -1285,13 +1353,13 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1300,51 +1368,54 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1356,55 +1427,56 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1414,9 +1486,10 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1427,24 +1500,28 @@ internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetExtensionsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetExtensionsOperationsExtensions.cs index 575f4cca5e8f..8dd9437124f9 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetExtensionsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetExtensionsOperationsExtensions.cs @@ -1,445 +1,403 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualMachineScaleSetExtensionsOperations. + /// Extension methods for VirtualMachineScaleSetExtensionsOperations /// public static partial class VirtualMachineScaleSetExtensionsOperationsExtensions { - /// - /// Gets a list of all extensions in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - public static IPage List(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName) - { - return operations.ListAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all extensions in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to get the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The name of the VM scale set extension. - /// - /// - /// The expand expression to apply on the operation. - /// - public static VirtualMachineScaleSetExtension Get(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand).GetAwaiter().GetResult(); - } - - /// - /// The operation to get the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The name of the VM scale set extension. - /// - /// - /// The expand expression to apply on the operation. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to create or update an extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The name of the VM scale set extension. - /// - /// - /// Parameters supplied to the Create VM scale set Extension operation. - /// - public static VirtualMachineScaleSetExtension CreateOrUpdate(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters).GetAwaiter().GetResult(); - } - - /// - /// The operation to create or update an extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The name of the VM scale set extension. - /// - /// - /// Parameters supplied to the Create VM scale set Extension operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to update an extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The name of the VM scale set extension. - /// - /// - /// Parameters supplied to the Update VM scale set Extension operation. - /// - public static VirtualMachineScaleSetExtension Update(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters) - { - return operations.UpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters).GetAwaiter().GetResult(); - } - - /// - /// The operation to update an extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The name of the VM scale set extension. - /// - /// - /// Parameters supplied to the Update VM scale set Extension operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Gets a list of all extensions in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName) + { + return ((IVirtualMachineScaleSetExtensionsOperations)operations).ListAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The name of the VM scale set extension. - /// - public static void Delete(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName) + /// + /// Gets a list of all extensions in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to get the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The name of the VM scale set extension. + /// + /// + /// The expand expression to apply on the operation. + /// + public static VirtualMachineScaleSetExtension Get(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, string expand = default(string)) + { + return ((IVirtualMachineScaleSetExtensionsOperations)operations).GetAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The name of the VM scale set extension. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to get the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The name of the VM scale set extension. + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// The operation to create or update an extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The name of the VM scale set extension. + /// + public static VirtualMachineScaleSetExtension CreateOrUpdate(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters) + { + return ((IVirtualMachineScaleSetExtensionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters).GetAwaiter().GetResult(); + } - /// - /// The operation to create or update an extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The name of the VM scale set extension. - /// - /// - /// Parameters supplied to the Create VM scale set Extension operation. - /// - public static VirtualMachineScaleSetExtension BeginCreateOrUpdate(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters) + /// + /// The operation to create or update an extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The name of the VM scale set extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to update an extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The name of the VM scale set extension. + /// + public static VirtualMachineScaleSetExtension Update(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters) + { + return ((IVirtualMachineScaleSetExtensionsOperations)operations).UpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters).GetAwaiter().GetResult(); + } - /// - /// The operation to create or update an extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The name of the VM scale set extension. - /// - /// - /// Parameters supplied to the Create VM scale set Extension operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to update an extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The name of the VM scale set extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// The operation to delete the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The name of the VM scale set extension. + /// + public static void Delete(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName) + { + ((IVirtualMachineScaleSetExtensionsOperations)operations).DeleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).GetAwaiter().GetResult(); + } - /// - /// The operation to update an extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The name of the VM scale set extension. - /// - /// - /// Parameters supplied to the Update VM scale set Extension operation. - /// - public static VirtualMachineScaleSetExtension BeginUpdate(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters) - { - return operations.BeginUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters).GetAwaiter().GetResult(); - } - - /// - /// The operation to update an extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The name of the VM scale set extension. - /// - /// - /// Parameters supplied to the Update VM scale set Extension operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// The operation to delete the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The name of the VM scale set extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to create or update an extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The name of the VM scale set extension. + /// + public static VirtualMachineScaleSetExtension BeginCreateOrUpdate(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters) + { + return ((IVirtualMachineScaleSetExtensionsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The name of the VM scale set extension. - /// - public static void BeginDelete(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName) + /// + /// The operation to create or update an extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The name of the VM scale set extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to update an extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The name of the VM scale set extension. + /// + public static VirtualMachineScaleSetExtension BeginUpdate(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters) + { + return ((IVirtualMachineScaleSetExtensionsOperations)operations).BeginUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The name of the VM scale set extension. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to update an extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The name of the VM scale set extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// The operation to delete the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The name of the VM scale set extension. + /// + public static void BeginDelete(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName) + { + ((IVirtualMachineScaleSetExtensionsOperations)operations).BeginDeleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).GetAwaiter().GetResult(); + } - /// - /// Gets a list of all extensions in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualMachineScaleSetExtensionsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } + /// + /// The operation to delete the extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The name of the VM scale set extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string vmssExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets a list of all extensions in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualMachineScaleSetExtensionsOperations operations, string nextPageLink) + { + return ((IVirtualMachineScaleSetExtensionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets a list of all extensions in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a list of all extensions in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualMachineScaleSetExtensionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetRollingUpgradesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetRollingUpgradesOperations.cs index 58f189f68d3e..1f173c599e4f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetRollingUpgradesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetRollingUpgradesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineScaleSetRollingUpgradesOperations operations. /// - internal partial class VirtualMachineScaleSetRollingUpgradesOperations : IServiceOperations, IVirtualMachineScaleSetRollingUpgradesOperations + internal partial class VirtualMachineScaleSetRollingUpgradesOperations : Microsoft.Rest.IServiceOperations, IVirtualMachineScaleSetRollingUpgradesOperations { /// /// Initializes a new instance of the VirtualMachineScaleSetRollingUpgradesOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualMachineScaleSetRollingUpgradesOperations : IServic /// /// Thrown when a required parameter is null /// - internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient client) + internal VirtualMachineScaleSetRollingUpgradesOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -62,16 +50,16 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient /// The name of the VM scale set. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task StartExtensionUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task StartExtensionUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStartExtensionUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartExtensionUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -86,16 +74,16 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient /// The name of the VM scale set. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task StartOSUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task StartOSUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStartOSUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartOSUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -108,16 +96,16 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient /// The name of the VM scale set. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task CancelWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task CancelWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginCancelWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCancelWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -135,13 +123,13 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -150,52 +138,62 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient /// /// A response object containing the response body and response headers. /// - public async Task> GetLatestWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetLatestWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetLatest", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetLatest", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -205,25 +203,24 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -235,55 +232,56 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -293,9 +291,10 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -306,25 +305,29 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Starts a rolling upgrade to move all extensions for all virtual machine /// scale set instances to the latest available extension version. Instances @@ -342,10 +345,10 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -354,52 +357,62 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient /// /// A response object containing the response body and response headers. /// - public async Task BeginStartExtensionUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginStartExtensionUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartExtensionUpgrade", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStartExtensionUpgrade", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -409,25 +422,24 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -439,55 +451,56 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -497,20 +510,25 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Starts a rolling upgrade to move all virtual machine scale set instances to /// the latest available Platform Image OS version. Instances which are already @@ -528,10 +546,10 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -540,52 +558,62 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient /// /// A response object containing the response body and response headers. /// - public async Task BeginStartOSUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginStartOSUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartOSUpgrade", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStartOSUpgrade", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -595,25 +623,24 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -625,55 +652,56 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -683,20 +711,25 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Cancels the current virtual machine scale set rolling upgrade. /// @@ -712,10 +745,10 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -724,52 +757,62 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient /// /// A response object containing the response body and response headers. /// - public async Task BeginCancelWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginCancelWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCancel", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCancel", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -779,25 +822,24 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -809,55 +851,56 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -867,19 +910,24 @@ internal VirtualMachineScaleSetRollingUpgradesOperations(ComputeManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetRollingUpgradesOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetRollingUpgradesOperationsExtensions.cs index a45aac404895..11d6bba20369 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetRollingUpgradesOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetRollingUpgradesOperationsExtensions.cs @@ -1,303 +1,287 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualMachineScaleSetRollingUpgradesOperations. + /// Extension methods for VirtualMachineScaleSetRollingUpgradesOperations /// public static partial class VirtualMachineScaleSetRollingUpgradesOperationsExtensions { - /// - /// Starts a rolling upgrade to move all extensions for all virtual machine - /// scale set instances to the latest available extension version. Instances - /// which are already running the latest extension versions are not affected. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - public static void StartExtensionUpgrade(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName) - { - operations.StartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); - } - - /// - /// Starts a rolling upgrade to move all extensions for all virtual machine - /// scale set instances to the latest available extension version. Instances - /// which are already running the latest extension versions are not affected. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The cancellation token. - /// - public static async Task StartExtensionUpgradeAsync(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.StartExtensionUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Starts a rolling upgrade to move all virtual machine scale set instances to - /// the latest available Platform Image OS version. Instances which are already - /// running the latest available OS version are not affected. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - public static void StartOSUpgrade(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName) - { - operations.StartOSUpgradeAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); - } - - /// - /// Starts a rolling upgrade to move all virtual machine scale set instances to - /// the latest available Platform Image OS version. Instances which are already - /// running the latest available OS version are not affected. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The cancellation token. - /// - public static async Task StartOSUpgradeAsync(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.StartOSUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Cancels the current virtual machine scale set rolling upgrade. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - public static void Cancel(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName) - { - operations.CancelAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); - } - - /// - /// Cancels the current virtual machine scale set rolling upgrade. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The cancellation token. - /// - public static async Task CancelAsync(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CancelWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Starts a rolling upgrade to move all extensions for all virtual machine + /// scale set instances to the latest available extension version. Instances + /// which are already running the latest extension versions are not affected. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void StartExtensionUpgrade(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName) + { + ((IVirtualMachineScaleSetRollingUpgradesOperations)operations).StartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); + } - /// - /// Gets the status of the latest virtual machine scale set rolling upgrade. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - public static RollingUpgradeStatusInfo GetLatest(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName) - { - return operations.GetLatestAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); - } + /// + /// Starts a rolling upgrade to move all extensions for all virtual machine + /// scale set instances to the latest available extension version. Instances + /// which are already running the latest extension versions are not affected. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StartExtensionUpgradeAsync(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.StartExtensionUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Starts a rolling upgrade to move all virtual machine scale set instances to + /// the latest available Platform Image OS version. Instances which are already + /// running the latest available OS version are not affected. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void StartOSUpgrade(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName) + { + ((IVirtualMachineScaleSetRollingUpgradesOperations)operations).StartOSUpgradeAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); + } - /// - /// Gets the status of the latest virtual machine scale set rolling upgrade. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The cancellation token. - /// - public static async Task GetLatestAsync(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetLatestWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Starts a rolling upgrade to move all virtual machine scale set instances to + /// the latest available Platform Image OS version. Instances which are already + /// running the latest available OS version are not affected. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StartOSUpgradeAsync(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.StartOSUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Cancels the current virtual machine scale set rolling upgrade. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void Cancel(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName) + { + ((IVirtualMachineScaleSetRollingUpgradesOperations)operations).CancelAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); + } - /// - /// Starts a rolling upgrade to move all extensions for all virtual machine - /// scale set instances to the latest available extension version. Instances - /// which are already running the latest extension versions are not affected. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - public static void BeginStartExtensionUpgrade(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName) - { - operations.BeginStartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); - } + /// + /// Cancels the current virtual machine scale set rolling upgrade. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CancelAsync(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.CancelWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the status of the latest virtual machine scale set rolling upgrade. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static RollingUpgradeStatusInfo GetLatest(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName) + { + return ((IVirtualMachineScaleSetRollingUpgradesOperations)operations).GetLatestAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); + } - /// - /// Starts a rolling upgrade to move all extensions for all virtual machine - /// scale set instances to the latest available extension version. Instances - /// which are already running the latest extension versions are not affected. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStartExtensionUpgradeAsync(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the status of the latest virtual machine scale set rolling upgrade. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetLatestAsync(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetLatestWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginStartExtensionUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Starts a rolling upgrade to move all extensions for all virtual machine + /// scale set instances to the latest available extension version. Instances + /// which are already running the latest extension versions are not affected. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void BeginStartExtensionUpgrade(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName) + { + ((IVirtualMachineScaleSetRollingUpgradesOperations)operations).BeginStartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); + } - /// - /// Starts a rolling upgrade to move all virtual machine scale set instances to - /// the latest available Platform Image OS version. Instances which are already - /// running the latest available OS version are not affected. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - public static void BeginStartOSUpgrade(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName) - { - operations.BeginStartOSUpgradeAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); - } + /// + /// Starts a rolling upgrade to move all extensions for all virtual machine + /// scale set instances to the latest available extension version. Instances + /// which are already running the latest extension versions are not affected. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStartExtensionUpgradeAsync(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginStartExtensionUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Starts a rolling upgrade to move all virtual machine scale set instances to + /// the latest available Platform Image OS version. Instances which are already + /// running the latest available OS version are not affected. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void BeginStartOSUpgrade(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName) + { + ((IVirtualMachineScaleSetRollingUpgradesOperations)operations).BeginStartOSUpgradeAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); + } - /// - /// Starts a rolling upgrade to move all virtual machine scale set instances to - /// the latest available Platform Image OS version. Instances which are already - /// running the latest available OS version are not affected. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStartOSUpgradeAsync(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginStartOSUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Cancels the current virtual machine scale set rolling upgrade. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - public static void BeginCancel(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName) - { - operations.BeginCancelAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); - } - - /// - /// Cancels the current virtual machine scale set rolling upgrade. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCancelAsync(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginCancelWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Starts a rolling upgrade to move all virtual machine scale set instances to + /// the latest available Platform Image OS version. Instances which are already + /// running the latest available OS version are not affected. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStartOSUpgradeAsync(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginStartOSUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Cancels the current virtual machine scale set rolling upgrade. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void BeginCancel(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName) + { + ((IVirtualMachineScaleSetRollingUpgradesOperations)operations).BeginCancelAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); + } + /// + /// Cancels the current virtual machine scale set rolling upgrade. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCancelAsync(this IVirtualMachineScaleSetRollingUpgradesOperations operations, string resourceGroupName, string vmScaleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginCancelWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMExtensionsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMExtensionsOperations.cs index a4c5364b47c1..1c264b645a68 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMExtensionsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMExtensionsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineScaleSetVMExtensionsOperations operations. /// - internal partial class VirtualMachineScaleSetVMExtensionsOperations : IServiceOperations, IVirtualMachineScaleSetVMExtensionsOperations + internal partial class VirtualMachineScaleSetVMExtensionsOperations : Microsoft.Rest.IServiceOperations, IVirtualMachineScaleSetVMExtensionsOperations { /// /// Initializes a new instance of the VirtualMachineScaleSetVMExtensionsOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualMachineScaleSetVMExtensionsOperations : IServiceOp /// /// Thrown when a required parameter is null /// - internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient client) + internal VirtualMachineScaleSetVMExtensionsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -72,13 +60,13 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -87,59 +75,71 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -153,25 +153,24 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -183,55 +182,56 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -241,9 +241,10 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -254,25 +255,29 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to get the VMSS VM extension. /// @@ -297,13 +302,13 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -312,65 +317,78 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + if (vmExtensionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmExtensionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmExtensionName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("vmExtensionName", vmExtensionName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{vmExtensionName}", System.Uri.EscapeDataString(vmExtensionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -384,25 +402,24 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -414,55 +431,56 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -472,9 +490,10 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -485,25 +504,29 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to create or update the VMSS VM extension. /// @@ -523,16 +546,16 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// Parameters supplied to the Create Virtual Machine Extension operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -554,16 +577,16 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// Parameters supplied to the Update Virtual Machine Extension operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -582,16 +605,16 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// The name of the virtual machine extension. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -618,13 +641,13 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -633,73 +656,85 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (extensionParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "extensionParameters"); + } + if (extensionParameters != null) + { + extensionParameters.Validate(); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + if (vmExtensionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmExtensionName"); - } - if (extensionParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "extensionParameters"); - } - if (extensionParameters != null) - { - extensionParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmExtensionName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("vmExtensionName", vmExtensionName); + tracingParameters.Add("extensionParameters", extensionParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{vmExtensionName}", System.Uri.EscapeDataString(vmExtensionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -709,25 +744,24 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -739,61 +773,62 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(extensionParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(extensionParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(extensionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -803,9 +838,10 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -816,16 +852,16 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -834,38 +870,42 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to update the VMSS VM extension. /// @@ -890,13 +930,13 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -905,69 +945,81 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (extensionParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "extensionParameters"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + if (vmExtensionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmExtensionName"); - } - if (extensionParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "extensionParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmExtensionName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("vmExtensionName", vmExtensionName); + tracingParameters.Add("extensionParameters", extensionParameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{vmExtensionName}", System.Uri.EscapeDataString(vmExtensionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -977,25 +1029,24 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1007,61 +1058,62 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(extensionParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(extensionParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(extensionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1071,9 +1123,10 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1084,38 +1137,42 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to delete the VMSS VM extension. /// @@ -1137,10 +1194,10 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1149,64 +1206,76 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + if (vmExtensionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmExtensionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmExtensionName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("vmExtensionName", vmExtensionName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{vmExtensionName}", System.Uri.EscapeDataString(vmExtensionName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1216,25 +1285,24 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1246,55 +1314,56 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1304,19 +1373,24 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMExtensionsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMExtensionsOperationsExtensions.cs index 8720f2184111..4ca92cca8a95 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMExtensionsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMExtensionsOperationsExtensions.cs @@ -1,467 +1,426 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualMachineScaleSetVMExtensionsOperations. + /// Extension methods for VirtualMachineScaleSetVMExtensionsOperations /// public static partial class VirtualMachineScaleSetVMExtensionsOperationsExtensions { - /// - /// The operation to get all extensions of an instance in Virtual Machine - /// Scaleset. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The expand expression to apply on the operation. - /// - public static VirtualMachineScaleSetVMExtensionsListResult List(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string)) - { - return operations.ListAsync(resourceGroupName, vmScaleSetName, instanceId, expand).GetAwaiter().GetResult(); - } - - /// - /// The operation to get all extensions of an instance in Virtual Machine - /// Scaleset. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The expand expression to apply on the operation. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to get the VMSS VM extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// The expand expression to apply on the operation. - /// - public static VirtualMachineScaleSetVMExtension Get(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand).GetAwaiter().GetResult(); - } - - /// - /// The operation to get the VMSS VM extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// The expand expression to apply on the operation. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to create or update the VMSS VM extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// Parameters supplied to the Create Virtual Machine Extension operation. - /// - public static VirtualMachineScaleSetVMExtension CreateOrUpdate(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); - } + /// + /// The operation to get all extensions of an instance in Virtual Machine + /// Scaleset. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The expand expression to apply on the operation. + /// + public static VirtualMachineScaleSetVMExtensionsListResult List(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string)) + { + return ((IVirtualMachineScaleSetVMExtensionsOperations)operations).ListAsync(resourceGroupName, vmScaleSetName, instanceId, expand).GetAwaiter().GetResult(); + } - /// - /// The operation to create or update the VMSS VM extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// Parameters supplied to the Create Virtual Machine Extension operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to get all extensions of an instance in Virtual Machine + /// Scaleset. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, expand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// The operation to get the VMSS VM extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + /// + /// The expand expression to apply on the operation. + /// + public static VirtualMachineScaleSetVMExtension Get(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, string expand = default(string)) + { + return ((IVirtualMachineScaleSetVMExtensionsOperations)operations).GetAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand).GetAwaiter().GetResult(); + } - /// - /// The operation to update the VMSS VM extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// Parameters supplied to the Update Virtual Machine Extension operation. - /// - public static VirtualMachineScaleSetVMExtension Update(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters) + /// + /// The operation to get the VMSS VM extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to create or update the VMSS VM extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + public static VirtualMachineScaleSetVMExtension CreateOrUpdate(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters) + { + return ((IVirtualMachineScaleSetVMExtensionsOperations)operations).CreateOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); + } - /// - /// The operation to update the VMSS VM extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// Parameters supplied to the Update Virtual Machine Extension operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to create or update the VMSS VM extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// The operation to update the VMSS VM extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + public static VirtualMachineScaleSetVMExtension Update(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters) + { + return ((IVirtualMachineScaleSetVMExtensionsOperations)operations).UpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the VMSS VM extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - public static void Delete(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName) + /// + /// The operation to update the VMSS VM extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to delete the VMSS VM extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + public static void Delete(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName) + { + ((IVirtualMachineScaleSetVMExtensionsOperations)operations).DeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the VMSS VM extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The operation to create or update the VMSS VM extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// Parameters supplied to the Create Virtual Machine Extension operation. - /// - public static VirtualMachineScaleSetVMExtension BeginCreateOrUpdate(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); - } - - /// - /// The operation to create or update the VMSS VM extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// Parameters supplied to the Create Virtual Machine Extension operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to update the VMSS VM extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// Parameters supplied to the Update Virtual Machine Extension operation. - /// - public static VirtualMachineScaleSetVMExtension BeginUpdate(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters) - { - return operations.BeginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); - } - - /// - /// The operation to update the VMSS VM extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// Parameters supplied to the Update Virtual Machine Extension operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// The operation to delete the VMSS VM extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to create or update the VMSS VM extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + public static VirtualMachineScaleSetVMExtension BeginCreateOrUpdate(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters) + { + return ((IVirtualMachineScaleSetVMExtensionsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the VMSS VM extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - public static void BeginDelete(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName) + /// + /// The operation to create or update the VMSS VM extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to update the VMSS VM extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + public static VirtualMachineScaleSetVMExtension BeginUpdate(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters) + { + return ((IVirtualMachineScaleSetVMExtensionsOperations)operations).BeginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the VMSS VM extension. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The name of the virtual machine extension. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to update the VMSS VM extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// The operation to delete the VMSS VM extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + public static void BeginDelete(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName) + { + ((IVirtualMachineScaleSetVMExtensionsOperations)operations).BeginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName).GetAwaiter().GetResult(); + } + /// + /// The operation to delete the VMSS VM extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The name of the virtual machine extension. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMRunCommandsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMRunCommandsOperations.cs index 3d69de2a9fe0..216c6ca4845f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMRunCommandsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMRunCommandsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineScaleSetVMRunCommandsOperations operations. /// - internal partial class VirtualMachineScaleSetVMRunCommandsOperations : IServiceOperations, IVirtualMachineScaleSetVMRunCommandsOperations + internal partial class VirtualMachineScaleSetVMRunCommandsOperations : Microsoft.Rest.IServiceOperations, IVirtualMachineScaleSetVMRunCommandsOperations { /// /// Initializes a new instance of the VirtualMachineScaleSetVMRunCommandsOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualMachineScaleSetVMRunCommandsOperations : IServiceO /// /// Thrown when a required parameter is null /// - internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient client) + internal VirtualMachineScaleSetVMRunCommandsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -72,13 +60,13 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -87,59 +75,71 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -153,25 +153,24 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -183,55 +182,56 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -241,9 +241,10 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -254,25 +255,29 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to get the VMSS VM run command. /// @@ -297,13 +302,13 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -312,65 +317,78 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + if (runCommandName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "runCommandName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "runCommandName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("runCommandName", runCommandName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{runCommandName}", System.Uri.EscapeDataString(runCommandName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -384,25 +402,24 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -414,55 +431,56 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -472,9 +490,10 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -485,25 +504,29 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to create or update the VMSS VM run command. /// @@ -523,16 +546,16 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c /// Parameters supplied to the Create Virtual Machine RunCommand operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommand runCommand, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommand runCommand, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -554,16 +577,16 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c /// Resource create parameters. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommandUpdate runCommand, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommandUpdate runCommand, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -582,16 +605,16 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c /// The name of the VirtualMachineRunCommand /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -618,13 +641,13 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -633,73 +656,85 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommand runCommand, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommand runCommand, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (runCommand == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "runCommand"); + } + if (runCommand != null) + { + runCommand.Validate(); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + if (runCommandName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "runCommandName"); - } - if (runCommand == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "runCommand"); - } - if (runCommand != null) - { - runCommand.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "runCommandName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("runCommandName", runCommandName); + tracingParameters.Add("runCommand", runCommand); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{runCommandName}", System.Uri.EscapeDataString(runCommandName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -709,25 +744,24 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -739,61 +773,62 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(runCommand != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(runCommand, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(runCommand, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -803,9 +838,10 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -816,16 +852,16 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -834,38 +870,42 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to update the VMSS VM run command. /// @@ -890,13 +930,13 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -905,69 +945,81 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommandUpdate runCommand, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommandUpdate runCommand, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (runCommand == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "runCommand"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + if (runCommandName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "runCommandName"); - } - if (runCommand == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "runCommand"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "runCommandName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("runCommandName", runCommandName); + tracingParameters.Add("runCommand", runCommand); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{runCommandName}", System.Uri.EscapeDataString(runCommandName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -977,25 +1029,24 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1007,61 +1058,62 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(runCommand != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(runCommand, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(runCommand, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1071,9 +1123,10 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1084,38 +1137,42 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to delete the VMSS VM run command. /// @@ -1137,10 +1194,10 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1149,64 +1206,76 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + if (runCommandName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "runCommandName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "runCommandName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("runCommandName", runCommandName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{runCommandName}", System.Uri.EscapeDataString(runCommandName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1216,25 +1285,24 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1246,55 +1314,56 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1304,20 +1373,25 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to get all run commands of an instance in Virtual Machine /// Scaleset. @@ -1331,13 +1405,13 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1346,51 +1420,54 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1402,55 +1479,56 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1460,9 +1538,10 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1473,24 +1552,28 @@ internal VirtualMachineScaleSetVMRunCommandsOperations(ComputeManagementClient c _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMRunCommandsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMRunCommandsOperationsExtensions.cs index d00b2612f6f6..4c3682688c6d 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMRunCommandsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMRunCommandsOperationsExtensions.cs @@ -1,503 +1,461 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualMachineScaleSetVMRunCommandsOperations. + /// Extension methods for VirtualMachineScaleSetVMRunCommandsOperations /// public static partial class VirtualMachineScaleSetVMRunCommandsOperationsExtensions { - /// - /// The operation to get all run commands of an instance in Virtual Machine - /// Scaleset. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The name of the VirtualMachineScaleSetVM - /// - /// - /// The expand expression to apply on the operation. - /// - public static IPage List(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string)) - { - return operations.ListAsync(resourceGroupName, vmScaleSetName, instanceId, expand).GetAwaiter().GetResult(); - } - - /// - /// The operation to get all run commands of an instance in Virtual Machine - /// Scaleset. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The name of the VirtualMachineScaleSetVM - /// - /// - /// The expand expression to apply on the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to get the VMSS VM run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The name of the VirtualMachineScaleSetVM - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// The expand expression to apply on the operation. - /// - public static VirtualMachineRunCommand Get(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, expand).GetAwaiter().GetResult(); - } - - /// - /// The operation to get the VMSS VM run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The name of the VirtualMachineScaleSetVM - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// The expand expression to apply on the operation. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to create or update the VMSS VM run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The name of the VirtualMachineScaleSetVM - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// Parameters supplied to the Create Virtual Machine RunCommand operation. - /// - public static VirtualMachineRunCommand CreateOrUpdate(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommand runCommand) - { - return operations.CreateOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).GetAwaiter().GetResult(); - } - - /// - /// The operation to create or update the VMSS VM run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The name of the VirtualMachineScaleSetVM - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// Parameters supplied to the Create Virtual Machine RunCommand operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommand runCommand, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to update the VMSS VM run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The name of the VirtualMachineScaleSetVM - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// Resource create parameters. - /// - public static VirtualMachineRunCommand Update(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommandUpdate runCommand) - { - return operations.UpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).GetAwaiter().GetResult(); - } - - /// - /// The operation to update the VMSS VM run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The name of the VirtualMachineScaleSetVM - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// Resource create parameters. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommandUpdate runCommand, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// The operation to get all run commands of an instance in Virtual Machine + /// Scaleset. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The name of the VirtualMachineScaleSetVM + /// + /// + /// The expand expression to apply on the operation. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string)) + { + return ((IVirtualMachineScaleSetVMRunCommandsOperations)operations).ListAsync(resourceGroupName, vmScaleSetName, instanceId, expand).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the VMSS VM run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The name of the VirtualMachineScaleSetVM - /// - /// - /// The name of the VirtualMachineRunCommand - /// - public static void Delete(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName) + /// + /// The operation to get all run commands of an instance in Virtual Machine + /// Scaleset. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The name of the VirtualMachineScaleSetVM + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, expand, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to get the VMSS VM run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The name of the VirtualMachineScaleSetVM + /// + /// + /// The name of the VirtualMachineRunCommand + /// + /// + /// The expand expression to apply on the operation. + /// + public static VirtualMachineRunCommand Get(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, string expand = default(string)) + { + return ((IVirtualMachineScaleSetVMRunCommandsOperations)operations).GetAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, expand).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the VMSS VM run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The name of the VirtualMachineScaleSetVM - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to get the VMSS VM run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The name of the VirtualMachineScaleSetVM + /// + /// + /// The name of the VirtualMachineRunCommand + /// + /// + /// The expand expression to apply on the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, expand, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// The operation to create or update the VMSS VM run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The name of the VirtualMachineScaleSetVM + /// + /// + /// The name of the VirtualMachineRunCommand + /// + public static VirtualMachineRunCommand CreateOrUpdate(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommand runCommand) + { + return ((IVirtualMachineScaleSetVMRunCommandsOperations)operations).CreateOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).GetAwaiter().GetResult(); + } - /// - /// The operation to create or update the VMSS VM run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The name of the VirtualMachineScaleSetVM - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// Parameters supplied to the Create Virtual Machine RunCommand operation. - /// - public static VirtualMachineRunCommand BeginCreateOrUpdate(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommand runCommand) + /// + /// The operation to create or update the VMSS VM run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The name of the VirtualMachineScaleSetVM + /// + /// + /// The name of the VirtualMachineRunCommand + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommand runCommand, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to update the VMSS VM run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The name of the VirtualMachineScaleSetVM + /// + /// + /// The name of the VirtualMachineRunCommand + /// + public static VirtualMachineRunCommand Update(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommandUpdate runCommand) + { + return ((IVirtualMachineScaleSetVMRunCommandsOperations)operations).UpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).GetAwaiter().GetResult(); + } - /// - /// The operation to create or update the VMSS VM run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The name of the VirtualMachineScaleSetVM - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// Parameters supplied to the Create Virtual Machine RunCommand operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommand runCommand, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to update the VMSS VM run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The name of the VirtualMachineScaleSetVM + /// + /// + /// The name of the VirtualMachineRunCommand + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommandUpdate runCommand, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// The operation to delete the VMSS VM run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The name of the VirtualMachineScaleSetVM + /// + /// + /// The name of the VirtualMachineRunCommand + /// + public static void Delete(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName) + { + ((IVirtualMachineScaleSetVMRunCommandsOperations)operations).DeleteAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName).GetAwaiter().GetResult(); + } - /// - /// The operation to update the VMSS VM run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The name of the VirtualMachineScaleSetVM - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// Resource create parameters. - /// - public static VirtualMachineRunCommand BeginUpdate(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommandUpdate runCommand) - { - return operations.BeginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).GetAwaiter().GetResult(); - } - - /// - /// The operation to update the VMSS VM run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The name of the VirtualMachineScaleSetVM - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// Resource create parameters. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommandUpdate runCommand, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// The operation to delete the VMSS VM run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The name of the VirtualMachineScaleSetVM + /// + /// + /// The name of the VirtualMachineRunCommand + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to create or update the VMSS VM run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The name of the VirtualMachineScaleSetVM + /// + /// + /// The name of the VirtualMachineRunCommand + /// + public static VirtualMachineRunCommand BeginCreateOrUpdate(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommand runCommand) + { + return ((IVirtualMachineScaleSetVMRunCommandsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the VMSS VM run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The name of the VirtualMachineScaleSetVM - /// - /// - /// The name of the VirtualMachineRunCommand - /// - public static void BeginDelete(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName) + /// + /// The operation to create or update the VMSS VM run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The name of the VirtualMachineScaleSetVM + /// + /// + /// The name of the VirtualMachineRunCommand + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommand runCommand, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// The operation to update the VMSS VM run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The name of the VirtualMachineScaleSetVM + /// + /// + /// The name of the VirtualMachineRunCommand + /// + public static VirtualMachineRunCommand BeginUpdate(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommandUpdate runCommand) + { + return ((IVirtualMachineScaleSetVMRunCommandsOperations)operations).BeginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).GetAwaiter().GetResult(); + } - /// - /// The operation to delete the VMSS VM run command. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The name of the VirtualMachineScaleSetVM - /// - /// - /// The name of the VirtualMachineRunCommand - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to update the VMSS VM run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The name of the VirtualMachineScaleSetVM + /// + /// + /// The name of the VirtualMachineRunCommand + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, VirtualMachineRunCommandUpdate runCommand, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// The operation to delete the VMSS VM run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The name of the VirtualMachineScaleSetVM + /// + /// + /// The name of the VirtualMachineRunCommand + /// + public static void BeginDelete(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName) + { + ((IVirtualMachineScaleSetVMRunCommandsOperations)operations).BeginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName).GetAwaiter().GetResult(); + } - /// - /// The operation to get all run commands of an instance in Virtual Machine - /// Scaleset. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } + /// + /// The operation to delete the VMSS VM run command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The name of the VirtualMachineScaleSetVM + /// + /// + /// The name of the VirtualMachineRunCommand + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to get all run commands of an instance in Virtual Machine + /// Scaleset. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string nextPageLink) + { + return ((IVirtualMachineScaleSetVMRunCommandsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// The operation to get all run commands of an instance in Virtual Machine - /// Scaleset. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// The operation to get all run commands of an instance in Virtual Machine + /// Scaleset. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualMachineScaleSetVMRunCommandsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMsOperations.cs index feb55530cc06..3af45948951f 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMsOperations.cs @@ -1,34 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// - /// VirtualMachineScaleSetVMsOperations operations. + /// VirtualMachineScaleSetVMSOperations operations. /// - internal partial class VirtualMachineScaleSetVMsOperations : IServiceOperations, IVirtualMachineScaleSetVMsOperations + internal partial class VirtualMachineScaleSetVMSOperations : Microsoft.Rest.IServiceOperations, IVirtualMachineScaleSetVMSOperations { /// - /// Initializes a new instance of the VirtualMachineScaleSetVMsOperations class. + /// Initializes a new instance of the VirtualMachineScaleSetVMSOperations class. /// /// /// Reference to the service client. @@ -36,13 +24,13 @@ internal partial class VirtualMachineScaleSetVMsOperations : IServiceOperations< /// /// Thrown when a required parameter is null /// - internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) + internal VirtualMachineScaleSetVMSOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -61,17 +49,17 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// /// The filter to apply to the operation. Allowed values are - /// 'startswith(instanceView/statuses/code, 'PowerState') eq true', - /// 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq - /// false'. + /// 'startswith(instanceView/statuses/code, 'PowerState') eq true', + /// 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq + /// false'. /// /// - /// The list parameters. Allowed values are 'instanceView', - /// 'instanceView/statuses'. + /// The list parameters. Allowed values are 'instanceView', + /// 'instanceView/statuses'. /// /// /// The expand expression to apply to the operation. Allowed values are - /// 'instanceView'. + /// 'instanceView'. /// /// /// Headers that will be added to request. @@ -79,13 +67,13 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -94,55 +82,68 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string filter = default(string), string select = default(string), string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string filter = default(string), string select = default(string), string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (virtualMachineScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); } + + + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("filter", filter); tracingParameters.Add("select", select); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -164,25 +165,24 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -194,55 +194,56 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -252,9 +253,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -265,25 +267,29 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a virtual machine from a VM scale set. /// @@ -297,10 +303,9 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// The instance ID of the virtual machine. /// /// - /// The expand expression to apply on the operation. 'InstanceView' will - /// retrieve the instance view of the virtual machine. 'UserData' will retrieve - /// the UserData of the virtual machine. Possible values include: - /// 'instanceView', 'userData', 'resiliencyView' + /// The expand expression to apply on the operation. 'InstanceView' will + /// retrieve the instance view of the virtual machine. 'UserData' will retrieve + /// the UserData of the virtual machine. /// /// /// Headers that will be added to request. @@ -308,13 +313,13 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -323,91 +328,102 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VmssVMInstanceViewTypes? expand = default(VmssVMInstanceViewTypes?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VmssVMInstanceViewTypes? expand = default(VmssVMInstanceViewTypes?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (expand != null) { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(expand, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expand, this.Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -419,55 +435,56 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -477,9 +494,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -490,25 +508,29 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates a virtual machine of a VM scale set. /// @@ -521,30 +543,30 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The instance ID of the virtual machine. /// - /// - /// Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - /// /// /// The ETag of the transformation. Omit this value to always overwrite the /// current resource. Specify the last-seen ETag value to prevent accidentally /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent updating + /// Set to '*' to allow a new record set to be created, but to prevent updating /// an existing record set. Other values will result in error from server as /// they are not supported. /// + /// + /// Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, ifMatch, ifNoneMatch, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, ifMatch, ifNoneMatch, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -564,16 +586,16 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// (Feature in Preview) /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -590,16 +612,16 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// The instance ID of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ApproveRollingUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ApproveRollingUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginApproveRollingUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginApproveRollingUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -619,16 +641,16 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// Virtual Machine Scale Sets VM. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> AttachDetachDataDisksWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, AttachDetachDataDisksRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> AttachDetachDataDisksWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, AttachDetachDataDisksRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginAttachDetachDataDisksWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginAttachDetachDataDisksWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -647,16 +669,16 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// The instance ID of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeallocateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeallocateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeallocateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeallocateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -677,13 +699,13 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -692,58 +714,69 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceViewWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetInstanceViewWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceView", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetInstanceView", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/instanceView").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -753,25 +786,24 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -783,55 +815,56 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -841,9 +874,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -854,25 +888,29 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Performs maintenance on a virtual machine in a VM scale set. /// @@ -886,16 +924,16 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// The instance ID of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task PerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task PerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginPerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginPerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -918,16 +956,16 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// value for this flag is false if not specified /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -944,16 +982,16 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// The instance ID of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task RedeployWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task RedeployWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRedeployWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRedeployWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -973,16 +1011,16 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// Parameters for the Reimaging Virtual machine in ScaleSet. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ReimageWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ReimageWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginReimageWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginReimageWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -999,16 +1037,16 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// The instance ID of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ReimageAllWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ReimageAllWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginReimageAllWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginReimageAllWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1024,16 +1062,16 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// The instance ID of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task RestartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task RestartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRestartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRestartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1060,13 +1098,13 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1075,91 +1113,102 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> RetrieveBootDiagnosticsDataWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, int? sasUriExpirationTimeInMinutes = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> RetrieveBootDiagnosticsDataWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, int? sasUriExpirationTimeInMinutes = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("sasUriExpirationTimeInMinutes", sasUriExpirationTimeInMinutes); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RetrieveBootDiagnosticsData", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "RetrieveBootDiagnosticsData", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/retrieveBootDiagnosticsData").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (sasUriExpirationTimeInMinutes != null) { - _queryParameters.Add(string.Format("sasUriExpirationTimeInMinutes={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(sasUriExpirationTimeInMinutes, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("sasUriExpirationTimeInMinutes={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(sasUriExpirationTimeInMinutes, this.Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1171,55 +1220,56 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1229,9 +1279,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1242,25 +1293,29 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Run command on a virtual machine in a VM scale set. /// @@ -1277,16 +1332,16 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// Parameters supplied to the Run command operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> RunCommandWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, RunCommandInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> RunCommandWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, RunCommandInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRunCommandWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRunCommandWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1308,10 +1363,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1320,58 +1375,69 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SimulateEvictionWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task SimulateEvictionWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SimulateEviction", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "SimulateEviction", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1381,25 +1447,24 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1411,55 +1476,56 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1469,20 +1535,25 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Starts a virtual machine in a VM scale set. /// @@ -1496,16 +1567,16 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// The instance ID of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task StartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1520,32 +1591,32 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The instance ID of the virtual machine. /// - /// - /// Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - /// /// /// The ETag of the transformation. Omit this value to always overwrite the /// current resource. Specify the last-seen ETag value to prevent accidentally /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent updating + /// Set to '*' to allow a new record set to be created, but to prevent updating /// an existing record set. Other values will result in error from server as /// they are not supported. /// + /// + /// Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1554,69 +1625,82 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("ifNoneMatch", ifNoneMatch); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1626,15 +1710,23 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + } if (ifMatch != null) { if (_httpRequest.Headers.Contains("If-Match")) @@ -1651,15 +1743,6 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) } _httpRequest.Headers.TryAddWithoutValidation("If-None-Match", ifNoneMatch); } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - if (customHeaders != null) { @@ -1672,61 +1755,62 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1736,9 +1820,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1749,25 +1834,29 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a virtual machine from a VM scale set. /// @@ -1790,10 +1879,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1802,91 +1891,102 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("forceDeletion", forceDeletion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (forceDeletion != null) { - _queryParameters.Add(string.Format("forceDeletion={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(forceDeletion, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("forceDeletion={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(forceDeletion, this.Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1898,55 +1998,56 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1956,20 +2057,25 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set /// instance. @@ -1989,10 +2095,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2001,58 +2107,69 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginApproveRollingUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginApproveRollingUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginApproveRollingUpgrade", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginApproveRollingUpgrade", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/approveRollingUpgrade").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2062,25 +2179,24 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2092,55 +2208,56 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2150,33 +2267,38 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Attach and detach data disks to/from a virtual machine in a VM scale set. /// @@ -2199,13 +2321,13 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2214,67 +2336,78 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginAttachDetachDataDisksWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, AttachDetachDataDisksRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginAttachDetachDataDisksWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, AttachDetachDataDisksRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginAttachDetachDataDisks", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginAttachDetachDataDisks", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/attachDetachDataDisks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2284,25 +2417,24 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2314,61 +2446,62 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2378,9 +2511,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2391,38 +2525,42 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deallocates a specific virtual machine in a VM scale set. Shuts down the /// virtual machine and releases the compute resources it uses. You are not @@ -2444,10 +2582,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2456,58 +2594,69 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeallocateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeallocateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeallocate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeallocate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/deallocate").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2517,25 +2666,24 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2547,55 +2695,56 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2605,20 +2754,25 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Performs maintenance on a virtual machine in a VM scale set. /// @@ -2637,10 +2791,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2649,58 +2803,69 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginPerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginPerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginPerformMaintenance", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginPerformMaintenance", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/performMaintenance").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2710,25 +2875,24 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2740,55 +2904,56 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2798,20 +2963,25 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Power off (stop) a virtual machine in a VM scale set. Note that resources /// are still attached and you are getting charged for the resources. Instead, @@ -2837,10 +3007,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2849,91 +3019,102 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("skipShutdown", skipShutdown); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginPowerOff", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginPowerOff", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/powerOff").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (skipShutdown != null) { - _queryParameters.Add(string.Format("skipShutdown={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skipShutdown, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("skipShutdown={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(skipShutdown, this.Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2945,55 +3126,56 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3003,20 +3185,25 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Shuts down the virtual machine in the virtual machine scale set, moves it /// to a new node, and powers it back on. @@ -3036,10 +3223,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3048,58 +3235,69 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRedeployWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginRedeployWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRedeploy", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRedeploy", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/redeploy").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3109,25 +3307,24 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3139,55 +3336,56 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3197,20 +3395,25 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Reimages (upgrade the operating system) a specific virtual machine in a VM /// scale set. @@ -3233,10 +3436,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3245,59 +3448,71 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginReimageWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginReimageWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("vmScaleSetVMReimageInput", vmScaleSetVMReimageInput); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginReimage", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginReimage", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimage").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3307,25 +3522,24 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3337,61 +3551,62 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vmScaleSetVMReimageInput != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vmScaleSetVMReimageInput, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vmScaleSetVMReimageInput, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3401,20 +3616,25 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Allows you to re-image all the disks ( including data disks ) in the a VM /// scale set instance. This operation is only supported for managed disks. @@ -3434,10 +3654,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3446,58 +3666,69 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginReimageAllWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginReimageAllWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginReimageAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginReimageAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimageall").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3507,25 +3738,24 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3537,55 +3767,56 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3595,20 +3826,25 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Restarts a virtual machine in a VM scale set. /// @@ -3627,10 +3863,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3639,58 +3875,69 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestart", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRestart", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/restart").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3700,25 +3947,24 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3730,55 +3976,56 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3788,20 +4035,25 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Run command on a virtual machine in a VM scale set. /// @@ -3823,13 +4075,13 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3838,67 +4090,78 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginRunCommandWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, RunCommandInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginRunCommandWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, RunCommandInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRunCommand", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRunCommand", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommand").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3908,25 +4171,24 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3938,61 +4200,62 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4002,9 +4265,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -4015,25 +4279,29 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Starts a virtual machine in a VM scale set. /// @@ -4052,10 +4320,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4064,58 +4332,69 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("instanceId", instanceId); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/start").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -4125,25 +4404,24 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4155,55 +4433,56 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4213,20 +4492,25 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a list of all virtual machines in a VM scale sets. /// @@ -4239,13 +4523,13 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4254,51 +4538,54 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4310,55 +4597,56 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4368,9 +4656,10 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -4381,24 +4670,28 @@ internal VirtualMachineScaleSetVMsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMsOperationsExtensions.cs index 5ee965eaa539..a9b765e933cd 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetVMsOperationsExtensions.cs @@ -1,1640 +1,1545 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualMachineScaleSetVMsOperations. + /// Extension methods for VirtualMachineScaleSetVMSOperations /// - public static partial class VirtualMachineScaleSetVMsOperationsExtensions + public static partial class VirtualMachineScaleSetVMSOperationsExtensions { - /// - /// Gets a list of all virtual machines in a VM scale sets. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The filter to apply to the operation. Allowed values are - /// 'startswith(instanceView/statuses/code, 'PowerState') eq true', - /// 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq - /// false'. - /// - /// - /// The list parameters. Allowed values are 'instanceView', - /// 'instanceView/statuses'. - /// - /// - /// The expand expression to apply to the operation. Allowed values are - /// 'instanceView'. - /// - public static IPage List(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string filter = default(string), string select = default(string), string expand = default(string)) - { - return operations.ListAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all virtual machines in a VM scale sets. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VirtualMachineScaleSet - /// - /// - /// The filter to apply to the operation. Allowed values are - /// 'startswith(instanceView/statuses/code, 'PowerState') eq true', - /// 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq - /// false'. - /// - /// - /// The list parameters. Allowed values are 'instanceView', - /// 'instanceView/statuses'. - /// - /// - /// The expand expression to apply to the operation. Allowed values are - /// 'instanceView'. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string filter = default(string), string select = default(string), string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a virtual machine from a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The expand expression to apply on the operation. 'InstanceView' will - /// retrieve the instance view of the virtual machine. 'UserData' will retrieve - /// the UserData of the virtual machine. Possible values include: - /// 'instanceView', 'userData', 'resiliencyView' - /// - public static VirtualMachineScaleSetVM Get(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VmssVMInstanceViewTypes? expand = default(VmssVMInstanceViewTypes?)) - { - return operations.GetAsync(resourceGroupName, vmScaleSetName, instanceId, expand).GetAwaiter().GetResult(); - } - - /// - /// Gets a virtual machine from a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The expand expression to apply on the operation. 'InstanceView' will - /// retrieve the instance view of the virtual machine. 'UserData' will retrieve - /// the UserData of the virtual machine. Possible values include: - /// 'instanceView', 'userData', 'resiliencyView' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VmssVMInstanceViewTypes? expand = default(VmssVMInstanceViewTypes?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates a virtual machine of a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - public static VirtualMachineScaleSetVM Update(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) - { - return operations.UpdateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); - } - - /// - /// Updates a virtual machine of a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters, string ifMatch = default(string), string ifNoneMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a virtual machine from a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Optional parameter to force delete a virtual machine from a VM scale set. - /// (Feature in Preview) - /// - public static void Delete(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?)) - { - operations.DeleteAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion).GetAwaiter().GetResult(); - } - - /// - /// Deletes a virtual machine from a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Optional parameter to force delete a virtual machine from a VM scale set. - /// (Feature in Preview) - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set - /// instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - public static VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders ApproveRollingUpgrade(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) - { - return operations.ApproveRollingUpgradeAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); - } - - /// - /// Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set - /// instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task ApproveRollingUpgradeAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ApproveRollingUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Attach and detach data disks to/from a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Parameters supplied to the attach and detach data disks operation on a - /// Virtual Machine Scale Sets VM. - /// - public static StorageProfile AttachDetachDataDisks(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, AttachDetachDataDisksRequest parameters) - { - return operations.AttachDetachDataDisksAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).GetAwaiter().GetResult(); - } - - /// - /// Attach and detach data disks to/from a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Parameters supplied to the attach and detach data disks operation on a - /// Virtual Machine Scale Sets VM. - /// - /// - /// The cancellation token. - /// - public static async Task AttachDetachDataDisksAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, AttachDetachDataDisksRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.AttachDetachDataDisksWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deallocates a specific virtual machine in a VM scale set. Shuts down the - /// virtual machine and releases the compute resources it uses. You are not - /// billed for the compute resources of this virtual machine once it is - /// deallocated. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - public static void Deallocate(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) - { - operations.DeallocateAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); - } - - /// - /// Deallocates a specific virtual machine in a VM scale set. Shuts down the - /// virtual machine and releases the compute resources it uses. You are not - /// billed for the compute resources of this virtual machine once it is - /// deallocated. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task DeallocateAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeallocateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the status of a virtual machine from a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - public static VirtualMachineScaleSetVMInstanceView GetInstanceView(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) - { - return operations.GetInstanceViewAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); - } - - /// - /// Gets the status of a virtual machine from a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task GetInstanceViewAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetInstanceViewWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Performs maintenance on a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - public static void PerformMaintenance(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) - { - operations.PerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); - } - - /// - /// Performs maintenance on a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task PerformMaintenanceAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.PerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Power off (stop) a virtual machine in a VM scale set. Note that resources - /// are still attached and you are getting charged for the resources. Instead, - /// use deallocate to release resources and avoid charges. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The parameter to request non-graceful VM shutdown. True value for this flag - /// indicates non-graceful shutdown whereas false indicates otherwise. Default - /// value for this flag is false if not specified - /// - public static void PowerOff(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = default(bool?)) - { - operations.PowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).GetAwaiter().GetResult(); - } - - /// - /// Power off (stop) a virtual machine in a VM scale set. Note that resources - /// are still attached and you are getting charged for the resources. Instead, - /// use deallocate to release resources and avoid charges. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The parameter to request non-graceful VM shutdown. True value for this flag - /// indicates non-graceful shutdown whereas false indicates otherwise. Default - /// value for this flag is false if not specified - /// - /// - /// The cancellation token. - /// - public static async Task PowerOffAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.PowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Shuts down the virtual machine in the virtual machine scale set, moves it - /// to a new node, and powers it back on. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - public static void Redeploy(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) - { - operations.RedeployAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); - } - - /// - /// Shuts down the virtual machine in the virtual machine scale set, moves it - /// to a new node, and powers it back on. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task RedeployAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RedeployWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Reimages (upgrade the operating system) a specific virtual machine in a VM - /// scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Parameters for the Reimaging Virtual machine in ScaleSet. - /// - public static void Reimage(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters)) - { - operations.ReimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput).GetAwaiter().GetResult(); - } - - /// - /// Reimages (upgrade the operating system) a specific virtual machine in a VM - /// scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Parameters for the Reimaging Virtual machine in ScaleSet. - /// - /// - /// The cancellation token. - /// - public static async Task ReimageAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ReimageWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Allows you to re-image all the disks ( including data disks ) in the a VM - /// scale set instance. This operation is only supported for managed disks. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - public static void ReimageAll(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) - { - operations.ReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); - } - - /// - /// Allows you to re-image all the disks ( including data disks ) in the a VM - /// scale set instance. This operation is only supported for managed disks. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task ReimageAllAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ReimageAllWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Restarts a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - public static void Restart(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) - { - operations.RestartAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); - } - - /// - /// Restarts a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task RestartAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RestartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The operation to retrieve SAS URIs of boot diagnostic logs for a virtual - /// machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Expiration duration in minutes for the SAS URIs with a value between 1 to - /// 1440 minutes. **Note:** If not specified, SAS URIs will be generated with a - /// default expiration duration of 120 minutes. - /// - public static RetrieveBootDiagnosticsDataResult RetrieveBootDiagnosticsData(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, int? sasUriExpirationTimeInMinutes = default(int?)) - { - return operations.RetrieveBootDiagnosticsDataAsync(resourceGroupName, vmScaleSetName, instanceId, sasUriExpirationTimeInMinutes).GetAwaiter().GetResult(); - } - - /// - /// The operation to retrieve SAS URIs of boot diagnostic logs for a virtual - /// machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Expiration duration in minutes for the SAS URIs with a value between 1 to - /// 1440 minutes. **Note:** If not specified, SAS URIs will be generated with a - /// default expiration duration of 120 minutes. - /// - /// - /// The cancellation token. - /// - public static async Task RetrieveBootDiagnosticsDataAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, int? sasUriExpirationTimeInMinutes = default(int?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.RetrieveBootDiagnosticsDataWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, sasUriExpirationTimeInMinutes, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Run command on a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Parameters supplied to the Run command operation. - /// - public static RunCommandResult RunCommand(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, RunCommandInput parameters) - { - return operations.RunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).GetAwaiter().GetResult(); - } - - /// - /// Run command on a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Parameters supplied to the Run command operation. - /// - /// - /// The cancellation token. - /// - public static async Task RunCommandAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, RunCommandInput parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.RunCommandWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to simulate the eviction of spot virtual machine in a VM - /// scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - public static void SimulateEviction(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) - { - operations.SimulateEvictionAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); - } - - /// - /// The operation to simulate the eviction of spot virtual machine in a VM - /// scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task SimulateEvictionAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.SimulateEvictionWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Starts a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - public static void Start(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) - { - operations.StartAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); - } - - /// - /// Starts a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task StartAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.StartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Updates a virtual machine of a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - public static VirtualMachineScaleSetVM BeginUpdate(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) - { - return operations.BeginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); - } - - /// - /// Updates a virtual machine of a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters, string ifMatch = default(string), string ifNoneMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a virtual machine from a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Optional parameter to force delete a virtual machine from a VM scale set. - /// (Feature in Preview) - /// - public static void BeginDelete(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?)) - { - operations.BeginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion).GetAwaiter().GetResult(); - } - - /// - /// Deletes a virtual machine from a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Optional parameter to force delete a virtual machine from a VM scale set. - /// (Feature in Preview) - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set - /// instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - public static VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders BeginApproveRollingUpgrade(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) - { - return operations.BeginApproveRollingUpgradeAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); - } - - /// - /// Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set - /// instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginApproveRollingUpgradeAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginApproveRollingUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Attach and detach data disks to/from a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Parameters supplied to the attach and detach data disks operation on a - /// Virtual Machine Scale Sets VM. - /// - public static StorageProfile BeginAttachDetachDataDisks(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, AttachDetachDataDisksRequest parameters) - { - return operations.BeginAttachDetachDataDisksAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).GetAwaiter().GetResult(); - } - - /// - /// Attach and detach data disks to/from a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Parameters supplied to the attach and detach data disks operation on a - /// Virtual Machine Scale Sets VM. - /// - /// - /// The cancellation token. - /// - public static async Task BeginAttachDetachDataDisksAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, AttachDetachDataDisksRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginAttachDetachDataDisksWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deallocates a specific virtual machine in a VM scale set. Shuts down the - /// virtual machine and releases the compute resources it uses. You are not - /// billed for the compute resources of this virtual machine once it is - /// deallocated. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - public static void BeginDeallocate(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) - { - operations.BeginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); - } - - /// - /// Deallocates a specific virtual machine in a VM scale set. Shuts down the - /// virtual machine and releases the compute resources it uses. You are not - /// billed for the compute resources of this virtual machine once it is - /// deallocated. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeallocateAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeallocateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Performs maintenance on a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - public static void BeginPerformMaintenance(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) - { - operations.BeginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); - } - - /// - /// Performs maintenance on a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginPerformMaintenanceAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginPerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Power off (stop) a virtual machine in a VM scale set. Note that resources - /// are still attached and you are getting charged for the resources. Instead, - /// use deallocate to release resources and avoid charges. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The parameter to request non-graceful VM shutdown. True value for this flag - /// indicates non-graceful shutdown whereas false indicates otherwise. Default - /// value for this flag is false if not specified - /// - public static void BeginPowerOff(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = default(bool?)) - { - operations.BeginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).GetAwaiter().GetResult(); - } - - /// - /// Power off (stop) a virtual machine in a VM scale set. Note that resources - /// are still attached and you are getting charged for the resources. Instead, - /// use deallocate to release resources and avoid charges. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The parameter to request non-graceful VM shutdown. True value for this flag - /// indicates non-graceful shutdown whereas false indicates otherwise. Default - /// value for this flag is false if not specified - /// - /// - /// The cancellation token. - /// - public static async Task BeginPowerOffAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Shuts down the virtual machine in the virtual machine scale set, moves it - /// to a new node, and powers it back on. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - public static void BeginRedeploy(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) - { - operations.BeginRedeployAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); - } - - /// - /// Shuts down the virtual machine in the virtual machine scale set, moves it - /// to a new node, and powers it back on. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRedeployAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRedeployWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Reimages (upgrade the operating system) a specific virtual machine in a VM - /// scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Parameters for the Reimaging Virtual machine in ScaleSet. - /// - public static void BeginReimage(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters)) - { - operations.BeginReimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput).GetAwaiter().GetResult(); - } - - /// - /// Reimages (upgrade the operating system) a specific virtual machine in a VM - /// scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Parameters for the Reimaging Virtual machine in ScaleSet. - /// - /// - /// The cancellation token. - /// - public static async Task BeginReimageAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginReimageWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Allows you to re-image all the disks ( including data disks ) in the a VM - /// scale set instance. This operation is only supported for managed disks. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - public static void BeginReimageAll(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) - { - operations.BeginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); - } - - /// - /// Allows you to re-image all the disks ( including data disks ) in the a VM - /// scale set instance. This operation is only supported for managed disks. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginReimageAllAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginReimageAllWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Restarts a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - public static void BeginRestart(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) - { - operations.BeginRestartAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); - } - - /// - /// Restarts a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRestartAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRestartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Run command on a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Parameters supplied to the Run command operation. - /// - public static RunCommandResult BeginRunCommand(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, RunCommandInput parameters) - { - return operations.BeginRunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).GetAwaiter().GetResult(); - } - - /// - /// Run command on a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// Parameters supplied to the Run command operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRunCommandAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, RunCommandInput parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginRunCommandWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Starts a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - public static void BeginStart(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) - { - operations.BeginStartAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); - } - - /// - /// Starts a virtual machine in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The instance ID of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStartAsync(this IVirtualMachineScaleSetVMsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a list of all virtual machines in a VM scale sets. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualMachineScaleSetVMsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all virtual machines in a VM scale sets. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualMachineScaleSetVMsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// Gets a list of all virtual machines in a VM scale sets. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The filter to apply to the operation. Allowed values are + /// 'startswith(instanceView/statuses/code, 'PowerState') eq true', + /// 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq + /// false'. + /// + /// + /// The list parameters. Allowed values are 'instanceView', + /// 'instanceView/statuses'. + /// + /// + /// The expand expression to apply to the operation. Allowed values are + /// 'instanceView'. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string filter = default(string), string select = default(string), string expand = default(string)) + { + return ((IVirtualMachineScaleSetVMSOperations)operations).ListAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all virtual machines in a VM scale sets. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VirtualMachineScaleSet + /// + /// + /// The filter to apply to the operation. Allowed values are + /// 'startswith(instanceView/statuses/code, 'PowerState') eq true', + /// 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq + /// false'. + /// + /// + /// The list parameters. Allowed values are 'instanceView', + /// 'instanceView/statuses'. + /// + /// + /// The expand expression to apply to the operation. Allowed values are + /// 'instanceView'. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string filter = default(string), string select = default(string), string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a virtual machine from a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The expand expression to apply on the operation. 'InstanceView' will + /// retrieve the instance view of the virtual machine. 'UserData' will retrieve + /// the UserData of the virtual machine. + /// + public static VirtualMachineScaleSetVM Get(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VmssVMInstanceViewTypes? expand = default(VmssVMInstanceViewTypes?)) + { + return ((IVirtualMachineScaleSetVMSOperations)operations).GetAsync(resourceGroupName, vmScaleSetName, instanceId, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets a virtual machine from a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The expand expression to apply on the operation. 'InstanceView' will + /// retrieve the instance view of the virtual machine. 'UserData' will retrieve + /// the UserData of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VmssVMInstanceViewTypes? expand = default(VmssVMInstanceViewTypes?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Updates a virtual machine of a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + public static VirtualMachineScaleSetVM Update(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) + { + return ((IVirtualMachineScaleSetVMSOperations)operations).UpdateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); + } + + /// + /// Updates a virtual machine of a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a virtual machine from a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// Optional parameter to force delete a virtual machine from a VM scale set. + /// (Feature in Preview) + /// + public static void Delete(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?)) + { + ((IVirtualMachineScaleSetVMSOperations)operations).DeleteAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion).GetAwaiter().GetResult(); + } + + /// + /// Deletes a virtual machine from a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// Optional parameter to force delete a virtual machine from a VM scale set. + /// (Feature in Preview) + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set + /// instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static VirtualMachineScaleSetVMSApproveRollingUpgradeHeaders ApproveRollingUpgrade(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + { + return ((IVirtualMachineScaleSetVMSOperations)operations).ApproveRollingUpgradeAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + } + + /// + /// Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set + /// instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ApproveRollingUpgradeAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ApproveRollingUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Attach and detach data disks to/from a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static StorageProfile AttachDetachDataDisks(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, AttachDetachDataDisksRequest parameters) + { + return ((IVirtualMachineScaleSetVMSOperations)operations).AttachDetachDataDisksAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Attach and detach data disks to/from a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task AttachDetachDataDisksAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, AttachDetachDataDisksRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.AttachDetachDataDisksWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deallocates a specific virtual machine in a VM scale set. Shuts down the + /// virtual machine and releases the compute resources it uses. You are not + /// billed for the compute resources of this virtual machine once it is + /// deallocated. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static void Deallocate(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + { + ((IVirtualMachineScaleSetVMSOperations)operations).DeallocateAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + } + + /// + /// Deallocates a specific virtual machine in a VM scale set. Shuts down the + /// virtual machine and releases the compute resources it uses. You are not + /// billed for the compute resources of this virtual machine once it is + /// deallocated. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeallocateAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeallocateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets the status of a virtual machine from a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static VirtualMachineScaleSetVMInstanceView GetInstanceView(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + { + return ((IVirtualMachineScaleSetVMSOperations)operations).GetInstanceViewAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + } + + /// + /// Gets the status of a virtual machine from a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetInstanceViewAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetInstanceViewWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Performs maintenance on a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static void PerformMaintenance(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + { + ((IVirtualMachineScaleSetVMSOperations)operations).PerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + } + + /// + /// Performs maintenance on a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task PerformMaintenanceAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.PerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Power off (stop) a virtual machine in a VM scale set. Note that resources + /// are still attached and you are getting charged for the resources. Instead, + /// use deallocate to release resources and avoid charges. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// + public static void PowerOff(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = default(bool?)) + { + ((IVirtualMachineScaleSetVMSOperations)operations).PowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).GetAwaiter().GetResult(); + } + + /// + /// Power off (stop) a virtual machine in a VM scale set. Note that resources + /// are still attached and you are getting charged for the resources. Instead, + /// use deallocate to release resources and avoid charges. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task PowerOffAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.PowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Shuts down the virtual machine in the virtual machine scale set, moves it + /// to a new node, and powers it back on. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static void Redeploy(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + { + ((IVirtualMachineScaleSetVMSOperations)operations).RedeployAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + } + + /// + /// Shuts down the virtual machine in the virtual machine scale set, moves it + /// to a new node, and powers it back on. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RedeployAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.RedeployWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Reimages (upgrade the operating system) a specific virtual machine in a VM + /// scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static void Reimage(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters)) + { + ((IVirtualMachineScaleSetVMSOperations)operations).ReimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput).GetAwaiter().GetResult(); + } + + /// + /// Reimages (upgrade the operating system) a specific virtual machine in a VM + /// scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ReimageAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ReimageWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Allows you to re-image all the disks ( including data disks ) in the a VM + /// scale set instance. This operation is only supported for managed disks. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static void ReimageAll(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + { + ((IVirtualMachineScaleSetVMSOperations)operations).ReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + } + + /// + /// Allows you to re-image all the disks ( including data disks ) in the a VM + /// scale set instance. This operation is only supported for managed disks. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ReimageAllAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ReimageAllWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Restarts a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static void Restart(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + { + ((IVirtualMachineScaleSetVMSOperations)operations).RestartAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + } + + /// + /// Restarts a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RestartAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.RestartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to retrieve SAS URIs of boot diagnostic logs for a virtual + /// machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// Expiration duration in minutes for the SAS URIs with a value between 1 to + /// 1440 minutes. **Note:** If not specified, SAS URIs will be generated with a + /// default expiration duration of 120 minutes. + /// + public static RetrieveBootDiagnosticsDataResult RetrieveBootDiagnosticsData(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, int? sasUriExpirationTimeInMinutes = default(int?)) + { + return ((IVirtualMachineScaleSetVMSOperations)operations).RetrieveBootDiagnosticsDataAsync(resourceGroupName, vmScaleSetName, instanceId, sasUriExpirationTimeInMinutes).GetAwaiter().GetResult(); + } + + /// + /// The operation to retrieve SAS URIs of boot diagnostic logs for a virtual + /// machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// Expiration duration in minutes for the SAS URIs with a value between 1 to + /// 1440 minutes. **Note:** If not specified, SAS URIs will be generated with a + /// default expiration duration of 120 minutes. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RetrieveBootDiagnosticsDataAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, int? sasUriExpirationTimeInMinutes = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.RetrieveBootDiagnosticsDataWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, sasUriExpirationTimeInMinutes, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Run command on a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static RunCommandResult RunCommand(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, RunCommandInput parameters) + { + return ((IVirtualMachineScaleSetVMSOperations)operations).RunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Run command on a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RunCommandAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, RunCommandInput parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.RunCommandWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// The operation to simulate the eviction of spot virtual machine in a VM + /// scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static void SimulateEviction(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + { + ((IVirtualMachineScaleSetVMSOperations)operations).SimulateEvictionAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + } + + /// + /// The operation to simulate the eviction of spot virtual machine in a VM + /// scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task SimulateEvictionAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.SimulateEvictionWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Starts a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static void Start(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + { + ((IVirtualMachineScaleSetVMSOperations)operations).StartAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + } + + /// + /// Starts a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StartAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.StartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Updates a virtual machine of a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + public static VirtualMachineScaleSetVM BeginUpdate(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) + { + return ((IVirtualMachineScaleSetVMSOperations)operations).BeginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); + } + + /// + /// Updates a virtual machine of a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVM parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a virtual machine from a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// Optional parameter to force delete a virtual machine from a VM scale set. + /// (Feature in Preview) + /// + public static void BeginDelete(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?)) + { + ((IVirtualMachineScaleSetVMSOperations)operations).BeginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion).GetAwaiter().GetResult(); + } + + /// + /// Deletes a virtual machine from a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// Optional parameter to force delete a virtual machine from a VM scale set. + /// (Feature in Preview) + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? forceDeletion = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set + /// instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static VirtualMachineScaleSetVMSApproveRollingUpgradeHeaders BeginApproveRollingUpgrade(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + { + return ((IVirtualMachineScaleSetVMSOperations)operations).BeginApproveRollingUpgradeAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + } + + /// + /// Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set + /// instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginApproveRollingUpgradeAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginApproveRollingUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Attach and detach data disks to/from a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static StorageProfile BeginAttachDetachDataDisks(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, AttachDetachDataDisksRequest parameters) + { + return ((IVirtualMachineScaleSetVMSOperations)operations).BeginAttachDetachDataDisksAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Attach and detach data disks to/from a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginAttachDetachDataDisksAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, AttachDetachDataDisksRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginAttachDetachDataDisksWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deallocates a specific virtual machine in a VM scale set. Shuts down the + /// virtual machine and releases the compute resources it uses. You are not + /// billed for the compute resources of this virtual machine once it is + /// deallocated. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static void BeginDeallocate(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + { + ((IVirtualMachineScaleSetVMSOperations)operations).BeginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + } + + /// + /// Deallocates a specific virtual machine in a VM scale set. Shuts down the + /// virtual machine and releases the compute resources it uses. You are not + /// billed for the compute resources of this virtual machine once it is + /// deallocated. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeallocateAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeallocateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Performs maintenance on a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static void BeginPerformMaintenance(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + { + ((IVirtualMachineScaleSetVMSOperations)operations).BeginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + } + + /// + /// Performs maintenance on a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginPerformMaintenanceAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginPerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Power off (stop) a virtual machine in a VM scale set. Note that resources + /// are still attached and you are getting charged for the resources. Instead, + /// use deallocate to release resources and avoid charges. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// + public static void BeginPowerOff(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = default(bool?)) + { + ((IVirtualMachineScaleSetVMSOperations)operations).BeginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).GetAwaiter().GetResult(); + } + + /// + /// Power off (stop) a virtual machine in a VM scale set. Note that resources + /// are still attached and you are getting charged for the resources. Instead, + /// use deallocate to release resources and avoid charges. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginPowerOffAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, bool? skipShutdown = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Shuts down the virtual machine in the virtual machine scale set, moves it + /// to a new node, and powers it back on. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static void BeginRedeploy(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + { + ((IVirtualMachineScaleSetVMSOperations)operations).BeginRedeployAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + } + + /// + /// Shuts down the virtual machine in the virtual machine scale set, moves it + /// to a new node, and powers it back on. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRedeployAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginRedeployWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Reimages (upgrade the operating system) a specific virtual machine in a VM + /// scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static void BeginReimage(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters)) + { + ((IVirtualMachineScaleSetVMSOperations)operations).BeginReimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput).GetAwaiter().GetResult(); + } + + /// + /// Reimages (upgrade the operating system) a specific virtual machine in a VM + /// scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginReimageAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = default(VirtualMachineScaleSetVMReimageParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginReimageWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Allows you to re-image all the disks ( including data disks ) in the a VM + /// scale set instance. This operation is only supported for managed disks. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static void BeginReimageAll(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + { + ((IVirtualMachineScaleSetVMSOperations)operations).BeginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + } + + /// + /// Allows you to re-image all the disks ( including data disks ) in the a VM + /// scale set instance. This operation is only supported for managed disks. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginReimageAllAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginReimageAllWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Restarts a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static void BeginRestart(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + { + ((IVirtualMachineScaleSetVMSOperations)operations).BeginRestartAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + } + + /// + /// Restarts a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRestartAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginRestartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Run command on a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static RunCommandResult BeginRunCommand(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, RunCommandInput parameters) + { + return ((IVirtualMachineScaleSetVMSOperations)operations).BeginRunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Run command on a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRunCommandAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, RunCommandInput parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginRunCommandWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Starts a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + public static void BeginStart(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId) + { + ((IVirtualMachineScaleSetVMSOperations)operations).BeginStartAsync(resourceGroupName, vmScaleSetName, instanceId).GetAwaiter().GetResult(); + } + + /// + /// Starts a virtual machine in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The instance ID of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStartAsync(this IVirtualMachineScaleSetVMSOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets a list of all virtual machines in a VM scale sets. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualMachineScaleSetVMSOperations operations, string nextPageLink) + { + return ((IVirtualMachineScaleSetVMSOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all virtual machines in a VM scale sets. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualMachineScaleSetVMSOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetsOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetsOperations.cs index 04d3f2c9659f..af5d50d804be 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetsOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineScaleSetsOperations operations. /// - internal partial class VirtualMachineScaleSetsOperations : IServiceOperations, IVirtualMachineScaleSetsOperations + internal partial class VirtualMachineScaleSetsOperations : Microsoft.Rest.IServiceOperations, IVirtualMachineScaleSetsOperations { /// /// Initializes a new instance of the VirtualMachineScaleSetsOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualMachineScaleSetsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) + internal VirtualMachineScaleSetsOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,13 +51,13 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -78,42 +66,51 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByLocationWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByLocationWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByLocation", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByLocation", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachineScaleSets").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -123,25 +120,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -153,55 +149,56 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -211,9 +208,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -224,25 +222,29 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a list of all VM Scale Sets in the subscription, regardless of the /// associated resource group. Use nextLink property in the response to get the @@ -255,13 +257,13 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -270,29 +272,38 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -302,25 +313,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -332,55 +342,56 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -390,9 +401,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -403,25 +415,29 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a list of all VM scale sets under a resource group. /// @@ -434,13 +450,13 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -449,46 +465,55 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -498,25 +523,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -528,55 +552,56 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -586,9 +611,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -599,25 +625,29 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Display information about a virtual machine scale set. /// @@ -628,10 +658,9 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// The name of the VM scale set. /// /// - /// The expand expression to apply on the operation. 'UserData' retrieves the + /// The expand expression to apply on the operation. 'UserData' retrieves the /// UserData property of the VM scale set that was provided by the user during - /// the VM scale set Create/Update operation. Possible values include: - /// 'userData' + /// the VM scale set Create/Update operation /// /// /// Headers that will be added to request. @@ -639,13 +668,13 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -654,53 +683,64 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -714,25 +754,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -744,55 +783,56 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -802,9 +842,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -815,25 +856,29 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a VM scale set. /// @@ -843,30 +888,30 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The name of the VM scale set. /// - /// - /// The scale set object. - /// /// /// The ETag of the transformation. Omit this value to always overwrite the /// current resource. Specify the last-seen ETag value to prevent accidentally /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent updating + /// Set to '*' to allow a new record set to be created, but to prevent updating /// an existing record set. Other values will result in error from server as /// they are not supported. /// + /// + /// The scale set object. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSet parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSet parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -878,30 +923,30 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The name of the VM scale set. /// - /// - /// The scale set object. - /// /// /// The ETag of the transformation. Omit this value to always overwrite the /// current resource. Specify the last-seen ETag value to prevent accidentally /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent updating + /// Set to '*' to allow a new record set to be created, but to prevent updating /// an existing record set. Other values will result in error from server as /// they are not supported. /// + /// + /// The scale set object. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -917,16 +962,16 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// Optional parameter to force delete a VM scale set. (Feature in Preview) /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, forceDeletion, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, forceDeletion, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -945,16 +990,16 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// virtual machines in the virtual machine scale set. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ApproveRollingUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ApproveRollingUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginApproveRollingUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginApproveRollingUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -979,10 +1024,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -991,58 +1036,68 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ConvertToSinglePlacementGroupWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string activePlacementGroupId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ConvertToSinglePlacementGroupWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string activePlacementGroupId = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; VMScaleSetConvertToSinglePlacementGroupInput parameters = new VMScaleSetConvertToSinglePlacementGroupInput(); - if (activePlacementGroupId != null) + if(activePlacementGroupId != null) { parameters.ActivePlacementGroupId = activePlacementGroupId; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ConvertToSinglePlacementGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ConvertToSinglePlacementGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1052,25 +1107,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1082,61 +1136,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1146,20 +1201,25 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deallocates specific virtual machines in a VM scale set. Shuts down the /// virtual machines and releases the compute resources. You are not billed for @@ -1181,16 +1241,16 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// virtual machines in the virtual machine scale set. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeallocateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? hibernate = default(bool?), IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeallocateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), bool? hibernate = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeallocateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, hibernate, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeallocateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, hibernate, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1202,24 +1262,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The name of the VM scale set. /// - /// - /// The virtual machine scale set instance ids. - /// /// /// Optional parameter to force delete virtual machines from the VM scale set. /// (Feature in Preview) /// + /// + /// The virtual machine scale set instance ids. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds, bool? forceDeletion = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, forceDeletion, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, forceDeletion, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1248,13 +1308,13 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1263,60 +1323,73 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ForceRecoveryServiceFabricPlatformUpdateDomainWalkWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, int platformUpdateDomain, string zone = default(string), string placementGroupId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ForceRecoveryServiceFabricPlatformUpdateDomainWalkWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, int platformUpdateDomain, string zone = default(string), string placementGroupId = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + + + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("platformUpdateDomain", platformUpdateDomain); tracingParameters.Add("zone", zone); tracingParameters.Add("placementGroupId", placementGroupId); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } - _queryParameters.Add(string.Format("platformUpdateDomain={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(platformUpdateDomain, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("platformUpdateDomain={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(platformUpdateDomain, this.Client.SerializationSettings).Trim('"')))); if (zone != null) { _queryParameters.Add(string.Format("zone={0}", System.Uri.EscapeDataString(zone))); @@ -1330,25 +1403,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1360,55 +1432,56 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1418,9 +1491,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1431,25 +1505,29 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the status of a VM scale set instance. /// @@ -1465,13 +1543,13 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1480,52 +1558,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceViewWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetInstanceViewWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceView", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetInstanceView", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1535,25 +1623,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1565,55 +1652,56 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1623,9 +1711,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1636,25 +1725,29 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Upgrades one or more virtual machines to the latest SKU set in the VM scale /// set model. @@ -1669,16 +1762,16 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// The virtual machine scale set instance ids. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task UpdateInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task UpdateInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginUpdateInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1696,13 +1789,13 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1711,52 +1804,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetOSUpgradeHistoryWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> GetOSUpgradeHistoryWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetOSUpgradeHistory", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetOSUpgradeHistory", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1766,25 +1869,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1796,55 +1898,56 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1854,9 +1957,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1867,25 +1971,29 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Perform maintenance on one or more virtual machines in a VM scale set. /// Operation on instances which are not eligible for perform maintenance will @@ -1904,16 +2012,16 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// virtual machines in the virtual machine scale set. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task PerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task PerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginPerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginPerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1938,16 +2046,16 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// virtual machines in the virtual machine scale set. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? skipShutdown = default(bool?), IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), bool? skipShutdown = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, skipShutdown, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1961,16 +2069,16 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// The name of the VM scale set. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ReapplyWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ReapplyWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginReapplyWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginReapplyWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1989,21 +2097,21 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// virtual machines in the virtual machine scale set. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task RedeployWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task RedeployWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRedeployWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRedeployWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// /// Reimages (upgrade the operating system) one or more virtual machines in a - /// VM scale set which don't have a ephemeral OS disk, for virtual machines who + /// VM scale set which don't have a ephemeral OS disk, for virtual machines who /// have a ephemeral OS disk the virtual machine is reset to initial state. /// /// @@ -2016,16 +2124,16 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// Parameters for Reimaging VM ScaleSet. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ReimageWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = default(VirtualMachineScaleSetReimageParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ReimageWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = default(VirtualMachineScaleSetReimageParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginReimageWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginReimageWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -2044,16 +2152,16 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// virtual machines in the virtual machine scale set. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ReimageAllWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ReimageAllWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginReimageAllWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginReimageAllWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -2071,16 +2179,16 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// virtual machines in the virtual machine scale set. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task RestartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task RestartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRestartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRestartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -2096,16 +2204,16 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// The input object for ScaleOut API. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ScaleOutWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VMScaleSetScaleOutInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ScaleOutWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VMScaleSetScaleOutInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginScaleOutWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginScaleOutWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -2121,16 +2229,16 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// The input object for SetOrchestrationServiceState API. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task SetOrchestrationServiceStateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, OrchestrationServiceStateInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task SetOrchestrationServiceStateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, OrchestrationServiceStateInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginSetOrchestrationServiceStateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginSetOrchestrationServiceStateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -2149,13 +2257,13 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2164,52 +2272,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSkusWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListSkusWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSkus", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSkus", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2219,25 +2337,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2249,55 +2366,56 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2307,9 +2425,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2320,25 +2439,29 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Starts one or more virtual machines in a VM scale set. /// @@ -2354,16 +2477,16 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// virtual machines in the virtual machine scale set. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task StartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -2375,32 +2498,32 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The name of the VM scale set. /// - /// - /// The scale set object. - /// /// /// The ETag of the transformation. Omit this value to always overwrite the /// current resource. Specify the last-seen ETag value to prevent accidentally /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent updating + /// Set to '*' to allow a new record set to be created, but to prevent updating /// an existing record set. Other values will result in error from server as /// they are not supported. /// + /// + /// The scale set object. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2409,63 +2532,75 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSet parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSet parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("ifNoneMatch", ifNoneMatch); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2475,15 +2610,23 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + } if (ifMatch != null) { if (_httpRequest.Headers.Contains("If-Match")) @@ -2500,15 +2643,6 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) } _httpRequest.Headers.TryAddWithoutValidation("If-None-Match", ifNoneMatch); } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - if (customHeaders != null) { @@ -2521,61 +2655,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2585,9 +2720,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2598,16 +2734,16 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -2616,38 +2752,42 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update a VM scale set. /// @@ -2657,32 +2797,32 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The name of the VM scale set. /// - /// - /// The scale set object. - /// /// /// The ETag of the transformation. Omit this value to always overwrite the /// current resource. Specify the last-seen ETag value to prevent accidentally /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent updating + /// Set to '*' to allow a new record set to be created, but to prevent updating /// an existing record set. Other values will result in error from server as /// they are not supported. /// + /// + /// The scale set object. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2691,59 +2831,71 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("ifNoneMatch", ifNoneMatch); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2753,15 +2905,23 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + } if (ifMatch != null) { if (_httpRequest.Headers.Contains("If-Match")) @@ -2778,15 +2938,6 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) } _httpRequest.Headers.TryAddWithoutValidation("If-None-Match", ifNoneMatch); } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - if (customHeaders != null) { @@ -2799,61 +2950,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2863,9 +3015,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2876,38 +3029,42 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a VM scale set. /// @@ -2926,10 +3083,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2938,85 +3095,95 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("forceDeletion", forceDeletion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (forceDeletion != null) { - _queryParameters.Add(string.Format("forceDeletion={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(forceDeletion, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("forceDeletion={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(forceDeletion, this.Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3028,55 +3195,56 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3086,20 +3254,25 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Approve upgrade on deferred rolling upgrades for OS disks in the virtual /// machines in a VM scale set. @@ -3121,10 +3294,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3133,59 +3306,68 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginApproveRollingUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginApproveRollingUpgradeWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); - if (instanceIds != null) + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + if(instanceIds != null) { - vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.InstanceIds = instanceIds; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + tracingParameters.Add("vmInstanceIDs", vmInstanceIDs); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginApproveRollingUpgrade", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginApproveRollingUpgrade", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/approveRollingUpgrade").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3195,25 +3377,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3225,61 +3406,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vmInstanceIDs != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3289,33 +3471,38 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deallocates specific virtual machines in a VM scale set. Shuts down the /// virtual machines and releases the compute resources. You are not billed for @@ -3342,10 +3529,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3354,92 +3541,101 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeallocateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? hibernate = default(bool?), IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeallocateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), bool? hibernate = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + + string apiVersion = "2025-04-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); - if (instanceIds != null) + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + if(instanceIds != null) { - vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.InstanceIds = instanceIds; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("hibernate", hibernate); + tracingParameters.Add("vmInstanceIDs", vmInstanceIDs); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeallocate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeallocate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (hibernate != null) { - _queryParameters.Add(string.Format("hibernate={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(hibernate, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("hibernate={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(hibernate, this.Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3451,61 +3647,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vmInstanceIDs != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3515,20 +3712,25 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes virtual machines in a VM scale set. /// @@ -3538,23 +3740,23 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The name of the VM scale set. /// - /// - /// The virtual machine scale set instance ids. - /// /// /// Optional parameter to force delete virtual machines from the VM scale set. /// (Feature in Preview) /// + /// + /// The virtual machine scale set instance ids. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3563,95 +3765,101 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds, bool? forceDeletion = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); - } - if (instanceIds == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceIds"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + + string apiVersion = "2025-04-01"; VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); - if (instanceIds != null) + if(instanceIds != null) { vmInstanceIDs.InstanceIds = instanceIds; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("forceDeletion", forceDeletion); + tracingParameters.Add("vmInstanceIDs", vmInstanceIDs); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteInstances", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteInstances", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (forceDeletion != null) { - _queryParameters.Add(string.Format("forceDeletion={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(forceDeletion, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("forceDeletion={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(forceDeletion, this.Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3663,61 +3871,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vmInstanceIDs != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3727,20 +3936,25 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Upgrades one or more virtual machines to the latest SKU set in the VM scale /// set model. @@ -3760,10 +3974,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3772,62 +3986,68 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginUpdateInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginUpdateInstancesWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); - } - if (instanceIds == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceIds"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); - if (instanceIds != null) + if(instanceIds != null) { vmInstanceIDs.InstanceIds = instanceIds; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + tracingParameters.Add("vmInstanceIDs", vmInstanceIDs); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateInstances", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateInstances", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3837,25 +4057,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3867,61 +4086,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vmInstanceIDs != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3931,20 +4151,25 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Perform maintenance on one or more virtual machines in a VM scale set. /// Operation on instances which are not eligible for perform maintenance will @@ -3968,10 +4193,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3980,59 +4205,68 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginPerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginPerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); - if (instanceIds != null) + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + if(instanceIds != null) { - vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.InstanceIds = instanceIds; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + tracingParameters.Add("vmInstanceIDs", vmInstanceIDs); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginPerformMaintenance", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginPerformMaintenance", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -4042,25 +4276,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4072,61 +4305,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vmInstanceIDs != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4136,20 +4370,25 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Power off (stop) one or more virtual machines in a VM scale set. Note that /// resources are still attached and you are getting charged for the resources. @@ -4177,10 +4416,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4189,92 +4428,101 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, bool? skipShutdown = default(bool?), IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), bool? skipShutdown = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + + string apiVersion = "2025-04-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); - if (instanceIds != null) + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + if(instanceIds != null) { - vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.InstanceIds = instanceIds; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("skipShutdown", skipShutdown); + tracingParameters.Add("vmInstanceIDs", vmInstanceIDs); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginPowerOff", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginPowerOff", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (skipShutdown != null) { - _queryParameters.Add(string.Format("skipShutdown={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skipShutdown, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("skipShutdown={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(skipShutdown, this.Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4286,61 +4534,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vmInstanceIDs != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4350,20 +4599,25 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the /// Virtual Machine Instances @@ -4380,10 +4634,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4392,52 +4646,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginReapplyWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginReapplyWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginReapply", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginReapply", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reapply").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -4447,25 +4711,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4477,55 +4740,56 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4535,33 +4799,38 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Shuts down all the virtual machines in the virtual machine scale set, moves /// them to a new node, and powers them back on. @@ -4583,10 +4852,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4595,59 +4864,68 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRedeployWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginRedeployWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); - if (instanceIds != null) + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + if(instanceIds != null) { - vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.InstanceIds = instanceIds; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + tracingParameters.Add("vmInstanceIDs", vmInstanceIDs); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRedeploy", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRedeploy", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -4657,25 +4935,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4687,61 +4964,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vmInstanceIDs != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4751,23 +5029,28 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Reimages (upgrade the operating system) one or more virtual machines in a - /// VM scale set which don't have a ephemeral OS disk, for virtual machines who + /// VM scale set which don't have a ephemeral OS disk, for virtual machines who /// have a ephemeral OS disk the virtual machine is reset to initial state. /// /// @@ -4785,10 +5068,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4797,53 +5080,64 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginReimageWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = default(VirtualMachineScaleSetReimageParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginReimageWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = default(VirtualMachineScaleSetReimageParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + tracingParameters.Add("vmScaleSetReimageInput", vmScaleSetReimageInput); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginReimage", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginReimage", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -4853,25 +5147,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4883,61 +5176,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vmScaleSetReimageInput != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vmScaleSetReimageInput, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vmScaleSetReimageInput, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4947,20 +5241,25 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Reimages all the disks ( including data disks ) in the virtual machines in /// a VM scale set. This operation is only supported for managed disks. @@ -4982,10 +5281,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4994,59 +5293,68 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginReimageAllWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginReimageAllWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); - if (instanceIds != null) + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + if(instanceIds != null) { - vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.InstanceIds = instanceIds; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + tracingParameters.Add("vmInstanceIDs", vmInstanceIDs); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginReimageAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginReimageAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -5056,25 +5364,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -5086,61 +5393,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vmInstanceIDs != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -5150,20 +5458,25 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Restarts one or more virtual machines in a VM scale set. /// @@ -5184,10 +5497,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -5196,59 +5509,68 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); - if (instanceIds != null) + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + if(instanceIds != null) { - vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.InstanceIds = instanceIds; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + tracingParameters.Add("vmInstanceIDs", vmInstanceIDs); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestart", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRestart", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -5258,25 +5580,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -5288,61 +5609,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vmInstanceIDs != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -5352,20 +5674,25 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Scales out one or more virtual machines in a VM scale set. /// @@ -5384,10 +5711,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -5396,61 +5723,71 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginScaleOutWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VMScaleSetScaleOutInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginScaleOutWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, VMScaleSetScaleOutInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginScaleOut", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginScaleOut", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/scaleOut").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -5460,25 +5797,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -5490,61 +5826,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -5554,33 +5891,38 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Changes ServiceState property for a given service /// @@ -5599,10 +5941,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -5611,61 +5953,71 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginSetOrchestrationServiceStateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, OrchestrationServiceStateInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginSetOrchestrationServiceStateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, OrchestrationServiceStateInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginSetOrchestrationServiceState", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginSetOrchestrationServiceState", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -5675,25 +6027,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -5705,61 +6056,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -5769,20 +6121,25 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Starts one or more virtual machines in a VM scale set. /// @@ -5803,10 +6160,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -5815,59 +6172,68 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmScaleSetName"); } + string apiVersion = "2025-04-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = default(VirtualMachineScaleSetVMInstanceIDs); - if (instanceIds != null) + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); + if(instanceIds != null) { - vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.InstanceIds = instanceIds; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); + tracingParameters.Add("vmInstanceIDs", vmInstanceIDs); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -5877,25 +6243,24 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -5907,61 +6272,62 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(vmInstanceIDs != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vmInstanceIDs, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -5971,20 +6337,25 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the VM scale sets under the specified subscription for the /// specified location. @@ -5998,13 +6369,13 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -6013,51 +6384,54 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByLocationNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByLocationNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByLocationNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -6069,55 +6443,56 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -6127,9 +6502,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -6140,25 +6516,29 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a list of all VM Scale Sets in the subscription, regardless of the /// associated resource group. Use nextLink property in the response to get the @@ -6174,13 +6554,13 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -6189,51 +6569,54 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -6245,55 +6628,56 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -6303,9 +6687,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -6316,25 +6701,29 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a list of all VM scale sets under a resource group. /// @@ -6347,13 +6736,13 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -6362,51 +6751,54 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -6418,55 +6810,56 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -6476,9 +6869,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -6489,25 +6883,29 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets list of OS upgrades on a VM scale set instance. /// @@ -6520,13 +6918,13 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -6535,51 +6933,54 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetOSUpgradeHistoryNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> GetOSUpgradeHistoryNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetOSUpgradeHistoryNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetOSUpgradeHistoryNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -6591,55 +6992,56 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -6649,9 +7051,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -6662,25 +7065,29 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a list of SKUs available for your VM scale set, including the minimum /// and maximum VM instances allowed for each SKU. @@ -6694,13 +7101,13 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -6709,51 +7116,54 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSkusNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListSkusNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSkusNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSkusNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -6765,55 +7175,56 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -6823,9 +7234,10 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -6836,24 +7248,28 @@ internal VirtualMachineScaleSetsOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetsOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetsOperationsExtensions.cs index e5e7e2814cec..3fcfb2821371 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetsOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineScaleSetsOperationsExtensions.cs @@ -1,2330 +1,2013 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualMachineScaleSetsOperations. + /// Extension methods for VirtualMachineScaleSetsOperations /// public static partial class VirtualMachineScaleSetsOperationsExtensions { - /// - /// Gets all the VM scale sets under the specified subscription for the - /// specified location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - public static IPage ListByLocation(this IVirtualMachineScaleSetsOperations operations, string location) - { - return operations.ListByLocationAsync(location).GetAwaiter().GetResult(); - } - - /// - /// Gets all the VM scale sets under the specified subscription for the - /// specified location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByLocationAsync(this IVirtualMachineScaleSetsOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByLocationWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of all VM Scale Sets in the subscription, regardless of the - /// associated resource group. Use nextLink property in the response to get the - /// next page of VM Scale Sets. Do this till nextLink is null to fetch all the - /// VM Scale Sets. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListAll(this IVirtualMachineScaleSetsOperations operations) - { - return operations.ListAllAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all VM Scale Sets in the subscription, regardless of the - /// associated resource group. Use nextLink property in the response to get the - /// next page of VM Scale Sets. Do this till nextLink is null to fetch all the - /// VM Scale Sets. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this IVirtualMachineScaleSetsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of all VM scale sets under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage List(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName) - { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all VM scale sets under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Display information about a virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The expand expression to apply on the operation. 'UserData' retrieves the - /// UserData property of the VM scale set that was provided by the user during - /// the VM scale set Create/Update operation. Possible values include: - /// 'userData' - /// - public static VirtualMachineScaleSet Get(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, string expand = default(string)) - { - return operations.GetAsync(resourceGroupName, vmScaleSetName, expand).GetAwaiter().GetResult(); - } - - /// - /// Display information about a virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The expand expression to apply on the operation. 'UserData' retrieves the - /// UserData property of the VM scale set that was provided by the user during - /// the VM scale set Create/Update operation. Possible values include: - /// 'userData' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The scale set object. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - public static VirtualMachineScaleSet CreateOrUpdate(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSet parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) - { - return operations.CreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); - } - - /// - /// Create or update a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The scale set object. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSet parameters, string ifMatch = default(string), string ifNoneMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The scale set object. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - public static VirtualMachineScaleSet Update(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) - { - return operations.UpdateAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); - } - - /// - /// Update a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The scale set object. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// Optional parameter to force delete a VM scale set. (Feature in Preview) - /// - public static void Delete(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?)) - { - operations.DeleteAsync(resourceGroupName, vmScaleSetName, forceDeletion).GetAwaiter().GetResult(); - } - - /// - /// Deletes a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// Optional parameter to force delete a VM scale set. (Feature in Preview) - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Approve upgrade on deferred rolling upgrades for OS disks in the virtual - /// machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - public static VirtualMachineScaleSetsApproveRollingUpgradeHeaders ApproveRollingUpgrade(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList)) - { - return operations.ApproveRollingUpgradeAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Approve upgrade on deferred rolling upgrades for OS disks in the virtual - /// machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task ApproveRollingUpgradeAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ApproveRollingUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Converts SinglePlacementGroup property to false for a existing virtual - /// machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// Id of the placement group in which you want future virtual machine - /// instances to be placed. To query placement group Id, please use Virtual - /// Machine Scale Set VMs - Get API. If not provided, the platform will choose - /// one with maximum number of virtual machine instances. - /// - public static void ConvertToSinglePlacementGroup(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, string activePlacementGroupId = default(string)) - { - operations.ConvertToSinglePlacementGroupAsync(resourceGroupName, vmScaleSetName, activePlacementGroupId).GetAwaiter().GetResult(); - } - - /// - /// Converts SinglePlacementGroup property to false for a existing virtual - /// machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// Id of the placement group in which you want future virtual machine - /// instances to be placed. To query placement group Id, please use Virtual - /// Machine Scale Set VMs - Get API. If not provided, the platform will choose - /// one with maximum number of virtual machine instances. - /// - /// - /// The cancellation token. - /// - public static async Task ConvertToSinglePlacementGroupAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, string activePlacementGroupId = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ConvertToSinglePlacementGroupWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, activePlacementGroupId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deallocates specific virtual machines in a VM scale set. Shuts down the - /// virtual machines and releases the compute resources. You are not billed for - /// the compute resources that this virtual machine scale set deallocates. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// Optional parameter to hibernate a virtual machine from the VM scale set. - /// (This feature is available for VMSS with Flexible OrchestrationMode only) - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - public static void Deallocate(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? hibernate = default(bool?), IList instanceIds = default(IList)) - { - operations.DeallocateAsync(resourceGroupName, vmScaleSetName, hibernate, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Deallocates specific virtual machines in a VM scale set. Shuts down the - /// virtual machines and releases the compute resources. You are not billed for - /// the compute resources that this virtual machine scale set deallocates. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// Optional parameter to hibernate a virtual machine from the VM scale set. - /// (This feature is available for VMSS with Flexible OrchestrationMode only) - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task DeallocateAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? hibernate = default(bool?), IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeallocateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, hibernate, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deletes virtual machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. - /// - /// - /// Optional parameter to force delete virtual machines from the VM scale set. - /// (Feature in Preview) - /// - public static void DeleteInstances(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds, bool? forceDeletion = default(bool?)) - { - operations.DeleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds, forceDeletion).GetAwaiter().GetResult(); - } - - /// - /// Deletes virtual machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. - /// - /// - /// Optional parameter to force delete virtual machines from the VM scale set. - /// (Feature in Preview) - /// - /// - /// The cancellation token. - /// - public static async Task DeleteInstancesAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Manual platform update domain walk to update virtual machines in a service - /// fabric virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The platform update domain for which a manual recovery walk is requested - /// - /// - /// The zone in which the manual recovery walk is requested for cross zone - /// virtual machine scale set - /// - /// - /// The placement group id for which the manual recovery walk is requested. - /// - public static RecoveryWalkResponse ForceRecoveryServiceFabricPlatformUpdateDomainWalk(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, int platformUpdateDomain, string zone = default(string), string placementGroupId = default(string)) - { - return operations.ForceRecoveryServiceFabricPlatformUpdateDomainWalkAsync(resourceGroupName, vmScaleSetName, platformUpdateDomain, zone, placementGroupId).GetAwaiter().GetResult(); - } - - /// - /// Manual platform update domain walk to update virtual machines in a service - /// fabric virtual machine scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The platform update domain for which a manual recovery walk is requested - /// - /// - /// The zone in which the manual recovery walk is requested for cross zone - /// virtual machine scale set - /// - /// - /// The placement group id for which the manual recovery walk is requested. - /// - /// - /// The cancellation token. - /// - public static async Task ForceRecoveryServiceFabricPlatformUpdateDomainWalkAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, int platformUpdateDomain, string zone = default(string), string placementGroupId = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ForceRecoveryServiceFabricPlatformUpdateDomainWalkWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, platformUpdateDomain, zone, placementGroupId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the status of a VM scale set instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - public static VirtualMachineScaleSetInstanceView GetInstanceView(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName) - { - return operations.GetInstanceViewAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); - } - - /// - /// Gets the status of a VM scale set instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The cancellation token. - /// - public static async Task GetInstanceViewAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetInstanceViewWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Upgrades one or more virtual machines to the latest SKU set in the VM scale - /// set model. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. - /// - public static void UpdateInstances(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds) - { - operations.UpdateInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Upgrades one or more virtual machines to the latest SKU set in the VM scale - /// set model. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateInstancesAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.UpdateInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets list of OS upgrades on a VM scale set instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - public static IPage GetOSUpgradeHistory(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName) - { - return operations.GetOSUpgradeHistoryAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); - } - - /// - /// Gets list of OS upgrades on a VM scale set instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The cancellation token. - /// - public static async Task> GetOSUpgradeHistoryAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetOSUpgradeHistoryWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Perform maintenance on one or more virtual machines in a VM scale set. - /// Operation on instances which are not eligible for perform maintenance will - /// be failed. Please refer to best practices for more details: - /// https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - public static void PerformMaintenance(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList)) - { - operations.PerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Perform maintenance on one or more virtual machines in a VM scale set. - /// Operation on instances which are not eligible for perform maintenance will - /// be failed. Please refer to best practices for more details: - /// https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task PerformMaintenanceAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.PerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Power off (stop) one or more virtual machines in a VM scale set. Note that - /// resources are still attached and you are getting charged for the resources. - /// Instead, use deallocate to release resources and avoid charges. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The parameter to request non-graceful VM shutdown. True value for this flag - /// indicates non-graceful shutdown whereas false indicates otherwise. Default - /// value for this flag is false if not specified - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - public static void PowerOff(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? skipShutdown = default(bool?), IList instanceIds = default(IList)) - { - operations.PowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Power off (stop) one or more virtual machines in a VM scale set. Note that - /// resources are still attached and you are getting charged for the resources. - /// Instead, use deallocate to release resources and avoid charges. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The parameter to request non-graceful VM shutdown. True value for this flag - /// indicates non-graceful shutdown whereas false indicates otherwise. Default - /// value for this flag is false if not specified - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task PowerOffAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? skipShutdown = default(bool?), IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.PowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the - /// Virtual Machine Instances - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - public static VirtualMachineScaleSetsReapplyHeaders Reapply(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName) - { - return operations.ReapplyAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); - } - - /// - /// Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the - /// Virtual Machine Instances - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The cancellation token. - /// - public static async Task ReapplyAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ReapplyWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Shuts down all the virtual machines in the virtual machine scale set, moves - /// them to a new node, and powers them back on. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - public static void Redeploy(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList)) - { - operations.RedeployAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Shuts down all the virtual machines in the virtual machine scale set, moves - /// them to a new node, and powers them back on. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task RedeployAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RedeployWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Reimages (upgrade the operating system) one or more virtual machines in a - /// VM scale set which don't have a ephemeral OS disk, for virtual machines who - /// have a ephemeral OS disk the virtual machine is reset to initial state. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// Parameters for Reimaging VM ScaleSet. - /// - public static void Reimage(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = default(VirtualMachineScaleSetReimageParameters)) - { - operations.ReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).GetAwaiter().GetResult(); - } - - /// - /// Reimages (upgrade the operating system) one or more virtual machines in a - /// VM scale set which don't have a ephemeral OS disk, for virtual machines who - /// have a ephemeral OS disk the virtual machine is reset to initial state. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// Parameters for Reimaging VM ScaleSet. - /// - /// - /// The cancellation token. - /// - public static async Task ReimageAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = default(VirtualMachineScaleSetReimageParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ReimageWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Reimages all the disks ( including data disks ) in the virtual machines in - /// a VM scale set. This operation is only supported for managed disks. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - public static void ReimageAll(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList)) - { - operations.ReimageAllAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Reimages all the disks ( including data disks ) in the virtual machines in - /// a VM scale set. This operation is only supported for managed disks. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task ReimageAllAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ReimageAllWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Restarts one or more virtual machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - public static void Restart(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList)) - { - operations.RestartAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Restarts one or more virtual machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task RestartAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RestartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Scales out one or more virtual machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The input object for ScaleOut API. - /// - public static VirtualMachineScaleSetsScaleOutHeaders ScaleOut(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VMScaleSetScaleOutInput parameters) - { - return operations.ScaleOutAsync(resourceGroupName, vmScaleSetName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Scales out one or more virtual machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The input object for ScaleOut API. - /// - /// - /// The cancellation token. - /// - public static async Task ScaleOutAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VMScaleSetScaleOutInput parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ScaleOutWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Changes ServiceState property for a given service - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The input object for SetOrchestrationServiceState API. - /// - public static void SetOrchestrationServiceState(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, OrchestrationServiceStateInput parameters) - { - operations.SetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Changes ServiceState property for a given service - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The input object for SetOrchestrationServiceState API. - /// - /// - /// The cancellation token. - /// - public static async Task SetOrchestrationServiceStateAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, OrchestrationServiceStateInput parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.SetOrchestrationServiceStateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a list of SKUs available for your VM scale set, including the minimum - /// and maximum VM instances allowed for each SKU. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - public static IPage ListSkus(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName) - { - return operations.ListSkusAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of SKUs available for your VM scale set, including the minimum - /// and maximum VM instances allowed for each SKU. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The cancellation token. - /// - public static async Task> ListSkusAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListSkusWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Starts one or more virtual machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - public static void Start(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList)) - { - operations.StartAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Starts one or more virtual machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task StartAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.StartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create or update a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The scale set object. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - public static VirtualMachineScaleSet BeginCreateOrUpdate(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSet parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); - } - - /// - /// Create or update a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The scale set object. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSet parameters, string ifMatch = default(string), string ifNoneMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The scale set object. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - public static VirtualMachineScaleSet BeginUpdate(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) - { - return operations.BeginUpdateAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); - } - - /// - /// Update a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The scale set object. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// Optional parameter to force delete a VM scale set. (Feature in Preview) - /// - public static void BeginDelete(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?)) - { - operations.BeginDeleteAsync(resourceGroupName, vmScaleSetName, forceDeletion).GetAwaiter().GetResult(); - } - - /// - /// Deletes a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// Optional parameter to force delete a VM scale set. (Feature in Preview) - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Approve upgrade on deferred rolling upgrades for OS disks in the virtual - /// machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - public static VirtualMachineScaleSetsApproveRollingUpgradeHeaders BeginApproveRollingUpgrade(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList)) - { - return operations.BeginApproveRollingUpgradeAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Approve upgrade on deferred rolling upgrades for OS disks in the virtual - /// machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task BeginApproveRollingUpgradeAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginApproveRollingUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Deallocates specific virtual machines in a VM scale set. Shuts down the - /// virtual machines and releases the compute resources. You are not billed for - /// the compute resources that this virtual machine scale set deallocates. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// Optional parameter to hibernate a virtual machine from the VM scale set. - /// (This feature is available for VMSS with Flexible OrchestrationMode only) - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - public static void BeginDeallocate(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? hibernate = default(bool?), IList instanceIds = default(IList)) - { - operations.BeginDeallocateAsync(resourceGroupName, vmScaleSetName, hibernate, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Deallocates specific virtual machines in a VM scale set. Shuts down the - /// virtual machines and releases the compute resources. You are not billed for - /// the compute resources that this virtual machine scale set deallocates. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// Optional parameter to hibernate a virtual machine from the VM scale set. - /// (This feature is available for VMSS with Flexible OrchestrationMode only) - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeallocateAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? hibernate = default(bool?), IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeallocateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, hibernate, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deletes virtual machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. - /// - /// - /// Optional parameter to force delete virtual machines from the VM scale set. - /// (Feature in Preview) - /// - public static void BeginDeleteInstances(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds, bool? forceDeletion = default(bool?)) - { - operations.BeginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds, forceDeletion).GetAwaiter().GetResult(); - } - - /// - /// Deletes virtual machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. - /// - /// - /// Optional parameter to force delete virtual machines from the VM scale set. - /// (Feature in Preview) - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteInstancesAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Upgrades one or more virtual machines to the latest SKU set in the VM scale - /// set model. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. - /// - public static void BeginUpdateInstances(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds) - { - operations.BeginUpdateInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Upgrades one or more virtual machines to the latest SKU set in the VM scale - /// set model. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateInstancesAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginUpdateInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Perform maintenance on one or more virtual machines in a VM scale set. - /// Operation on instances which are not eligible for perform maintenance will - /// be failed. Please refer to best practices for more details: - /// https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - public static void BeginPerformMaintenance(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList)) - { - operations.BeginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Perform maintenance on one or more virtual machines in a VM scale set. - /// Operation on instances which are not eligible for perform maintenance will - /// be failed. Please refer to best practices for more details: - /// https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task BeginPerformMaintenanceAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginPerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Power off (stop) one or more virtual machines in a VM scale set. Note that - /// resources are still attached and you are getting charged for the resources. - /// Instead, use deallocate to release resources and avoid charges. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The parameter to request non-graceful VM shutdown. True value for this flag - /// indicates non-graceful shutdown whereas false indicates otherwise. Default - /// value for this flag is false if not specified - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - public static void BeginPowerOff(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? skipShutdown = default(bool?), IList instanceIds = default(IList)) - { - operations.BeginPowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Power off (stop) one or more virtual machines in a VM scale set. Note that - /// resources are still attached and you are getting charged for the resources. - /// Instead, use deallocate to release resources and avoid charges. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The parameter to request non-graceful VM shutdown. True value for this flag - /// indicates non-graceful shutdown whereas false indicates otherwise. Default - /// value for this flag is false if not specified - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task BeginPowerOffAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? skipShutdown = default(bool?), IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the - /// Virtual Machine Instances - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - public static VirtualMachineScaleSetsReapplyHeaders BeginReapply(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName) - { - return operations.BeginReapplyAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); - } - - /// - /// Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the - /// Virtual Machine Instances - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The cancellation token. - /// - public static async Task BeginReapplyAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginReapplyWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Shuts down all the virtual machines in the virtual machine scale set, moves - /// them to a new node, and powers them back on. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - public static void BeginRedeploy(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList)) - { - operations.BeginRedeployAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Shuts down all the virtual machines in the virtual machine scale set, moves - /// them to a new node, and powers them back on. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRedeployAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRedeployWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Reimages (upgrade the operating system) one or more virtual machines in a - /// VM scale set which don't have a ephemeral OS disk, for virtual machines who - /// have a ephemeral OS disk the virtual machine is reset to initial state. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// Parameters for Reimaging VM ScaleSet. - /// - public static void BeginReimage(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = default(VirtualMachineScaleSetReimageParameters)) - { - operations.BeginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).GetAwaiter().GetResult(); - } - - /// - /// Reimages (upgrade the operating system) one or more virtual machines in a - /// VM scale set which don't have a ephemeral OS disk, for virtual machines who - /// have a ephemeral OS disk the virtual machine is reset to initial state. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// Parameters for Reimaging VM ScaleSet. - /// - /// - /// The cancellation token. - /// - public static async Task BeginReimageAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = default(VirtualMachineScaleSetReimageParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginReimageWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Reimages all the disks ( including data disks ) in the virtual machines in - /// a VM scale set. This operation is only supported for managed disks. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - public static void BeginReimageAll(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList)) - { - operations.BeginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Reimages all the disks ( including data disks ) in the virtual machines in - /// a VM scale set. This operation is only supported for managed disks. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task BeginReimageAllAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginReimageAllWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Restarts one or more virtual machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - public static void BeginRestart(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList)) - { - operations.BeginRestartAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Restarts one or more virtual machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRestartAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRestartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Scales out one or more virtual machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The input object for ScaleOut API. - /// - public static VirtualMachineScaleSetsScaleOutHeaders BeginScaleOut(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VMScaleSetScaleOutInput parameters) - { - return operations.BeginScaleOutAsync(resourceGroupName, vmScaleSetName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Scales out one or more virtual machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The input object for ScaleOut API. - /// - /// - /// The cancellation token. - /// - public static async Task BeginScaleOutAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VMScaleSetScaleOutInput parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginScaleOutWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Changes ServiceState property for a given service - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The input object for SetOrchestrationServiceState API. - /// - public static void BeginSetOrchestrationServiceState(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, OrchestrationServiceStateInput parameters) - { - operations.BeginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Changes ServiceState property for a given service - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The input object for SetOrchestrationServiceState API. - /// - /// - /// The cancellation token. - /// - public static async Task BeginSetOrchestrationServiceStateAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, OrchestrationServiceStateInput parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginSetOrchestrationServiceStateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Starts one or more virtual machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - public static void BeginStart(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList)) - { - operations.BeginStartAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); - } - - /// - /// Starts one or more virtual machines in a VM scale set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the VM scale set. - /// - /// - /// The virtual machine scale set instance ids. Omitting the virtual machine - /// scale set instance ids will result in the operation being performed on all - /// virtual machines in the virtual machine scale set. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStartAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, IList instanceIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets all the VM scale sets under the specified subscription for the - /// specified location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByLocationNext(this IVirtualMachineScaleSetsOperations operations, string nextPageLink) - { - return operations.ListByLocationNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the VM scale sets under the specified subscription for the - /// specified location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByLocationNextAsync(this IVirtualMachineScaleSetsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByLocationNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of all VM Scale Sets in the subscription, regardless of the - /// associated resource group. Use nextLink property in the response to get the - /// next page of VM Scale Sets. Do this till nextLink is null to fetch all the - /// VM Scale Sets. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this IVirtualMachineScaleSetsOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all VM Scale Sets in the subscription, regardless of the - /// associated resource group. Use nextLink property in the response to get the - /// next page of VM Scale Sets. Do this till nextLink is null to fetch all the - /// VM Scale Sets. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this IVirtualMachineScaleSetsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of all VM scale sets under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualMachineScaleSetsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of all VM scale sets under a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualMachineScaleSetsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets list of OS upgrades on a VM scale set instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetOSUpgradeHistoryNext(this IVirtualMachineScaleSetsOperations operations, string nextPageLink) - { - return operations.GetOSUpgradeHistoryNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets list of OS upgrades on a VM scale set instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetOSUpgradeHistoryNextAsync(this IVirtualMachineScaleSetsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetOSUpgradeHistoryNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of SKUs available for your VM scale set, including the minimum - /// and maximum VM instances allowed for each SKU. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListSkusNext(this IVirtualMachineScaleSetsOperations operations, string nextPageLink) - { - return operations.ListSkusNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of SKUs available for your VM scale set, including the minimum - /// and maximum VM instances allowed for each SKU. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListSkusNextAsync(this IVirtualMachineScaleSetsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListSkusNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// Gets all the VM scale sets under the specified subscription for the + /// specified location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + public static Microsoft.Rest.Azure.IPage ListByLocation(this IVirtualMachineScaleSetsOperations operations, string location) + { + return ((IVirtualMachineScaleSetsOperations)operations).ListByLocationAsync(location).GetAwaiter().GetResult(); + } + + /// + /// Gets all the VM scale sets under the specified subscription for the + /// specified location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByLocationAsync(this IVirtualMachineScaleSetsOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByLocationWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a list of all VM Scale Sets in the subscription, regardless of the + /// associated resource group. Use nextLink property in the response to get the + /// next page of VM Scale Sets. Do this till nextLink is null to fetch all the + /// VM Scale Sets. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListAll(this IVirtualMachineScaleSetsOperations operations) + { + return ((IVirtualMachineScaleSetsOperations)operations).ListAllAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all VM Scale Sets in the subscription, regardless of the + /// associated resource group. Use nextLink property in the response to get the + /// next page of VM Scale Sets. Do this till nextLink is null to fetch all the + /// VM Scale Sets. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this IVirtualMachineScaleSetsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a list of all VM scale sets under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName) + { + return ((IVirtualMachineScaleSetsOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all VM scale sets under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Display information about a virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The expand expression to apply on the operation. 'UserData' retrieves the + /// UserData property of the VM scale set that was provided by the user during + /// the VM scale set Create/Update operation + /// + public static VirtualMachineScaleSet Get(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, string expand = default(string)) + { + return ((IVirtualMachineScaleSetsOperations)operations).GetAsync(resourceGroupName, vmScaleSetName, expand).GetAwaiter().GetResult(); + } + + /// + /// Display information about a virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The expand expression to apply on the operation. 'UserData' retrieves the + /// UserData property of the VM scale set that was provided by the user during + /// the VM scale set Create/Update operation + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Create or update a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + public static VirtualMachineScaleSet CreateOrUpdate(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSet parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) + { + return ((IVirtualMachineScaleSetsOperations)operations).CreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); + } + + /// + /// Create or update a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSet parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Update a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + public static VirtualMachineScaleSet Update(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) + { + return ((IVirtualMachineScaleSetsOperations)operations).UpdateAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); + } + + /// + /// Update a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// Optional parameter to force delete a VM scale set. (Feature in Preview) + /// + public static void Delete(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?)) + { + ((IVirtualMachineScaleSetsOperations)operations).DeleteAsync(resourceGroupName, vmScaleSetName, forceDeletion).GetAwaiter().GetResult(); + } + + /// + /// Deletes a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// Optional parameter to force delete a VM scale set. (Feature in Preview) + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Approve upgrade on deferred rolling upgrades for OS disks in the virtual + /// machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static VirtualMachineScaleSetsApproveRollingUpgradeHeaders ApproveRollingUpgrade(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList)) + { + return ((IVirtualMachineScaleSetsOperations)operations).ApproveRollingUpgradeAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + } + + /// + /// Approve upgrade on deferred rolling upgrades for OS disks in the virtual + /// machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ApproveRollingUpgradeAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ApproveRollingUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Converts SinglePlacementGroup property to false for a existing virtual + /// machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void ConvertToSinglePlacementGroup(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, string activePlacementGroupId = default(string)) + { + ((IVirtualMachineScaleSetsOperations)operations).ConvertToSinglePlacementGroupAsync(resourceGroupName, vmScaleSetName, activePlacementGroupId).GetAwaiter().GetResult(); + } + + /// + /// Converts SinglePlacementGroup property to false for a existing virtual + /// machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ConvertToSinglePlacementGroupAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, string activePlacementGroupId = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ConvertToSinglePlacementGroupWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, activePlacementGroupId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Deallocates specific virtual machines in a VM scale set. Shuts down the + /// virtual machines and releases the compute resources. You are not billed for + /// the compute resources that this virtual machine scale set deallocates. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// Optional parameter to hibernate a virtual machine from the VM scale set. + /// (This feature is available for VMSS with Flexible OrchestrationMode only) + /// + public static void Deallocate(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), bool? hibernate = default(bool?)) + { + ((IVirtualMachineScaleSetsOperations)operations).DeallocateAsync(resourceGroupName, vmScaleSetName, instanceIds, hibernate).GetAwaiter().GetResult(); + } + + /// + /// Deallocates specific virtual machines in a VM scale set. Shuts down the + /// virtual machines and releases the compute resources. You are not billed for + /// the compute resources that this virtual machine scale set deallocates. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// Optional parameter to hibernate a virtual machine from the VM scale set. + /// (This feature is available for VMSS with Flexible OrchestrationMode only) + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeallocateAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), bool? hibernate = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeallocateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, hibernate, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Deletes virtual machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// Optional parameter to force delete virtual machines from the VM scale set. + /// (Feature in Preview) + /// + public static void DeleteInstances(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds, bool? forceDeletion = default(bool?)) + { + ((IVirtualMachineScaleSetsOperations)operations).DeleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds, forceDeletion).GetAwaiter().GetResult(); + } + + /// + /// Deletes virtual machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// Optional parameter to force delete virtual machines from the VM scale set. + /// (Feature in Preview) + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteInstancesAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds, bool? forceDeletion = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Manual platform update domain walk to update virtual machines in a service + /// fabric virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The platform update domain for which a manual recovery walk is requested + /// + /// + /// The zone in which the manual recovery walk is requested for cross zone + /// virtual machine scale set + /// + /// + /// The placement group id for which the manual recovery walk is requested. + /// + public static RecoveryWalkResponse ForceRecoveryServiceFabricPlatformUpdateDomainWalk(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, int platformUpdateDomain, string zone = default(string), string placementGroupId = default(string)) + { + return ((IVirtualMachineScaleSetsOperations)operations).ForceRecoveryServiceFabricPlatformUpdateDomainWalkAsync(resourceGroupName, vmScaleSetName, platformUpdateDomain, zone, placementGroupId).GetAwaiter().GetResult(); + } + + /// + /// Manual platform update domain walk to update virtual machines in a service + /// fabric virtual machine scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The platform update domain for which a manual recovery walk is requested + /// + /// + /// The zone in which the manual recovery walk is requested for cross zone + /// virtual machine scale set + /// + /// + /// The placement group id for which the manual recovery walk is requested. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ForceRecoveryServiceFabricPlatformUpdateDomainWalkAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, int platformUpdateDomain, string zone = default(string), string placementGroupId = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ForceRecoveryServiceFabricPlatformUpdateDomainWalkWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, platformUpdateDomain, zone, placementGroupId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the status of a VM scale set instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static VirtualMachineScaleSetInstanceView GetInstanceView(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName) + { + return ((IVirtualMachineScaleSetsOperations)operations).GetInstanceViewAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); + } + + /// + /// Gets the status of a VM scale set instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetInstanceViewAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetInstanceViewWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Upgrades one or more virtual machines to the latest SKU set in the VM scale + /// set model. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void UpdateInstances(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds) + { + ((IVirtualMachineScaleSetsOperations)operations).UpdateInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + } + + /// + /// Upgrades one or more virtual machines to the latest SKU set in the VM scale + /// set model. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateInstancesAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.UpdateInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets list of OS upgrades on a VM scale set instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static Microsoft.Rest.Azure.IPage GetOSUpgradeHistory(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName) + { + return ((IVirtualMachineScaleSetsOperations)operations).GetOSUpgradeHistoryAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); + } + + /// + /// Gets list of OS upgrades on a VM scale set instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> GetOSUpgradeHistoryAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetOSUpgradeHistoryWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Perform maintenance on one or more virtual machines in a VM scale set. + /// Operation on instances which are not eligible for perform maintenance will + /// be failed. Please refer to best practices for more details: + /// https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void PerformMaintenance(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList)) + { + ((IVirtualMachineScaleSetsOperations)operations).PerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + } + + /// + /// Perform maintenance on one or more virtual machines in a VM scale set. + /// Operation on instances which are not eligible for perform maintenance will + /// be failed. Please refer to best practices for more details: + /// https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task PerformMaintenanceAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.PerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Power off (stop) one or more virtual machines in a VM scale set. Note that + /// resources are still attached and you are getting charged for the resources. + /// Instead, use deallocate to release resources and avoid charges. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// + public static void PowerOff(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), bool? skipShutdown = default(bool?)) + { + ((IVirtualMachineScaleSetsOperations)operations).PowerOffAsync(resourceGroupName, vmScaleSetName, instanceIds, skipShutdown).GetAwaiter().GetResult(); + } + + /// + /// Power off (stop) one or more virtual machines in a VM scale set. Note that + /// resources are still attached and you are getting charged for the resources. + /// Instead, use deallocate to release resources and avoid charges. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task PowerOffAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), bool? skipShutdown = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.PowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, skipShutdown, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the + /// Virtual Machine Instances + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static VirtualMachineScaleSetsReapplyHeaders Reapply(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName) + { + return ((IVirtualMachineScaleSetsOperations)operations).ReapplyAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); + } + + /// + /// Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the + /// Virtual Machine Instances + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ReapplyAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ReapplyWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Shuts down all the virtual machines in the virtual machine scale set, moves + /// them to a new node, and powers them back on. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void Redeploy(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList)) + { + ((IVirtualMachineScaleSetsOperations)operations).RedeployAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + } + + /// + /// Shuts down all the virtual machines in the virtual machine scale set, moves + /// them to a new node, and powers them back on. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RedeployAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.RedeployWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Reimages (upgrade the operating system) one or more virtual machines in a + /// VM scale set which don't have a ephemeral OS disk, for virtual machines who + /// have a ephemeral OS disk the virtual machine is reset to initial state. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void Reimage(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = default(VirtualMachineScaleSetReimageParameters)) + { + ((IVirtualMachineScaleSetsOperations)operations).ReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).GetAwaiter().GetResult(); + } + + /// + /// Reimages (upgrade the operating system) one or more virtual machines in a + /// VM scale set which don't have a ephemeral OS disk, for virtual machines who + /// have a ephemeral OS disk the virtual machine is reset to initial state. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ReimageAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = default(VirtualMachineScaleSetReimageParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ReimageWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Reimages all the disks ( including data disks ) in the virtual machines in + /// a VM scale set. This operation is only supported for managed disks. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void ReimageAll(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList)) + { + ((IVirtualMachineScaleSetsOperations)operations).ReimageAllAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + } + + /// + /// Reimages all the disks ( including data disks ) in the virtual machines in + /// a VM scale set. This operation is only supported for managed disks. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ReimageAllAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ReimageAllWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Restarts one or more virtual machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void Restart(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList)) + { + ((IVirtualMachineScaleSetsOperations)operations).RestartAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + } + + /// + /// Restarts one or more virtual machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RestartAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.RestartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Scales out one or more virtual machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static VirtualMachineScaleSetsScaleOutHeaders ScaleOut(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VMScaleSetScaleOutInput parameters) + { + return ((IVirtualMachineScaleSetsOperations)operations).ScaleOutAsync(resourceGroupName, vmScaleSetName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Scales out one or more virtual machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ScaleOutAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VMScaleSetScaleOutInput parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ScaleOutWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Changes ServiceState property for a given service + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void SetOrchestrationServiceState(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, OrchestrationServiceStateInput parameters) + { + ((IVirtualMachineScaleSetsOperations)operations).SetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Changes ServiceState property for a given service + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task SetOrchestrationServiceStateAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, OrchestrationServiceStateInput parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.SetOrchestrationServiceStateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets a list of SKUs available for your VM scale set, including the minimum + /// and maximum VM instances allowed for each SKU. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static Microsoft.Rest.Azure.IPage ListSkus(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName) + { + return ((IVirtualMachineScaleSetsOperations)operations).ListSkusAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of SKUs available for your VM scale set, including the minimum + /// and maximum VM instances allowed for each SKU. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListSkusAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListSkusWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Starts one or more virtual machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void Start(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList)) + { + ((IVirtualMachineScaleSetsOperations)operations).StartAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + } + + /// + /// Starts one or more virtual machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StartAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.StartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create or update a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + public static VirtualMachineScaleSet BeginCreateOrUpdate(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSet parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) + { + return ((IVirtualMachineScaleSetsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); + } + + /// + /// Create or update a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSet parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Update a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + public static VirtualMachineScaleSet BeginUpdate(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) + { + return ((IVirtualMachineScaleSetsOperations)operations).BeginUpdateAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); + } + + /// + /// Update a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// Optional parameter to force delete a VM scale set. (Feature in Preview) + /// + public static void BeginDelete(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?)) + { + ((IVirtualMachineScaleSetsOperations)operations).BeginDeleteAsync(resourceGroupName, vmScaleSetName, forceDeletion).GetAwaiter().GetResult(); + } + + /// + /// Deletes a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// Optional parameter to force delete a VM scale set. (Feature in Preview) + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, bool? forceDeletion = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Approve upgrade on deferred rolling upgrades for OS disks in the virtual + /// machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static VirtualMachineScaleSetsApproveRollingUpgradeHeaders BeginApproveRollingUpgrade(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList)) + { + return ((IVirtualMachineScaleSetsOperations)operations).BeginApproveRollingUpgradeAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + } + + /// + /// Approve upgrade on deferred rolling upgrades for OS disks in the virtual + /// machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginApproveRollingUpgradeAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginApproveRollingUpgradeWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Deallocates specific virtual machines in a VM scale set. Shuts down the + /// virtual machines and releases the compute resources. You are not billed for + /// the compute resources that this virtual machine scale set deallocates. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// Optional parameter to hibernate a virtual machine from the VM scale set. + /// (This feature is available for VMSS with Flexible OrchestrationMode only) + /// + public static void BeginDeallocate(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), bool? hibernate = default(bool?)) + { + ((IVirtualMachineScaleSetsOperations)operations).BeginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceIds, hibernate).GetAwaiter().GetResult(); + } + + /// + /// Deallocates specific virtual machines in a VM scale set. Shuts down the + /// virtual machines and releases the compute resources. You are not billed for + /// the compute resources that this virtual machine scale set deallocates. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// Optional parameter to hibernate a virtual machine from the VM scale set. + /// (This feature is available for VMSS with Flexible OrchestrationMode only) + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeallocateAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), bool? hibernate = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeallocateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, hibernate, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Deletes virtual machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// Optional parameter to force delete virtual machines from the VM scale set. + /// (Feature in Preview) + /// + public static void BeginDeleteInstances(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds, bool? forceDeletion = default(bool?)) + { + ((IVirtualMachineScaleSetsOperations)operations).BeginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds, forceDeletion).GetAwaiter().GetResult(); + } + + /// + /// Deletes virtual machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// Optional parameter to force delete virtual machines from the VM scale set. + /// (Feature in Preview) + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteInstancesAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds, bool? forceDeletion = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Upgrades one or more virtual machines to the latest SKU set in the VM scale + /// set model. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void BeginUpdateInstances(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds) + { + ((IVirtualMachineScaleSetsOperations)operations).BeginUpdateInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + } + + /// + /// Upgrades one or more virtual machines to the latest SKU set in the VM scale + /// set model. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateInstancesAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginUpdateInstancesWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Perform maintenance on one or more virtual machines in a VM scale set. + /// Operation on instances which are not eligible for perform maintenance will + /// be failed. Please refer to best practices for more details: + /// https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void BeginPerformMaintenance(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList)) + { + ((IVirtualMachineScaleSetsOperations)operations).BeginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + } + + /// + /// Perform maintenance on one or more virtual machines in a VM scale set. + /// Operation on instances which are not eligible for perform maintenance will + /// be failed. Please refer to best practices for more details: + /// https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginPerformMaintenanceAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginPerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Power off (stop) one or more virtual machines in a VM scale set. Note that + /// resources are still attached and you are getting charged for the resources. + /// Instead, use deallocate to release resources and avoid charges. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// + public static void BeginPowerOff(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), bool? skipShutdown = default(bool?)) + { + ((IVirtualMachineScaleSetsOperations)operations).BeginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceIds, skipShutdown).GetAwaiter().GetResult(); + } + + /// + /// Power off (stop) one or more virtual machines in a VM scale set. Note that + /// resources are still attached and you are getting charged for the resources. + /// Instead, use deallocate to release resources and avoid charges. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginPowerOffAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), bool? skipShutdown = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, skipShutdown, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the + /// Virtual Machine Instances + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static VirtualMachineScaleSetsReapplyHeaders BeginReapply(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName) + { + return ((IVirtualMachineScaleSetsOperations)operations).BeginReapplyAsync(resourceGroupName, vmScaleSetName).GetAwaiter().GetResult(); + } + + /// + /// Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the + /// Virtual Machine Instances + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginReapplyAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginReapplyWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Shuts down all the virtual machines in the virtual machine scale set, moves + /// them to a new node, and powers them back on. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void BeginRedeploy(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList)) + { + ((IVirtualMachineScaleSetsOperations)operations).BeginRedeployAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + } + + /// + /// Shuts down all the virtual machines in the virtual machine scale set, moves + /// them to a new node, and powers them back on. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRedeployAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginRedeployWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Reimages (upgrade the operating system) one or more virtual machines in a + /// VM scale set which don't have a ephemeral OS disk, for virtual machines who + /// have a ephemeral OS disk the virtual machine is reset to initial state. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void BeginReimage(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = default(VirtualMachineScaleSetReimageParameters)) + { + ((IVirtualMachineScaleSetsOperations)operations).BeginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).GetAwaiter().GetResult(); + } + + /// + /// Reimages (upgrade the operating system) one or more virtual machines in a + /// VM scale set which don't have a ephemeral OS disk, for virtual machines who + /// have a ephemeral OS disk the virtual machine is reset to initial state. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginReimageAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = default(VirtualMachineScaleSetReimageParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginReimageWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Reimages all the disks ( including data disks ) in the virtual machines in + /// a VM scale set. This operation is only supported for managed disks. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void BeginReimageAll(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList)) + { + ((IVirtualMachineScaleSetsOperations)operations).BeginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + } + + /// + /// Reimages all the disks ( including data disks ) in the virtual machines in + /// a VM scale set. This operation is only supported for managed disks. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginReimageAllAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginReimageAllWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Restarts one or more virtual machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void BeginRestart(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList)) + { + ((IVirtualMachineScaleSetsOperations)operations).BeginRestartAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + } + + /// + /// Restarts one or more virtual machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRestartAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginRestartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Scales out one or more virtual machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static VirtualMachineScaleSetsScaleOutHeaders BeginScaleOut(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VMScaleSetScaleOutInput parameters) + { + return ((IVirtualMachineScaleSetsOperations)operations).BeginScaleOutAsync(resourceGroupName, vmScaleSetName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Scales out one or more virtual machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginScaleOutAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, VMScaleSetScaleOutInput parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginScaleOutWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Changes ServiceState property for a given service + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void BeginSetOrchestrationServiceState(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, OrchestrationServiceStateInput parameters) + { + ((IVirtualMachineScaleSetsOperations)operations).BeginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Changes ServiceState property for a given service + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginSetOrchestrationServiceStateAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, OrchestrationServiceStateInput parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginSetOrchestrationServiceStateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Starts one or more virtual machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + public static void BeginStart(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList)) + { + ((IVirtualMachineScaleSetsOperations)operations).BeginStartAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + } + + /// + /// Starts one or more virtual machines in a VM scale set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VM scale set. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStartAsync(this IVirtualMachineScaleSetsOperations operations, string resourceGroupName, string vmScaleSetName, System.Collections.Generic.IList instanceIds = default(System.Collections.Generic.IList), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets all the VM scale sets under the specified subscription for the + /// specified location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByLocationNext(this IVirtualMachineScaleSetsOperations operations, string nextPageLink) + { + return ((IVirtualMachineScaleSetsOperations)operations).ListByLocationNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the VM scale sets under the specified subscription for the + /// specified location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByLocationNextAsync(this IVirtualMachineScaleSetsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByLocationNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a list of all VM Scale Sets in the subscription, regardless of the + /// associated resource group. Use nextLink property in the response to get the + /// next page of VM Scale Sets. Do this till nextLink is null to fetch all the + /// VM Scale Sets. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this IVirtualMachineScaleSetsOperations operations, string nextPageLink) + { + return ((IVirtualMachineScaleSetsOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all VM Scale Sets in the subscription, regardless of the + /// associated resource group. Use nextLink property in the response to get the + /// next page of VM Scale Sets. Do this till nextLink is null to fetch all the + /// VM Scale Sets. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this IVirtualMachineScaleSetsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a list of all VM scale sets under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualMachineScaleSetsOperations operations, string nextPageLink) + { + return ((IVirtualMachineScaleSetsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all VM scale sets under a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualMachineScaleSetsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets list of OS upgrades on a VM scale set instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage GetOSUpgradeHistoryNext(this IVirtualMachineScaleSetsOperations operations, string nextPageLink) + { + return ((IVirtualMachineScaleSetsOperations)operations).GetOSUpgradeHistoryNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets list of OS upgrades on a VM scale set instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> GetOSUpgradeHistoryNextAsync(this IVirtualMachineScaleSetsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetOSUpgradeHistoryNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets a list of SKUs available for your VM scale set, including the minimum + /// and maximum VM instances allowed for each SKU. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListSkusNext(this IVirtualMachineScaleSetsOperations operations, string nextPageLink) + { + return ((IVirtualMachineScaleSetsOperations)operations).ListSkusNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of SKUs available for your VM scale set, including the minimum + /// and maximum VM instances allowed for each SKU. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListSkusNextAsync(this IVirtualMachineScaleSetsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListSkusNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineSizesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineSizesOperations.cs index da7c33320c66..5696784665b1 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineSizesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineSizesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachineSizesOperations operations. /// - internal partial class VirtualMachineSizesOperations : IServiceOperations, IVirtualMachineSizesOperations + internal partial class VirtualMachineSizesOperations : Microsoft.Rest.IServiceOperations, IVirtualMachineSizesOperations { /// /// Initializes a new instance of the VirtualMachineSizesOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualMachineSizesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualMachineSizesOperations(ComputeManagementClient client) + internal VirtualMachineSizesOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,13 +51,13 @@ internal VirtualMachineSizesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -78,42 +66,51 @@ internal VirtualMachineSizesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -123,25 +120,24 @@ internal VirtualMachineSizesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -153,55 +149,56 @@ internal VirtualMachineSizesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -211,9 +208,10 @@ internal VirtualMachineSizesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -224,24 +222,28 @@ internal VirtualMachineSizesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineSizesOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineSizesOperationsExtensions.cs index a1d5601818a8..55f0c6ea38ef 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineSizesOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachineSizesOperationsExtensions.cs @@ -1,63 +1,51 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualMachineSizesOperations. + /// Extension methods for VirtualMachineSizesOperations /// public static partial class VirtualMachineSizesOperationsExtensions { - /// - /// This API is deprecated. Use [Resources - /// Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - public static IEnumerable List(this IVirtualMachineSizesOperations operations, string location) - { - return operations.ListAsync(location).GetAwaiter().GetResult(); - } + /// + /// This API is deprecated. Use [Resources + /// Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + public static System.Collections.Generic.IEnumerable List(this IVirtualMachineSizesOperations operations, string location) + { + return ((IVirtualMachineSizesOperations)operations).ListAsync(location).GetAwaiter().GetResult(); + } - /// - /// This API is deprecated. Use [Resources - /// Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualMachineSizesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// This API is deprecated. Use [Resources + /// Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualMachineSizesOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachinesOperations.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachinesOperations.cs index 2f20d71b17ba..981a1a851746 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachinesOperations.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachinesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// VirtualMachinesOperations operations. /// - internal partial class VirtualMachinesOperations : IServiceOperations, IVirtualMachinesOperations + internal partial class VirtualMachinesOperations : Microsoft.Rest.IServiceOperations, IVirtualMachinesOperations { /// /// Initializes a new instance of the VirtualMachinesOperations class. @@ -36,13 +24,13 @@ internal partial class VirtualMachinesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VirtualMachinesOperations(ComputeManagementClient client) + internal VirtualMachinesOperations (ComputeManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -63,13 +51,13 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -78,42 +66,51 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByLocationWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByLocationWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByLocation", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByLocation", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -123,25 +120,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -153,55 +149,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -211,9 +208,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -224,25 +222,29 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the virtual machines in the specified subscription. Use the /// nextLink property in the response to get the next page of virtual machines. @@ -253,14 +255,13 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// /// The system query option to filter VMs returned in the response. Allowed - /// value is 'virtualMachineScaleSet/id' eq - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' + /// value is 'virtualMachineScaleSet/id' eq + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' /// /// - /// The expand expression to apply on operation. 'instanceView' enables + /// The expand expression to apply on operation. 'instanceView' enables /// fetching run time status of all Virtual Machines, this can only be - /// specified if a valid $filter option is specified. Possible values include: - /// 'instanceView' + /// specified if a valid $filter option is specified /// /// /// Headers that will be added to request. @@ -268,13 +269,13 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -283,32 +284,44 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(string statusOnly = default(string), string filter = default(string), string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllWithHttpMessagesAsync(string statusOnly = default(string), string filter = default(string), string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + + + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("statusOnly", statusOnly); tracingParameters.Add("filter", filter); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -330,25 +343,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -360,55 +372,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -418,9 +431,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -431,25 +445,29 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the virtual machines in the specified resource group. Use the /// nextLink property in the response to get the next page of virtual machines. @@ -459,14 +477,13 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// /// The system query option to filter VMs returned in the response. Allowed - /// value is 'virtualMachineScaleSet/id' eq - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' + /// value is 'virtualMachineScaleSet/id' eq + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' /// /// - /// The expand expression to apply on operation. 'instanceView' enables + /// The expand expression to apply on operation. 'instanceView' enables /// fetching run time status of all Virtual Machines, this can only be - /// specified if a valid $filter option is specified. Possible values include: - /// 'instanceView' + /// specified if a valid $filter option is specified /// /// /// Headers that will be added to request. @@ -474,13 +491,13 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -489,48 +506,59 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string filter = default(string), string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string filter = default(string), string expand = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("filter", filter); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -548,25 +576,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -578,55 +605,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -636,9 +664,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -649,25 +678,29 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Retrieves information about the model view or the instance view of a /// virtual machine. @@ -679,12 +712,11 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// The name of the virtual machine. /// /// - /// The expand expression to apply on the operation. 'InstanceView' retrieves a + /// The expand expression to apply on the operation. 'InstanceView' retrieves a /// snapshot of the runtime properties of the virtual machine that is managed /// by the platform and can change outside of control plane operations. - /// 'UserData' retrieves the UserData property as part of the VM model view + /// 'UserData' retrieves the UserData property as part of the VM model view /// that was provided by the user during the VM Create/Update operation. - /// Possible values include: 'instanceView', 'userData', 'resiliencyView' /// /// /// Headers that will be added to request. @@ -692,13 +724,13 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -707,85 +739,95 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmName, InstanceViewTypes? expand = default(InstanceViewTypes?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmName, InstanceViewTypes? expand = default(InstanceViewTypes?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); tracingParameters.Add("expand", expand); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (expand != null) { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(expand, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expand, this.Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -797,55 +839,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -855,9 +898,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -868,25 +912,29 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to create or update a virtual machine. Please note some /// properties can be set only during virtual machine creation. @@ -897,30 +945,30 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The name of the virtual machine. /// - /// - /// Parameters supplied to the Create Virtual Machine operation. - /// /// /// The ETag of the transformation. Omit this value to always overwrite the /// current resource. Specify the last-seen ETag value to prevent accidentally /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent updating + /// Set to '*' to allow a new record set to be created, but to prevent updating /// an existing record set. Other values will result in error from server as /// they are not supported. /// + /// + /// Parameters supplied to the Create Virtual Machine operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachine parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachine parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -932,30 +980,30 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The name of the virtual machine. /// - /// - /// Parameters supplied to the Update Virtual Machine operation. - /// /// /// The ETag of the transformation. Omit this value to always overwrite the /// current resource. Specify the last-seen ETag value to prevent accidentally /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent updating + /// Set to '*' to allow a new record set to be created, but to prevent updating /// an existing record set. Other values will result in error from server as /// they are not supported. /// + /// + /// Parameters supplied to the Update Virtual Machine operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -971,16 +1019,16 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// Optional parameter to force delete virtual machines. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmName, forceDeletion, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmName, forceDeletion, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -993,16 +1041,16 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// The name of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> AssessPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> AssessPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginAssessPatchesWithHttpMessagesAsync(resourceGroupName, vmName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginAssessPatchesWithHttpMessagesAsync(resourceGroupName, vmName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1019,16 +1067,16 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> AttachDetachDataDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, AttachDetachDataDisksRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> AttachDetachDataDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, AttachDetachDataDisksRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginAttachDetachDataDisksWithHttpMessagesAsync(resourceGroupName, vmName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginAttachDetachDataDisksWithHttpMessagesAsync(resourceGroupName, vmName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1045,16 +1093,16 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// Parameters supplied to the Capture Virtual Machine operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CaptureWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CaptureWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginCaptureWithHttpMessagesAsync(resourceGroupName, vmName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCaptureWithHttpMessagesAsync(resourceGroupName, vmName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1068,16 +1116,16 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// The name of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ConvertToManagedDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ConvertToManagedDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginConvertToManagedDisksWithHttpMessagesAsync(resourceGroupName, vmName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginConvertToManagedDisksWithHttpMessagesAsync(resourceGroupName, vmName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1094,16 +1142,16 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// Optional parameter to hibernate a virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeallocateWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? hibernate = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeallocateWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? hibernate = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeallocateWithHttpMessagesAsync(resourceGroupName, vmName, hibernate, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeallocateWithHttpMessagesAsync(resourceGroupName, vmName, hibernate, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1126,10 +1174,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1138,52 +1186,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task GeneralizeWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task GeneralizeWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Generalize", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Generalize", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1193,25 +1251,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1223,55 +1280,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1281,20 +1339,25 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Installs patches on the VM. /// @@ -1308,16 +1371,16 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// Input for InstallPatches as directly received by the API /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> InstallPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> InstallPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginInstallPatchesWithHttpMessagesAsync(resourceGroupName, vmName, installPatchesInput, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginInstallPatchesWithHttpMessagesAsync(resourceGroupName, vmName, installPatchesInput, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1335,13 +1398,13 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1350,52 +1413,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> InstanceViewWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> InstanceViewWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "InstanceView", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "InstanceView", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1405,25 +1478,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1435,55 +1507,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1493,9 +1566,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1506,25 +1580,29 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Migrate a virtual machine from availability set to Flexible Virtual Machine /// Scale Set. @@ -1539,16 +1617,16 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// Parameters supplied to the Migrate Virtual Machine operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task MigrateToVMScaleSetWithHttpMessagesAsync(string resourceGroupName, string vmName, MigrateVMToVirtualMachineScaleSetInput parameters = default(MigrateVMToVirtualMachineScaleSetInput), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task MigrateToVMScaleSetWithHttpMessagesAsync(string resourceGroupName, string vmName, MigrateVMToVirtualMachineScaleSetInput parameters = default(MigrateVMToVirtualMachineScaleSetInput), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginMigrateToVMScaleSetWithHttpMessagesAsync(resourceGroupName, vmName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateToVMScaleSetWithHttpMessagesAsync(resourceGroupName, vmName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1561,16 +1639,16 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// The name of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task PerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task PerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginPerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginPerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1590,20 +1668,20 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// value for this flag is false if not specified /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? skipShutdown = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? skipShutdown = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmName, skipShutdown, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmName, skipShutdown, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// The operation to reapply a virtual machine's state. + /// The operation to reapply a virtual machine's state. /// /// /// The name of the resource group. The name is case insensitive. @@ -1612,16 +1690,16 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// The name of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ReapplyWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ReapplyWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginReapplyWithHttpMessagesAsync(resourceGroupName, vmName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginReapplyWithHttpMessagesAsync(resourceGroupName, vmName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1635,20 +1713,20 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// The name of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task RedeployWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task RedeployWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRedeployWithHttpMessagesAsync(resourceGroupName, vmName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRedeployWithHttpMessagesAsync(resourceGroupName, vmName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Reimages (upgrade the operating system) a virtual machine which don't have + /// Reimages (upgrade the operating system) a virtual machine which don't have /// a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the /// virtual machine is reset to initial state. NOTE: The retaining of old OS /// disk depends on the value of deleteOption of OS disk. If deleteOption is @@ -1666,16 +1744,16 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// Parameters supplied to the Reimage Virtual Machine operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ReimageWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ReimageWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginReimageWithHttpMessagesAsync(resourceGroupName, vmName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginReimageWithHttpMessagesAsync(resourceGroupName, vmName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1688,20 +1766,20 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// The name of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task RestartWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task RestartWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRestartWithHttpMessagesAsync(resourceGroupName, vmName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRestartWithHttpMessagesAsync(resourceGroupName, vmName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// The operation to retrieve SAS URIs for a virtual machine's boot diagnostic + /// The operation to retrieve SAS URIs for a virtual machine's boot diagnostic /// logs. /// /// @@ -1721,13 +1799,13 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1736,85 +1814,95 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> RetrieveBootDiagnosticsDataWithHttpMessagesAsync(string resourceGroupName, string vmName, int? sasUriExpirationTimeInMinutes = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> RetrieveBootDiagnosticsDataWithHttpMessagesAsync(string resourceGroupName, string vmName, int? sasUriExpirationTimeInMinutes = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); tracingParameters.Add("sasUriExpirationTimeInMinutes", sasUriExpirationTimeInMinutes); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RetrieveBootDiagnosticsData", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "RetrieveBootDiagnosticsData", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/retrieveBootDiagnosticsData").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (sasUriExpirationTimeInMinutes != null) { - _queryParameters.Add(string.Format("sasUriExpirationTimeInMinutes={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(sasUriExpirationTimeInMinutes, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("sasUriExpirationTimeInMinutes={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(sasUriExpirationTimeInMinutes, this.Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1826,55 +1914,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1884,9 +1973,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1897,25 +1987,29 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Run command on the VM. /// @@ -1929,16 +2023,16 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// Parameters supplied to the Run command operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> RunCommandWithHttpMessagesAsync(string resourceGroupName, string vmName, RunCommandInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> RunCommandWithHttpMessagesAsync(string resourceGroupName, string vmName, RunCommandInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRunCommandWithHttpMessagesAsync(resourceGroupName, vmName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRunCommandWithHttpMessagesAsync(resourceGroupName, vmName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -1956,10 +2050,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1968,52 +2062,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SimulateEvictionWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task SimulateEvictionWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SimulateEviction", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "SimulateEviction", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/simulateEviction").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2023,25 +2127,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2053,55 +2156,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2111,20 +2215,25 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to start a virtual machine. /// @@ -2135,16 +2244,16 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// The name of the virtual machine. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task StartWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, vmName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, vmName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -2163,13 +2272,13 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2178,52 +2287,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAvailableSizesWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAvailableSizesWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAvailableSizes", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAvailableSizes", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2233,25 +2352,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2263,55 +2381,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2321,9 +2440,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2334,25 +2454,29 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to create or update a virtual machine. Please note some /// properties can be set only during virtual machine creation. @@ -2363,32 +2487,32 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The name of the virtual machine. /// - /// - /// Parameters supplied to the Create Virtual Machine operation. - /// /// /// The ETag of the transformation. Omit this value to always overwrite the /// current resource. Specify the last-seen ETag value to prevent accidentally /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent updating + /// Set to '*' to allow a new record set to be created, but to prevent updating /// an existing record set. Other values will result in error from server as /// they are not supported. /// + /// + /// Parameters supplied to the Create Virtual Machine operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2397,63 +2521,75 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachine parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachine parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("ifNoneMatch", ifNoneMatch); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2463,15 +2599,23 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + } if (ifMatch != null) { if (_httpRequest.Headers.Contains("If-Match")) @@ -2488,15 +2632,6 @@ internal VirtualMachinesOperations(ComputeManagementClient client) } _httpRequest.Headers.TryAddWithoutValidation("If-None-Match", ifNoneMatch); } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - if (customHeaders != null) { @@ -2509,61 +2644,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2573,9 +2709,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2586,16 +2723,16 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -2604,38 +2741,42 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to update a virtual machine. /// @@ -2645,32 +2786,32 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The name of the virtual machine. /// - /// - /// Parameters supplied to the Update Virtual Machine operation. - /// /// /// The ETag of the transformation. Omit this value to always overwrite the /// current resource. Specify the last-seen ETag value to prevent accidentally /// overwriting concurrent changes. /// /// - /// Set to '*' to allow a new record set to be created, but to prevent updating + /// Set to '*' to allow a new record set to be created, but to prevent updating /// an existing record set. Other values will result in error from server as /// they are not supported. /// + /// + /// Parameters supplied to the Update Virtual Machine operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2679,59 +2820,71 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("ifNoneMatch", ifNoneMatch); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -2741,15 +2894,23 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + } if (ifMatch != null) { if (_httpRequest.Headers.Contains("If-Match")) @@ -2766,15 +2927,6 @@ internal VirtualMachinesOperations(ComputeManagementClient client) } _httpRequest.Headers.TryAddWithoutValidation("If-None-Match", ifNoneMatch); } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - if (customHeaders != null) { @@ -2787,61 +2939,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2851,9 +3004,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -2864,38 +3018,42 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to delete a virtual machine. /// @@ -2914,10 +3072,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2926,85 +3084,95 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); tracingParameters.Add("forceDeletion", forceDeletion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (forceDeletion != null) { - _queryParameters.Add(string.Format("forceDeletion={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(forceDeletion, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("forceDeletion={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(forceDeletion, this.Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3016,55 +3184,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3074,20 +3243,25 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Assess patches on the VM. /// @@ -3103,13 +3277,13 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3118,52 +3292,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginAssessPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginAssessPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginAssessPatches", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginAssessPatches", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3173,25 +3357,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3203,55 +3386,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3261,9 +3445,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3274,25 +3459,29 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Attach and detach data disks to/from the virtual machine. /// @@ -3312,13 +3501,13 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3327,61 +3516,71 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginAttachDetachDataDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, AttachDetachDataDisksRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginAttachDetachDataDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, AttachDetachDataDisksRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginAttachDetachDataDisks", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginAttachDetachDataDisks", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/attachDetachDataDisks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3391,25 +3590,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3421,61 +3619,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3485,9 +3684,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3498,38 +3698,42 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Captures the VM by copying virtual hard disks of the VM and outputs a /// template that can be used to create similar VMs. @@ -3549,13 +3753,13 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3564,61 +3768,71 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCaptureWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCaptureWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCapture", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCapture", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3628,25 +3842,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3658,61 +3871,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3722,9 +3936,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -3735,25 +3950,29 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Converts virtual machine disks from blob-based to managed disks. Virtual /// machine must be stop-deallocated before invoking this operation. @@ -3770,10 +3989,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3782,52 +4001,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginConvertToManagedDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginConvertToManagedDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginConvertToManagedDisks", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginConvertToManagedDisks", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -3837,25 +4066,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3867,55 +4095,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3925,20 +4154,25 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Shuts down the virtual machine and releases the compute resources. You are /// not billed for the compute resources that this virtual machine uses. @@ -3958,10 +4192,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3970,85 +4204,95 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeallocateWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? hibernate = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeallocateWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? hibernate = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); tracingParameters.Add("hibernate", hibernate); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeallocate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeallocate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (hibernate != null) { - _queryParameters.Add(string.Format("hibernate={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(hibernate, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("hibernate={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(hibernate, this.Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4060,55 +4304,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4118,20 +4363,25 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Installs patches on the VM. /// @@ -4150,13 +4400,13 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4165,61 +4415,71 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginInstallPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginInstallPatchesWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (installPatchesInput == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "installPatchesInput"); } + if (installPatchesInput != null) + { + installPatchesInput.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); - } - if (installPatchesInput == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "installPatchesInput"); - } - if (installPatchesInput != null) - { - installPatchesInput.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + tracingParameters.Add("installPatchesInput", installPatchesInput); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginInstallPatches", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginInstallPatches", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/installPatches").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -4229,25 +4489,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4259,61 +4518,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(installPatchesInput != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(installPatchesInput, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(installPatchesInput, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4323,9 +4583,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -4336,25 +4597,29 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Migrate a virtual machine from availability set to Flexible Virtual Machine /// Scale Set. @@ -4374,10 +4639,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4386,53 +4651,64 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginMigrateToVMScaleSetWithHttpMessagesAsync(string resourceGroupName, string vmName, MigrateVMToVirtualMachineScaleSetInput parameters = default(MigrateVMToVirtualMachineScaleSetInput), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginMigrateToVMScaleSetWithHttpMessagesAsync(string resourceGroupName, string vmName, MigrateVMToVirtualMachineScaleSetInput parameters = default(MigrateVMToVirtualMachineScaleSetInput), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateToVMScaleSet", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateToVMScaleSet", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/migrateToVirtualMachineScaleSet").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -4442,25 +4718,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4472,61 +4747,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4536,20 +4812,25 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to perform maintenance on a virtual machine. /// @@ -4565,10 +4846,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4577,52 +4858,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginPerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginPerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginPerformMaintenance", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginPerformMaintenance", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -4632,25 +4923,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4662,55 +4952,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4720,20 +5011,25 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to power off (stop) a virtual machine. The virtual machine /// can be restarted with the same provisioned resources. You are still charged @@ -4756,10 +5052,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4768,85 +5064,95 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? skipShutdown = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? skipShutdown = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); tracingParameters.Add("skipShutdown", skipShutdown); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginPowerOff", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginPowerOff", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (skipShutdown != null) { - _queryParameters.Add(string.Format("skipShutdown={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skipShutdown, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("skipShutdown={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(skipShutdown, this.Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4858,55 +5164,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4916,22 +5223,27 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// The operation to reapply a virtual machine's state. + /// The operation to reapply a virtual machine's state. /// /// /// The name of the resource group. The name is case insensitive. @@ -4945,10 +5257,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4957,52 +5269,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginReapplyWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginReapplyWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginReapply", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginReapply", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -5012,25 +5334,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -5042,55 +5363,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -5100,20 +5422,25 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Shuts down the virtual machine, moves it to a new node, and powers it back /// on. @@ -5130,10 +5457,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -5142,52 +5469,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRedeployWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginRedeployWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRedeploy", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRedeploy", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -5197,25 +5534,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -5227,55 +5563,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -5285,22 +5622,27 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Reimages (upgrade the operating system) a virtual machine which don't have + /// Reimages (upgrade the operating system) a virtual machine which don't have /// a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the /// virtual machine is reset to initial state. NOTE: The retaining of old OS /// disk depends on the value of deleteOption of OS disk. If deleteOption is @@ -5323,10 +5665,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -5335,53 +5677,64 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginReimageWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginReimageWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginReimage", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginReimage", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reimage").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -5391,25 +5744,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -5421,61 +5773,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -5485,20 +5838,25 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to restart a virtual machine. /// @@ -5514,10 +5872,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -5526,52 +5884,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestart", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRestart", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -5581,25 +5949,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -5611,55 +5978,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -5669,20 +6037,25 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Run command on the VM. /// @@ -5701,13 +6074,13 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -5716,61 +6089,71 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginRunCommandWithHttpMessagesAsync(string resourceGroupName, string vmName, RunCommandInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginRunCommandWithHttpMessagesAsync(string resourceGroupName, string vmName, RunCommandInput parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRunCommand", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRunCommand", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -5780,25 +6163,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -5810,61 +6192,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -5874,9 +6257,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -5887,25 +6271,29 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// The operation to start a virtual machine. /// @@ -5921,10 +6309,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -5933,52 +6321,62 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string vmName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (vmName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vmName"); } + string apiVersion = "2025-04-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -5988,25 +6386,24 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -6018,55 +6415,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -6076,20 +6474,25 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all the virtual machines under the specified subscription for the /// specified location. @@ -6103,13 +6506,13 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -6118,51 +6521,54 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByLocationNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByLocationNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByLocationNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -6174,55 +6580,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -6232,9 +6639,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -6245,25 +6653,29 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the virtual machines in the specified subscription. Use the /// nextLink property in the response to get the next page of virtual machines. @@ -6277,13 +6689,13 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -6292,51 +6704,54 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -6348,55 +6763,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -6406,9 +6822,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -6419,25 +6836,29 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the virtual machines in the specified resource group. Use the /// nextLink property in the response to get the next page of virtual machines. @@ -6451,13 +6872,13 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -6466,51 +6887,54 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -6522,55 +6946,56 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -6580,9 +7005,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -6593,24 +7019,28 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachinesOperationsExtensions.cs b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachinesOperationsExtensions.cs index 393fc2924ca9..8fb8d71f7939 100644 --- a/src/Compute/Compute.Management.Sdk/Generated/VirtualMachinesOperationsExtensions.cs +++ b/src/Compute/Compute.Management.Sdk/Generated/VirtualMachinesOperationsExtensions.cs @@ -1,2219 +1,2054 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.Compute { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VirtualMachinesOperations. + /// Extension methods for VirtualMachinesOperations /// public static partial class VirtualMachinesOperationsExtensions { - /// - /// Gets all the virtual machines under the specified subscription for the - /// specified location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - public static IPage ListByLocation(this IVirtualMachinesOperations operations, string location) - { - return operations.ListByLocationAsync(location).GetAwaiter().GetResult(); - } - - /// - /// Gets all the virtual machines under the specified subscription for the - /// specified location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByLocationAsync(this IVirtualMachinesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByLocationWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all of the virtual machines in the specified subscription. Use the - /// nextLink property in the response to get the next page of virtual machines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// statusOnly=true enables fetching run time status of all Virtual Machines in - /// the subscription. - /// - /// - /// The system query option to filter VMs returned in the response. Allowed - /// value is 'virtualMachineScaleSet/id' eq - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' - /// - /// - /// The expand expression to apply on operation. 'instanceView' enables - /// fetching run time status of all Virtual Machines, this can only be - /// specified if a valid $filter option is specified. Possible values include: - /// 'instanceView' - /// - public static IPage ListAll(this IVirtualMachinesOperations operations, string statusOnly = default(string), string filter = default(string), string expand = default(string)) - { - return operations.ListAllAsync(statusOnly, filter, expand).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the virtual machines in the specified subscription. Use the - /// nextLink property in the response to get the next page of virtual machines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// statusOnly=true enables fetching run time status of all Virtual Machines in - /// the subscription. - /// - /// - /// The system query option to filter VMs returned in the response. Allowed - /// value is 'virtualMachineScaleSet/id' eq - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' - /// - /// - /// The expand expression to apply on operation. 'instanceView' enables - /// fetching run time status of all Virtual Machines, this can only be - /// specified if a valid $filter option is specified. Possible values include: - /// 'instanceView' - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllAsync(this IVirtualMachinesOperations operations, string statusOnly = default(string), string filter = default(string), string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllWithHttpMessagesAsync(statusOnly, filter, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all of the virtual machines in the specified resource group. Use the - /// nextLink property in the response to get the next page of virtual machines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The system query option to filter VMs returned in the response. Allowed - /// value is 'virtualMachineScaleSet/id' eq - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' - /// - /// - /// The expand expression to apply on operation. 'instanceView' enables - /// fetching run time status of all Virtual Machines, this can only be - /// specified if a valid $filter option is specified. Possible values include: - /// 'instanceView' - /// - public static IPage List(this IVirtualMachinesOperations operations, string resourceGroupName, string filter = default(string), string expand = default(string)) - { - return operations.ListAsync(resourceGroupName, filter, expand).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the virtual machines in the specified resource group. Use the - /// nextLink property in the response to get the next page of virtual machines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The system query option to filter VMs returned in the response. Allowed - /// value is 'virtualMachineScaleSet/id' eq - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' - /// - /// - /// The expand expression to apply on operation. 'instanceView' enables - /// fetching run time status of all Virtual Machines, this can only be - /// specified if a valid $filter option is specified. Possible values include: - /// 'instanceView' - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string filter = default(string), string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, filter, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves information about the model view or the instance view of a - /// virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The expand expression to apply on the operation. 'InstanceView' retrieves a - /// snapshot of the runtime properties of the virtual machine that is managed - /// by the platform and can change outside of control plane operations. - /// 'UserData' retrieves the UserData property as part of the VM model view - /// that was provided by the user during the VM Create/Update operation. - /// Possible values include: 'instanceView', 'userData', 'resiliencyView' - /// - public static VirtualMachine Get(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, InstanceViewTypes? expand = default(InstanceViewTypes?)) - { - return operations.GetAsync(resourceGroupName, vmName, expand).GetAwaiter().GetResult(); - } - - /// - /// Retrieves information about the model view or the instance view of a - /// virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The expand expression to apply on the operation. 'InstanceView' retrieves a - /// snapshot of the runtime properties of the virtual machine that is managed - /// by the platform and can change outside of control plane operations. - /// 'UserData' retrieves the UserData property as part of the VM model view - /// that was provided by the user during the VM Create/Update operation. - /// Possible values include: 'instanceView', 'userData', 'resiliencyView' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, InstanceViewTypes? expand = default(InstanceViewTypes?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vmName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to create or update a virtual machine. Please note some - /// properties can be set only during virtual machine creation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Create Virtual Machine operation. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - public static VirtualMachine CreateOrUpdate(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachine parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) - { - return operations.CreateOrUpdateAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); - } - - /// - /// The operation to create or update a virtual machine. Please note some - /// properties can be set only during virtual machine creation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Create Virtual Machine operation. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachine parameters, string ifMatch = default(string), string ifNoneMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to update a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Update Virtual Machine operation. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - public static VirtualMachine Update(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) - { - return operations.UpdateAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); - } - - /// - /// The operation to update a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Update Virtual Machine operation. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to delete a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Optional parameter to force delete virtual machines. - /// - public static void Delete(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? forceDeletion = default(bool?)) - { - operations.DeleteAsync(resourceGroupName, vmName, forceDeletion).GetAwaiter().GetResult(); - } - - /// - /// The operation to delete a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Optional parameter to force delete virtual machines. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmName, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Assess patches on the VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static VirtualMachineAssessPatchesResult AssessPatches(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - return operations.AssessPatchesAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// Assess patches on the VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task AssessPatchesAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.AssessPatchesWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Attach and detach data disks to/from the virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the attach and detach data disks operation on the - /// virtual machine. - /// - public static StorageProfile AttachDetachDataDisks(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, AttachDetachDataDisksRequest parameters) - { - return operations.AttachDetachDataDisksAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Attach and detach data disks to/from the virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the attach and detach data disks operation on the - /// virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task AttachDetachDataDisksAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, AttachDetachDataDisksRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.AttachDetachDataDisksWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Captures the VM by copying virtual hard disks of the VM and outputs a - /// template that can be used to create similar VMs. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Capture Virtual Machine operation. - /// - public static VirtualMachineCaptureResult Capture(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters) - { - return operations.CaptureAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Captures the VM by copying virtual hard disks of the VM and outputs a - /// template that can be used to create similar VMs. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Capture Virtual Machine operation. - /// - /// - /// The cancellation token. - /// - public static async Task CaptureAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CaptureWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Converts virtual machine disks from blob-based to managed disks. Virtual - /// machine must be stop-deallocated before invoking this operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static void ConvertToManagedDisks(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - operations.ConvertToManagedDisksAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// Converts virtual machine disks from blob-based to managed disks. Virtual - /// machine must be stop-deallocated before invoking this operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task ConvertToManagedDisksAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ConvertToManagedDisksWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Shuts down the virtual machine and releases the compute resources. You are - /// not billed for the compute resources that this virtual machine uses. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Optional parameter to hibernate a virtual machine. - /// - public static void Deallocate(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? hibernate = default(bool?)) - { - operations.DeallocateAsync(resourceGroupName, vmName, hibernate).GetAwaiter().GetResult(); - } - - /// - /// Shuts down the virtual machine and releases the compute resources. You are - /// not billed for the compute resources that this virtual machine uses. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Optional parameter to hibernate a virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task DeallocateAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? hibernate = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeallocateWithHttpMessagesAsync(resourceGroupName, vmName, hibernate, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Sets the OS state of the virtual machine to generalized. It is recommended - /// to sysprep the virtual machine before performing this operation. For - /// Windows, please refer to [Create a managed image of a generalized VM in - /// Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). - /// For Linux, please refer to [How to create an image of a virtual machine or - /// VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static void Generalize(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - operations.GeneralizeAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// Sets the OS state of the virtual machine to generalized. It is recommended - /// to sysprep the virtual machine before performing this operation. For - /// Windows, please refer to [Create a managed image of a generalized VM in - /// Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). - /// For Linux, please refer to [How to create an image of a virtual machine or - /// VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task GeneralizeAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.GeneralizeWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Installs patches on the VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Input for InstallPatches as directly received by the API - /// - public static VirtualMachineInstallPatchesResult InstallPatches(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput) - { - return operations.InstallPatchesAsync(resourceGroupName, vmName, installPatchesInput).GetAwaiter().GetResult(); - } - - /// - /// Installs patches on the VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Input for InstallPatches as directly received by the API - /// - /// - /// The cancellation token. - /// - public static async Task InstallPatchesAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.InstallPatchesWithHttpMessagesAsync(resourceGroupName, vmName, installPatchesInput, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves information about the run-time state of a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static VirtualMachineInstanceView InstanceView(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - return operations.InstanceViewAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves information about the run-time state of a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task InstanceViewAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.InstanceViewWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Migrate a virtual machine from availability set to Flexible Virtual Machine - /// Scale Set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Migrate Virtual Machine operation. - /// - public static void MigrateToVMScaleSet(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, MigrateVMToVirtualMachineScaleSetInput parameters = default(MigrateVMToVirtualMachineScaleSetInput)) - { - operations.MigrateToVMScaleSetAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Migrate a virtual machine from availability set to Flexible Virtual Machine - /// Scale Set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Migrate Virtual Machine operation. - /// - /// - /// The cancellation token. - /// - public static async Task MigrateToVMScaleSetAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, MigrateVMToVirtualMachineScaleSetInput parameters = default(MigrateVMToVirtualMachineScaleSetInput), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.MigrateToVMScaleSetWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The operation to perform maintenance on a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static void PerformMaintenance(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - operations.PerformMaintenanceAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// The operation to perform maintenance on a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task PerformMaintenanceAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.PerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The operation to power off (stop) a virtual machine. The virtual machine - /// can be restarted with the same provisioned resources. You are still charged - /// for this virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The parameter to request non-graceful VM shutdown. True value for this flag - /// indicates non-graceful shutdown whereas false indicates otherwise. Default - /// value for this flag is false if not specified - /// - public static void PowerOff(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? skipShutdown = default(bool?)) - { - operations.PowerOffAsync(resourceGroupName, vmName, skipShutdown).GetAwaiter().GetResult(); - } - - /// - /// The operation to power off (stop) a virtual machine. The virtual machine - /// can be restarted with the same provisioned resources. You are still charged - /// for this virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The parameter to request non-graceful VM shutdown. True value for this flag - /// indicates non-graceful shutdown whereas false indicates otherwise. Default - /// value for this flag is false if not specified - /// - /// - /// The cancellation token. - /// - public static async Task PowerOffAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? skipShutdown = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.PowerOffWithHttpMessagesAsync(resourceGroupName, vmName, skipShutdown, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The operation to reapply a virtual machine's state. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static void Reapply(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - operations.ReapplyAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// The operation to reapply a virtual machine's state. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task ReapplyAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ReapplyWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Shuts down the virtual machine, moves it to a new node, and powers it back - /// on. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static void Redeploy(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - operations.RedeployAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// Shuts down the virtual machine, moves it to a new node, and powers it back - /// on. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task RedeployAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RedeployWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Reimages (upgrade the operating system) a virtual machine which don't have - /// a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the - /// virtual machine is reset to initial state. NOTE: The retaining of old OS - /// disk depends on the value of deleteOption of OS disk. If deleteOption is - /// detach, the old OS disk will be preserved after reimage. If deleteOption is - /// delete, the old OS disk will be deleted after reimage. The deleteOption of - /// the OS disk should be updated accordingly before performing the reimage. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Reimage Virtual Machine operation. - /// - public static void Reimage(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters)) - { - operations.ReimageAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Reimages (upgrade the operating system) a virtual machine which don't have - /// a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the - /// virtual machine is reset to initial state. NOTE: The retaining of old OS - /// disk depends on the value of deleteOption of OS disk. If deleteOption is - /// detach, the old OS disk will be preserved after reimage. If deleteOption is - /// delete, the old OS disk will be deleted after reimage. The deleteOption of - /// the OS disk should be updated accordingly before performing the reimage. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Reimage Virtual Machine operation. - /// - /// - /// The cancellation token. - /// - public static async Task ReimageAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ReimageWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The operation to restart a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static void Restart(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - operations.RestartAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// The operation to restart a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task RestartAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RestartWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The operation to retrieve SAS URIs for a virtual machine's boot diagnostic - /// logs. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Expiration duration in minutes for the SAS URIs with a value between 1 to - /// 1440 minutes. **Note:** If not specified, SAS URIs will be generated with a - /// default expiration duration of 120 minutes. - /// - public static RetrieveBootDiagnosticsDataResult RetrieveBootDiagnosticsData(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, int? sasUriExpirationTimeInMinutes = default(int?)) - { - return operations.RetrieveBootDiagnosticsDataAsync(resourceGroupName, vmName, sasUriExpirationTimeInMinutes).GetAwaiter().GetResult(); - } - - /// - /// The operation to retrieve SAS URIs for a virtual machine's boot diagnostic - /// logs. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Expiration duration in minutes for the SAS URIs with a value between 1 to - /// 1440 minutes. **Note:** If not specified, SAS URIs will be generated with a - /// default expiration duration of 120 minutes. - /// - /// - /// The cancellation token. - /// - public static async Task RetrieveBootDiagnosticsDataAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, int? sasUriExpirationTimeInMinutes = default(int?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.RetrieveBootDiagnosticsDataWithHttpMessagesAsync(resourceGroupName, vmName, sasUriExpirationTimeInMinutes, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Run command on the VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Run command operation. - /// - public static RunCommandResult RunCommand(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, RunCommandInput parameters) - { - return operations.RunCommandAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Run command on the VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Run command operation. - /// - /// - /// The cancellation token. - /// - public static async Task RunCommandAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, RunCommandInput parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.RunCommandWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to simulate the eviction of spot virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static void SimulateEviction(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - operations.SimulateEvictionAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// The operation to simulate the eviction of spot virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task SimulateEvictionAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.SimulateEvictionWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The operation to start a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static void Start(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - operations.StartAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// The operation to start a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task StartAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.StartWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all available virtual machine sizes to which the specified virtual - /// machine can be resized. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static IEnumerable ListAvailableSizes(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - return operations.ListAvailableSizesAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// Lists all available virtual machine sizes to which the specified virtual - /// machine can be resized. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAvailableSizesAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAvailableSizesWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to create or update a virtual machine. Please note some - /// properties can be set only during virtual machine creation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Create Virtual Machine operation. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - public static VirtualMachine BeginCreateOrUpdate(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachine parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); - } - - /// - /// The operation to create or update a virtual machine. Please note some - /// properties can be set only during virtual machine creation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Create Virtual Machine operation. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachine parameters, string ifMatch = default(string), string ifNoneMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to update a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Update Virtual Machine operation. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - public static VirtualMachine BeginUpdate(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) - { - return operations.BeginUpdateAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); - } - - /// - /// The operation to update a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Update Virtual Machine operation. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the - /// current resource. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new record set to be created, but to prevent updating - /// an existing record set. Other values will result in error from server as - /// they are not supported. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to delete a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Optional parameter to force delete virtual machines. - /// - public static void BeginDelete(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? forceDeletion = default(bool?)) - { - operations.BeginDeleteAsync(resourceGroupName, vmName, forceDeletion).GetAwaiter().GetResult(); - } - - /// - /// The operation to delete a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Optional parameter to force delete virtual machines. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmName, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Assess patches on the VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static VirtualMachineAssessPatchesResult BeginAssessPatches(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - return operations.BeginAssessPatchesAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// Assess patches on the VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginAssessPatchesAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginAssessPatchesWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Attach and detach data disks to/from the virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the attach and detach data disks operation on the - /// virtual machine. - /// - public static StorageProfile BeginAttachDetachDataDisks(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, AttachDetachDataDisksRequest parameters) - { - return operations.BeginAttachDetachDataDisksAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Attach and detach data disks to/from the virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the attach and detach data disks operation on the - /// virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginAttachDetachDataDisksAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, AttachDetachDataDisksRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginAttachDetachDataDisksWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Captures the VM by copying virtual hard disks of the VM and outputs a - /// template that can be used to create similar VMs. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Capture Virtual Machine operation. - /// - public static VirtualMachineCaptureResult BeginCapture(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters) - { - return operations.BeginCaptureAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Captures the VM by copying virtual hard disks of the VM and outputs a - /// template that can be used to create similar VMs. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Capture Virtual Machine operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCaptureAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCaptureWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Converts virtual machine disks from blob-based to managed disks. Virtual - /// machine must be stop-deallocated before invoking this operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static void BeginConvertToManagedDisks(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - operations.BeginConvertToManagedDisksAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// Converts virtual machine disks from blob-based to managed disks. Virtual - /// machine must be stop-deallocated before invoking this operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginConvertToManagedDisksAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginConvertToManagedDisksWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Shuts down the virtual machine and releases the compute resources. You are - /// not billed for the compute resources that this virtual machine uses. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Optional parameter to hibernate a virtual machine. - /// - public static void BeginDeallocate(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? hibernate = default(bool?)) - { - operations.BeginDeallocateAsync(resourceGroupName, vmName, hibernate).GetAwaiter().GetResult(); - } - - /// - /// Shuts down the virtual machine and releases the compute resources. You are - /// not billed for the compute resources that this virtual machine uses. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Optional parameter to hibernate a virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeallocateAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? hibernate = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeallocateWithHttpMessagesAsync(resourceGroupName, vmName, hibernate, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Installs patches on the VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Input for InstallPatches as directly received by the API - /// - public static VirtualMachineInstallPatchesResult BeginInstallPatches(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput) - { - return operations.BeginInstallPatchesAsync(resourceGroupName, vmName, installPatchesInput).GetAwaiter().GetResult(); - } - - /// - /// Installs patches on the VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Input for InstallPatches as directly received by the API - /// - /// - /// The cancellation token. - /// - public static async Task BeginInstallPatchesAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginInstallPatchesWithHttpMessagesAsync(resourceGroupName, vmName, installPatchesInput, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Migrate a virtual machine from availability set to Flexible Virtual Machine - /// Scale Set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Migrate Virtual Machine operation. - /// - public static void BeginMigrateToVMScaleSet(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, MigrateVMToVirtualMachineScaleSetInput parameters = default(MigrateVMToVirtualMachineScaleSetInput)) - { - operations.BeginMigrateToVMScaleSetAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Migrate a virtual machine from availability set to Flexible Virtual Machine - /// Scale Set. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Migrate Virtual Machine operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginMigrateToVMScaleSetAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, MigrateVMToVirtualMachineScaleSetInput parameters = default(MigrateVMToVirtualMachineScaleSetInput), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginMigrateToVMScaleSetWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The operation to perform maintenance on a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static void BeginPerformMaintenance(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - operations.BeginPerformMaintenanceAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// The operation to perform maintenance on a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginPerformMaintenanceAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginPerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The operation to power off (stop) a virtual machine. The virtual machine - /// can be restarted with the same provisioned resources. You are still charged - /// for this virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The parameter to request non-graceful VM shutdown. True value for this flag - /// indicates non-graceful shutdown whereas false indicates otherwise. Default - /// value for this flag is false if not specified - /// - public static void BeginPowerOff(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? skipShutdown = default(bool?)) - { - operations.BeginPowerOffAsync(resourceGroupName, vmName, skipShutdown).GetAwaiter().GetResult(); - } - - /// - /// The operation to power off (stop) a virtual machine. The virtual machine - /// can be restarted with the same provisioned resources. You are still charged - /// for this virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The parameter to request non-graceful VM shutdown. True value for this flag - /// indicates non-graceful shutdown whereas false indicates otherwise. Default - /// value for this flag is false if not specified - /// - /// - /// The cancellation token. - /// - public static async Task BeginPowerOffAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? skipShutdown = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmName, skipShutdown, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The operation to reapply a virtual machine's state. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static void BeginReapply(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - operations.BeginReapplyAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// The operation to reapply a virtual machine's state. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginReapplyAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginReapplyWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Shuts down the virtual machine, moves it to a new node, and powers it back - /// on. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static void BeginRedeploy(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - operations.BeginRedeployAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// Shuts down the virtual machine, moves it to a new node, and powers it back - /// on. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRedeployAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRedeployWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Reimages (upgrade the operating system) a virtual machine which don't have - /// a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the - /// virtual machine is reset to initial state. NOTE: The retaining of old OS - /// disk depends on the value of deleteOption of OS disk. If deleteOption is - /// detach, the old OS disk will be preserved after reimage. If deleteOption is - /// delete, the old OS disk will be deleted after reimage. The deleteOption of - /// the OS disk should be updated accordingly before performing the reimage. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Reimage Virtual Machine operation. - /// - public static void BeginReimage(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters)) - { - operations.BeginReimageAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Reimages (upgrade the operating system) a virtual machine which don't have - /// a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the - /// virtual machine is reset to initial state. NOTE: The retaining of old OS - /// disk depends on the value of deleteOption of OS disk. If deleteOption is - /// detach, the old OS disk will be preserved after reimage. If deleteOption is - /// delete, the old OS disk will be deleted after reimage. The deleteOption of - /// the OS disk should be updated accordingly before performing the reimage. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Reimage Virtual Machine operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginReimageAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginReimageWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// The operation to restart a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static void BeginRestart(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - operations.BeginRestartAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// The operation to restart a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRestartAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRestartWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Run command on the VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Run command operation. - /// - public static RunCommandResult BeginRunCommand(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, RunCommandInput parameters) - { - return operations.BeginRunCommandAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Run command on the VM. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// Parameters supplied to the Run command operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRunCommandAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, RunCommandInput parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginRunCommandWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to start a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - public static void BeginStart(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) - { - operations.BeginStartAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); - } - - /// - /// The operation to start a virtual machine. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the virtual machine. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStartAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets all the virtual machines under the specified subscription for the - /// specified location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByLocationNext(this IVirtualMachinesOperations operations, string nextPageLink) - { - return operations.ListByLocationNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the virtual machines under the specified subscription for the - /// specified location. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByLocationNextAsync(this IVirtualMachinesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByLocationNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all of the virtual machines in the specified subscription. Use the - /// nextLink property in the response to get the next page of virtual machines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAllNext(this IVirtualMachinesOperations operations, string nextPageLink) - { - return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the virtual machines in the specified subscription. Use the - /// nextLink property in the response to get the next page of virtual machines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAllNextAsync(this IVirtualMachinesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all of the virtual machines in the specified resource group. Use the - /// nextLink property in the response to get the next page of virtual machines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVirtualMachinesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the virtual machines in the specified resource group. Use the - /// nextLink property in the response to get the next page of virtual machines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IVirtualMachinesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// Gets all the virtual machines under the specified subscription for the + /// specified location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + public static Microsoft.Rest.Azure.IPage ListByLocation(this IVirtualMachinesOperations operations, string location) + { + return ((IVirtualMachinesOperations)operations).ListByLocationAsync(location).GetAwaiter().GetResult(); + } + + /// + /// Gets all the virtual machines under the specified subscription for the + /// specified location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByLocationAsync(this IVirtualMachinesOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByLocationWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all of the virtual machines in the specified subscription. Use the + /// nextLink property in the response to get the next page of virtual machines. + /// + /// + /// The operations group for this extension method. + /// + /// + /// statusOnly=true enables fetching run time status of all Virtual Machines in + /// the subscription. + /// + /// + /// The system query option to filter VMs returned in the response. Allowed + /// value is 'virtualMachineScaleSet/id' eq + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' + /// + /// + /// The expand expression to apply on operation. 'instanceView' enables + /// fetching run time status of all Virtual Machines, this can only be + /// specified if a valid $filter option is specified + /// + public static Microsoft.Rest.Azure.IPage ListAll(this IVirtualMachinesOperations operations, string statusOnly = default(string), string filter = default(string), string expand = default(string)) + { + return ((IVirtualMachinesOperations)operations).ListAllAsync(statusOnly, filter, expand).GetAwaiter().GetResult(); + } + + /// + /// Lists all of the virtual machines in the specified subscription. Use the + /// nextLink property in the response to get the next page of virtual machines. + /// + /// + /// The operations group for this extension method. + /// + /// + /// statusOnly=true enables fetching run time status of all Virtual Machines in + /// the subscription. + /// + /// + /// The system query option to filter VMs returned in the response. Allowed + /// value is 'virtualMachineScaleSet/id' eq + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' + /// + /// + /// The expand expression to apply on operation. 'instanceView' enables + /// fetching run time status of all Virtual Machines, this can only be + /// specified if a valid $filter option is specified + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllAsync(this IVirtualMachinesOperations operations, string statusOnly = default(string), string filter = default(string), string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(statusOnly, filter, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all of the virtual machines in the specified resource group. Use the + /// nextLink property in the response to get the next page of virtual machines. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The system query option to filter VMs returned in the response. Allowed + /// value is 'virtualMachineScaleSet/id' eq + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' + /// + /// + /// The expand expression to apply on operation. 'instanceView' enables + /// fetching run time status of all Virtual Machines, this can only be + /// specified if a valid $filter option is specified + /// + public static Microsoft.Rest.Azure.IPage List(this IVirtualMachinesOperations operations, string resourceGroupName, string filter = default(string), string expand = default(string)) + { + return ((IVirtualMachinesOperations)operations).ListAsync(resourceGroupName, filter, expand).GetAwaiter().GetResult(); + } + + /// + /// Lists all of the virtual machines in the specified resource group. Use the + /// nextLink property in the response to get the next page of virtual machines. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The system query option to filter VMs returned in the response. Allowed + /// value is 'virtualMachineScaleSet/id' eq + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' + /// + /// + /// The expand expression to apply on operation. 'instanceView' enables + /// fetching run time status of all Virtual Machines, this can only be + /// specified if a valid $filter option is specified + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string filter = default(string), string expand = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, filter, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves information about the model view or the instance view of a + /// virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The expand expression to apply on the operation. 'InstanceView' retrieves a + /// snapshot of the runtime properties of the virtual machine that is managed + /// by the platform and can change outside of control plane operations. + /// 'UserData' retrieves the UserData property as part of the VM model view + /// that was provided by the user during the VM Create/Update operation. + /// + public static VirtualMachine Get(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, InstanceViewTypes? expand = default(InstanceViewTypes?)) + { + return ((IVirtualMachinesOperations)operations).GetAsync(resourceGroupName, vmName, expand).GetAwaiter().GetResult(); + } + + /// + /// Retrieves information about the model view or the instance view of a + /// virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The expand expression to apply on the operation. 'InstanceView' retrieves a + /// snapshot of the runtime properties of the virtual machine that is managed + /// by the platform and can change outside of control plane operations. + /// 'UserData' retrieves the UserData property as part of the VM model view + /// that was provided by the user during the VM Create/Update operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, InstanceViewTypes? expand = default(InstanceViewTypes?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vmName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// The operation to create or update a virtual machine. Please note some + /// properties can be set only during virtual machine creation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + public static VirtualMachine CreateOrUpdate(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachine parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) + { + return ((IVirtualMachinesOperations)operations).CreateOrUpdateAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); + } + + /// + /// The operation to create or update a virtual machine. Please note some + /// properties can be set only during virtual machine creation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachine parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// The operation to update a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + public static VirtualMachine Update(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) + { + return ((IVirtualMachinesOperations)operations).UpdateAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); + } + + /// + /// The operation to update a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// The operation to delete a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Optional parameter to force delete virtual machines. + /// + public static void Delete(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? forceDeletion = default(bool?)) + { + ((IVirtualMachinesOperations)operations).DeleteAsync(resourceGroupName, vmName, forceDeletion).GetAwaiter().GetResult(); + } + + /// + /// The operation to delete a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Optional parameter to force delete virtual machines. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmName, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Assess patches on the VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static VirtualMachineAssessPatchesResult AssessPatches(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + return ((IVirtualMachinesOperations)operations).AssessPatchesAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// Assess patches on the VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task AssessPatchesAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.AssessPatchesWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Attach and detach data disks to/from the virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static StorageProfile AttachDetachDataDisks(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, AttachDetachDataDisksRequest parameters) + { + return ((IVirtualMachinesOperations)operations).AttachDetachDataDisksAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Attach and detach data disks to/from the virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task AttachDetachDataDisksAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, AttachDetachDataDisksRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.AttachDetachDataDisksWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Captures the VM by copying virtual hard disks of the VM and outputs a + /// template that can be used to create similar VMs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static VirtualMachineCaptureResult Capture(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters) + { + return ((IVirtualMachinesOperations)operations).CaptureAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Captures the VM by copying virtual hard disks of the VM and outputs a + /// template that can be used to create similar VMs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CaptureAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CaptureWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Converts virtual machine disks from blob-based to managed disks. Virtual + /// machine must be stop-deallocated before invoking this operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void ConvertToManagedDisks(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + ((IVirtualMachinesOperations)operations).ConvertToManagedDisksAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// Converts virtual machine disks from blob-based to managed disks. Virtual + /// machine must be stop-deallocated before invoking this operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ConvertToManagedDisksAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ConvertToManagedDisksWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Shuts down the virtual machine and releases the compute resources. You are + /// not billed for the compute resources that this virtual machine uses. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Optional parameter to hibernate a virtual machine. + /// + public static void Deallocate(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? hibernate = default(bool?)) + { + ((IVirtualMachinesOperations)operations).DeallocateAsync(resourceGroupName, vmName, hibernate).GetAwaiter().GetResult(); + } + + /// + /// Shuts down the virtual machine and releases the compute resources. You are + /// not billed for the compute resources that this virtual machine uses. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Optional parameter to hibernate a virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeallocateAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? hibernate = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeallocateWithHttpMessagesAsync(resourceGroupName, vmName, hibernate, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Sets the OS state of the virtual machine to generalized. It is recommended + /// to sysprep the virtual machine before performing this operation. For + /// Windows, please refer to [Create a managed image of a generalized VM in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). + /// For Linux, please refer to [How to create an image of a virtual machine or + /// VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void Generalize(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + ((IVirtualMachinesOperations)operations).GeneralizeAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// Sets the OS state of the virtual machine to generalized. It is recommended + /// to sysprep the virtual machine before performing this operation. For + /// Windows, please refer to [Create a managed image of a generalized VM in + /// Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). + /// For Linux, please refer to [How to create an image of a virtual machine or + /// VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GeneralizeAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.GeneralizeWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Installs patches on the VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static VirtualMachineInstallPatchesResult InstallPatches(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput) + { + return ((IVirtualMachinesOperations)operations).InstallPatchesAsync(resourceGroupName, vmName, installPatchesInput).GetAwaiter().GetResult(); + } + + /// + /// Installs patches on the VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task InstallPatchesAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.InstallPatchesWithHttpMessagesAsync(resourceGroupName, vmName, installPatchesInput, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves information about the run-time state of a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static VirtualMachineInstanceView InstanceView(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + return ((IVirtualMachinesOperations)operations).InstanceViewAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves information about the run-time state of a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task InstanceViewAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.InstanceViewWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Migrate a virtual machine from availability set to Flexible Virtual Machine + /// Scale Set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void MigrateToVMScaleSet(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, MigrateVMToVirtualMachineScaleSetInput parameters = default(MigrateVMToVirtualMachineScaleSetInput)) + { + ((IVirtualMachinesOperations)operations).MigrateToVMScaleSetAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Migrate a virtual machine from availability set to Flexible Virtual Machine + /// Scale Set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task MigrateToVMScaleSetAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, MigrateVMToVirtualMachineScaleSetInput parameters = default(MigrateVMToVirtualMachineScaleSetInput), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.MigrateToVMScaleSetWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to perform maintenance on a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void PerformMaintenance(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + ((IVirtualMachinesOperations)operations).PerformMaintenanceAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// The operation to perform maintenance on a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task PerformMaintenanceAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.PerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to power off (stop) a virtual machine. The virtual machine + /// can be restarted with the same provisioned resources. You are still charged + /// for this virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// + public static void PowerOff(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? skipShutdown = default(bool?)) + { + ((IVirtualMachinesOperations)operations).PowerOffAsync(resourceGroupName, vmName, skipShutdown).GetAwaiter().GetResult(); + } + + /// + /// The operation to power off (stop) a virtual machine. The virtual machine + /// can be restarted with the same provisioned resources. You are still charged + /// for this virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task PowerOffAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? skipShutdown = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.PowerOffWithHttpMessagesAsync(resourceGroupName, vmName, skipShutdown, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to reapply a virtual machine's state. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void Reapply(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + ((IVirtualMachinesOperations)operations).ReapplyAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// The operation to reapply a virtual machine's state. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ReapplyAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ReapplyWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Shuts down the virtual machine, moves it to a new node, and powers it back + /// on. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void Redeploy(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + ((IVirtualMachinesOperations)operations).RedeployAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// Shuts down the virtual machine, moves it to a new node, and powers it back + /// on. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RedeployAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.RedeployWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Reimages (upgrade the operating system) a virtual machine which don't have + /// a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the + /// virtual machine is reset to initial state. NOTE: The retaining of old OS + /// disk depends on the value of deleteOption of OS disk. If deleteOption is + /// detach, the old OS disk will be preserved after reimage. If deleteOption is + /// delete, the old OS disk will be deleted after reimage. The deleteOption of + /// the OS disk should be updated accordingly before performing the reimage. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void Reimage(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters)) + { + ((IVirtualMachinesOperations)operations).ReimageAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Reimages (upgrade the operating system) a virtual machine which don't have + /// a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the + /// virtual machine is reset to initial state. NOTE: The retaining of old OS + /// disk depends on the value of deleteOption of OS disk. If deleteOption is + /// detach, the old OS disk will be preserved after reimage. If deleteOption is + /// delete, the old OS disk will be deleted after reimage. The deleteOption of + /// the OS disk should be updated accordingly before performing the reimage. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ReimageAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ReimageWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to restart a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void Restart(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + ((IVirtualMachinesOperations)operations).RestartAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// The operation to restart a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RestartAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.RestartWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to retrieve SAS URIs for a virtual machine's boot diagnostic + /// logs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Expiration duration in minutes for the SAS URIs with a value between 1 to + /// 1440 minutes. **Note:** If not specified, SAS URIs will be generated with a + /// default expiration duration of 120 minutes. + /// + public static RetrieveBootDiagnosticsDataResult RetrieveBootDiagnosticsData(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, int? sasUriExpirationTimeInMinutes = default(int?)) + { + return ((IVirtualMachinesOperations)operations).RetrieveBootDiagnosticsDataAsync(resourceGroupName, vmName, sasUriExpirationTimeInMinutes).GetAwaiter().GetResult(); + } + + /// + /// The operation to retrieve SAS URIs for a virtual machine's boot diagnostic + /// logs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Expiration duration in minutes for the SAS URIs with a value between 1 to + /// 1440 minutes. **Note:** If not specified, SAS URIs will be generated with a + /// default expiration duration of 120 minutes. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RetrieveBootDiagnosticsDataAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, int? sasUriExpirationTimeInMinutes = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.RetrieveBootDiagnosticsDataWithHttpMessagesAsync(resourceGroupName, vmName, sasUriExpirationTimeInMinutes, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Run command on the VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static RunCommandResult RunCommand(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, RunCommandInput parameters) + { + return ((IVirtualMachinesOperations)operations).RunCommandAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Run command on the VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RunCommandAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, RunCommandInput parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.RunCommandWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// The operation to simulate the eviction of spot virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void SimulateEviction(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + ((IVirtualMachinesOperations)operations).SimulateEvictionAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// The operation to simulate the eviction of spot virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task SimulateEvictionAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.SimulateEvictionWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to start a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void Start(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + ((IVirtualMachinesOperations)operations).StartAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// The operation to start a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task StartAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.StartWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all available virtual machine sizes to which the specified virtual + /// machine can be resized. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static System.Collections.Generic.IEnumerable ListAvailableSizes(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + return ((IVirtualMachinesOperations)operations).ListAvailableSizesAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// Lists all available virtual machine sizes to which the specified virtual + /// machine can be resized. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAvailableSizesAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAvailableSizesWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// The operation to create or update a virtual machine. Please note some + /// properties can be set only during virtual machine creation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + public static VirtualMachine BeginCreateOrUpdate(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachine parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) + { + return ((IVirtualMachinesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); + } + + /// + /// The operation to create or update a virtual machine. Please note some + /// properties can be set only during virtual machine creation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachine parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// The operation to update a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + public static VirtualMachine BeginUpdate(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) + { + return ((IVirtualMachinesOperations)operations).BeginUpdateAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); + } + + /// + /// The operation to update a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating + /// an existing record set. Other values will result in error from server as + /// they are not supported. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineUpdate parameters, string ifMatch = default(string), string ifNoneMatch = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// The operation to delete a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Optional parameter to force delete virtual machines. + /// + public static void BeginDelete(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? forceDeletion = default(bool?)) + { + ((IVirtualMachinesOperations)operations).BeginDeleteAsync(resourceGroupName, vmName, forceDeletion).GetAwaiter().GetResult(); + } + + /// + /// The operation to delete a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Optional parameter to force delete virtual machines. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmName, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Assess patches on the VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static VirtualMachineAssessPatchesResult BeginAssessPatches(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + return ((IVirtualMachinesOperations)operations).BeginAssessPatchesAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// Assess patches on the VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginAssessPatchesAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginAssessPatchesWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Attach and detach data disks to/from the virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static StorageProfile BeginAttachDetachDataDisks(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, AttachDetachDataDisksRequest parameters) + { + return ((IVirtualMachinesOperations)operations).BeginAttachDetachDataDisksAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Attach and detach data disks to/from the virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginAttachDetachDataDisksAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, AttachDetachDataDisksRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginAttachDetachDataDisksWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Captures the VM by copying virtual hard disks of the VM and outputs a + /// template that can be used to create similar VMs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static VirtualMachineCaptureResult BeginCapture(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters) + { + return ((IVirtualMachinesOperations)operations).BeginCaptureAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Captures the VM by copying virtual hard disks of the VM and outputs a + /// template that can be used to create similar VMs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCaptureAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCaptureWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Converts virtual machine disks from blob-based to managed disks. Virtual + /// machine must be stop-deallocated before invoking this operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void BeginConvertToManagedDisks(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + ((IVirtualMachinesOperations)operations).BeginConvertToManagedDisksAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// Converts virtual machine disks from blob-based to managed disks. Virtual + /// machine must be stop-deallocated before invoking this operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginConvertToManagedDisksAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginConvertToManagedDisksWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Shuts down the virtual machine and releases the compute resources. You are + /// not billed for the compute resources that this virtual machine uses. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Optional parameter to hibernate a virtual machine. + /// + public static void BeginDeallocate(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? hibernate = default(bool?)) + { + ((IVirtualMachinesOperations)operations).BeginDeallocateAsync(resourceGroupName, vmName, hibernate).GetAwaiter().GetResult(); + } + + /// + /// Shuts down the virtual machine and releases the compute resources. You are + /// not billed for the compute resources that this virtual machine uses. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// Optional parameter to hibernate a virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeallocateAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? hibernate = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeallocateWithHttpMessagesAsync(resourceGroupName, vmName, hibernate, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Installs patches on the VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static VirtualMachineInstallPatchesResult BeginInstallPatches(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput) + { + return ((IVirtualMachinesOperations)operations).BeginInstallPatchesAsync(resourceGroupName, vmName, installPatchesInput).GetAwaiter().GetResult(); + } + + /// + /// Installs patches on the VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginInstallPatchesAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineInstallPatchesParameters installPatchesInput, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginInstallPatchesWithHttpMessagesAsync(resourceGroupName, vmName, installPatchesInput, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Migrate a virtual machine from availability set to Flexible Virtual Machine + /// Scale Set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void BeginMigrateToVMScaleSet(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, MigrateVMToVirtualMachineScaleSetInput parameters = default(MigrateVMToVirtualMachineScaleSetInput)) + { + ((IVirtualMachinesOperations)operations).BeginMigrateToVMScaleSetAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Migrate a virtual machine from availability set to Flexible Virtual Machine + /// Scale Set. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginMigrateToVMScaleSetAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, MigrateVMToVirtualMachineScaleSetInput parameters = default(MigrateVMToVirtualMachineScaleSetInput), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginMigrateToVMScaleSetWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to perform maintenance on a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void BeginPerformMaintenance(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + ((IVirtualMachinesOperations)operations).BeginPerformMaintenanceAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// The operation to perform maintenance on a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginPerformMaintenanceAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginPerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to power off (stop) a virtual machine. The virtual machine + /// can be restarted with the same provisioned resources. You are still charged + /// for this virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// + public static void BeginPowerOff(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? skipShutdown = default(bool?)) + { + ((IVirtualMachinesOperations)operations).BeginPowerOffAsync(resourceGroupName, vmName, skipShutdown).GetAwaiter().GetResult(); + } + + /// + /// The operation to power off (stop) a virtual machine. The virtual machine + /// can be restarted with the same provisioned resources. You are still charged + /// for this virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The parameter to request non-graceful VM shutdown. True value for this flag + /// indicates non-graceful shutdown whereas false indicates otherwise. Default + /// value for this flag is false if not specified + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginPowerOffAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? skipShutdown = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmName, skipShutdown, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to reapply a virtual machine's state. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void BeginReapply(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + ((IVirtualMachinesOperations)operations).BeginReapplyAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// The operation to reapply a virtual machine's state. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginReapplyAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginReapplyWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Shuts down the virtual machine, moves it to a new node, and powers it back + /// on. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void BeginRedeploy(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + ((IVirtualMachinesOperations)operations).BeginRedeployAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// Shuts down the virtual machine, moves it to a new node, and powers it back + /// on. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRedeployAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginRedeployWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Reimages (upgrade the operating system) a virtual machine which don't have + /// a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the + /// virtual machine is reset to initial state. NOTE: The retaining of old OS + /// disk depends on the value of deleteOption of OS disk. If deleteOption is + /// detach, the old OS disk will be preserved after reimage. If deleteOption is + /// delete, the old OS disk will be deleted after reimage. The deleteOption of + /// the OS disk should be updated accordingly before performing the reimage. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void BeginReimage(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters)) + { + ((IVirtualMachinesOperations)operations).BeginReimageAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Reimages (upgrade the operating system) a virtual machine which don't have + /// a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the + /// virtual machine is reset to initial state. NOTE: The retaining of old OS + /// disk depends on the value of deleteOption of OS disk. If deleteOption is + /// detach, the old OS disk will be preserved after reimage. If deleteOption is + /// delete, the old OS disk will be deleted after reimage. The deleteOption of + /// the OS disk should be updated accordingly before performing the reimage. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginReimageAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineReimageParameters parameters = default(VirtualMachineReimageParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginReimageWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// The operation to restart a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void BeginRestart(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + ((IVirtualMachinesOperations)operations).BeginRestartAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// The operation to restart a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRestartAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginRestartWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Run command on the VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static RunCommandResult BeginRunCommand(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, RunCommandInput parameters) + { + return ((IVirtualMachinesOperations)operations).BeginRunCommandAsync(resourceGroupName, vmName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Run command on the VM. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRunCommandAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, RunCommandInput parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginRunCommandWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// The operation to start a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + public static void BeginStart(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + { + ((IVirtualMachinesOperations)operations).BeginStartAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + } + + /// + /// The operation to start a virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the virtual machine. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginStartAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets all the virtual machines under the specified subscription for the + /// specified location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByLocationNext(this IVirtualMachinesOperations operations, string nextPageLink) + { + return ((IVirtualMachinesOperations)operations).ListByLocationNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the virtual machines under the specified subscription for the + /// specified location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByLocationNextAsync(this IVirtualMachinesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByLocationNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all of the virtual machines in the specified subscription. Use the + /// nextLink property in the response to get the next page of virtual machines. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListAllNext(this IVirtualMachinesOperations operations, string nextPageLink) + { + return ((IVirtualMachinesOperations)operations).ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all of the virtual machines in the specified subscription. Use the + /// nextLink property in the response to get the next page of virtual machines. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAllNextAsync(this IVirtualMachinesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all of the virtual machines in the specified resource group. Use the + /// nextLink property in the response to get the next page of virtual machines. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVirtualMachinesOperations operations, string nextPageLink) + { + return ((IVirtualMachinesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all of the virtual machines in the specified resource group. Use the + /// nextLink property in the response to get the next page of virtual machines. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVirtualMachinesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Compute/Compute.Management.Sdk/README.md b/src/Compute/Compute.Management.Sdk/README.md index 157831351d6c..275b4a4632de 100644 --- a/src/Compute/Compute.Management.Sdk/README.md +++ b/src/Compute/Compute.Management.Sdk/README.md @@ -6,15 +6,15 @@ In this directory, run AutoRest: ``` .\Rest-api-specs\preprocess-rest-api-spec.ps1 autorest --reset -autorest --use:@microsoft.azure/autorest.csharp@2.3.90 -autorest.cmd README.md --version=v2 +autorest --use:@autorest/powershell@4.x ``` ### AutoRest Configuration > see https://aka.ms/autorest ``` yaml -csharp: true +isSdkGenerator: true +powershell: true clear-output-folder: true reflect-api-versions: true openapi-type: arm @@ -38,6 +38,149 @@ namespace: Microsoft.Azure.Management.Compute directive: + # Fix OS-related properties + - where: + property-name: OSType + set: + property-name: OsType + - where: + property-name: OSDisk + set: + property-name: OsDisk + - where: + property-name: OSState + set: + property-name: OsState + - where: + property-name: OSName + set: + property-name: OsName + - where: + property-name: OSVersion + set: + property-name: OsVersion + - where: + property-name: OSProfile + set: + property-name: OsProfile + - where: + property-name: OSDiskImage + set: + property-name: OsDiskImage + - where: + property-name: OSRollingUpgradeDeferral + set: + property-name: OsRollingUpgradeDeferral + - where: + property-name: OSImageNotificationProfile + set: + property-name: OsImageNotificationProfile + + # Fix VM-related properties + - where: + property-name: VMAgent + set: + property-name: VmAgent + - where: + property-name: VMHealth + set: + property-name: VmHealth + - where: + property-name: VMSize + set: + property-name: VmSize + - where: + property-name: VMSizes + set: + property-name: VmSizes + - where: + property-name: VMSizeProperties + set: + property-name: VmSizeProperties + - where: + property-name: VMUri + set: + property-name: VmUri + - where: + property-name: VMId + set: + property-name: VmId + - where: + property-name: VMAgentVersion + set: + property-name: VmAgentVersion + - where: + property-name: PrioritizeUnhealthyVMS + set: + property-name: PrioritizeUnhealthyVMs + - where: + property-name: AllocatableVMS + set: + property-name: AllocatableVMs + - where: + property-name: AllocatableVMS + set: + property-name: AllocatableVMs + + # Fix GB-related properties + - where: + property-name: DiskSizeGb + set: + property-name: DiskSizeGB + - where: + property-name: SizeInGb + set: + property-name: SizeInGB + + # Fix IOPS-related properties + - where: + property-name: DiskIopsReadWrite + set: + property-name: DiskIOPSReadWrite + + # Fix IP-related properties + - where: + property-name: IPConfigurations + set: + property-name: IpConfigurations + - where: + property-name: IPTags + set: + property-name: IpTags + - where: + property-name: IPTagType + set: + property-name: IpTagType + + # Fix other acronyms + - where: + property-name: VCpUs + set: + property-name: VCPUs + - where: + property-name: VCpUsAvailable + set: + property-name: VCPUsAvailable + - where: + property-name: VCpUsPerCore + set: + property-name: VCPUsPerCore + - where: + property-name: MeterId + set: + property-name: MeterID + - where: + property-name: WinRm + set: + property-name: WinRM + - where: + property-name: UltraSsdEnabled + set: + property-name: UltraSSDEnabled + - where: + property-name: PropertiesType + set: + property-name: VirtualMachineExtensionType - from: swagger-document where: $..definitions.OperatingSystemStateTypes @@ -168,21 +311,32 @@ directive: } return $; - # Remove PurchasePlan definitions + # Normalize PurchasePlan in ComputeRP.json - from: ComputeRP.json - where: $.definitions + where: $.definitions.PurchasePlan transform: | - // Delete existing definitions if they exist - if ($.PurchasePlan) { - delete $.PurchasePlan; + if ($.required) { + $.required = ["publisher", "name", "product"]; } + // Add promotionCode property to match DiskPurchasePlan + if (!$.properties.promotionCode) { + $.properties.promotionCode = { + "type": "string", + "description": "The Offer Promotion Code." + }; + } + return $; - # Rename DiskPurchasePlan to PurchasePlan + # Rename DiskPurchasePlan to PurchasePlan and normalize required fields - from: DiskRP.json where: $.definitions transform: | if ($.DiskPurchasePlan) { $.PurchasePlan = $.DiskPurchasePlan; + // Normalize the required array order to match ComputeRP.json + if ($.PurchasePlan.required) { + $.PurchasePlan.required = ["publisher", "name", "product"]; + } delete $.DiskPurchasePlan; } return $; @@ -259,36 +413,6 @@ directive: }; return $; - # Rename TrackedResource definition to Resource - - from: swagger-document - where: $.definitions - transform: | - if ($.TrackedResource) { - $.Resource = $.TrackedResource; - delete $.TrackedResource; - } - return $; - - # Fix all references to TrackedResource - - from: swagger-document - where: $ - transform: | - const traverse = (obj) => { - if (obj === null || typeof obj !== 'object') return obj; - - if (obj.$ref === '#/definitions/TrackedResource') { - obj.$ref = '#/definitions/Resource'; - } - - Object.keys(obj).forEach(key => { - obj[key] = traverse(obj[key]); - }); - - return obj; - }; - - return traverse($); - # Update OrchestrationServiceNames enum consistently - from: ComputeRP.json where: $.definitions.OrchestrationServiceNames diff --git a/src/Compute/Compute/Common/DiagnosticsHelper.cs b/src/Compute/Compute/Common/DiagnosticsHelper.cs index 28e74616dd44..5ee60f798797 100644 --- a/src/Compute/Compute/Common/DiagnosticsHelper.cs +++ b/src/Compute/Compute/Common/DiagnosticsHelper.cs @@ -742,7 +742,7 @@ public static Tuple GetConfigurationsFromFiles(string publ public static bool IsDiagnosticsExtension(VirtualMachineScaleSetExtension extension) { return extension.Publisher.Equals(DiagnosticsExtensionConstants.ExtensionPublisher, StringComparison.InvariantCultureIgnoreCase) && - extension.VirtualMachineScaleSetExtensionPropertiesType.Equals(DiagnosticsExtensionConstants.ExtensionType, StringComparison.InvariantCultureIgnoreCase); + extension.VirtualMachineExtensionType.Equals(DiagnosticsExtensionConstants.ExtensionType, StringComparison.InvariantCultureIgnoreCase); } /// diff --git a/src/Compute/Compute/Extension/VirtualMachineScaleSetExtensionBaseCmdlet.cs b/src/Compute/Compute/Extension/VirtualMachineScaleSetExtensionBaseCmdlet.cs index 6d4602376a63..49042c835ffa 100644 --- a/src/Compute/Compute/Extension/VirtualMachineScaleSetExtensionBaseCmdlet.cs +++ b/src/Compute/Compute/Extension/VirtualMachineScaleSetExtensionBaseCmdlet.cs @@ -33,11 +33,11 @@ public IVirtualMachineScaleSetsOperations VirtualMachineScaleSetClient } } - public IVirtualMachineScaleSetVMsOperations VirtualMachineScaleSetVMsClient + public IVirtualMachineScaleSetVMSOperations VirtualMachineScaleSetVMsClient { get { - return ComputeClient.ComputeManagementClient.VirtualMachineScaleSetVMs; + return ComputeClient.ComputeManagementClient.VirtualMachineScaleSetVMS; } } diff --git a/src/Compute/Compute/Extension/VmssDiskEncryption/DisableAzureVmssDiskEncryption.cs b/src/Compute/Compute/Extension/VmssDiskEncryption/DisableAzureVmssDiskEncryption.cs index 822127b6ffaa..6937075b94c2 100644 --- a/src/Compute/Compute/Extension/VmssDiskEncryption/DisableAzureVmssDiskEncryption.cs +++ b/src/Compute/Compute/Extension/VmssDiskEncryption/DisableAzureVmssDiskEncryption.cs @@ -127,7 +127,7 @@ public override void ExecuteCmdlet() bool extensionFound = false; foreach (var ext in vmss.VirtualMachineProfile.ExtensionProfile.Extensions) { - if (ext.VirtualMachineScaleSetExtensionPropertiesType.Equals(this.ExtensionName)) + if (ext.VirtualMachineExtensionType.Equals(this.ExtensionName)) { ext.Settings = GetDisalbeEncryptionSetting(); ext.ProtectedSettings = null; diff --git a/src/Compute/Compute/Extension/VmssDiskEncryption/GetAzureVmssDiskEncryptionStatus.cs b/src/Compute/Compute/Extension/VmssDiskEncryption/GetAzureVmssDiskEncryptionStatus.cs index 57c3b81341cd..8eeff2163e9d 100644 --- a/src/Compute/Compute/Extension/VmssDiskEncryption/GetAzureVmssDiskEncryptionStatus.cs +++ b/src/Compute/Compute/Extension/VmssDiskEncryption/GetAzureVmssDiskEncryptionStatus.cs @@ -148,7 +148,7 @@ private PSVmssDiskEncryptionStatusContext GetVmssDiskStatus(string rgName, strin } ext = vmssResult.VirtualMachineProfile.ExtensionProfile.Extensions.First( - e => e.VirtualMachineScaleSetExtensionPropertiesType.Equals(this.ExtensionName)); + e => e.VirtualMachineExtensionType.Equals(this.ExtensionName)); } catch (InvalidOperationException) { diff --git a/src/Compute/Compute/Extension/VmssDiskEncryption/SetAzureVmssDiskEncryptionExtension.cs b/src/Compute/Compute/Extension/VmssDiskEncryption/SetAzureVmssDiskEncryptionExtension.cs index 203588a3dc48..c3f3fe50274b 100644 --- a/src/Compute/Compute/Extension/VmssDiskEncryption/SetAzureVmssDiskEncryptionExtension.cs +++ b/src/Compute/Compute/Extension/VmssDiskEncryption/SetAzureVmssDiskEncryptionExtension.cs @@ -227,7 +227,7 @@ private VirtualMachineScaleSetExtension GetVmssExtensionParameters() { Name = this.ExtensionName, Publisher = this.ExtensionPublisherName, - VirtualMachineScaleSetExtensionPropertiesType = this.ExtensionType, + VirtualMachineExtensionType = this.ExtensionType, TypeHandlerVersion = (this.TypeHandlerVersion) ?? AzureVmssDiskEncryptionExtensionContext.ExtensionDefaultVersion, Settings = SettingString, AutoUpgradeMinorVersion = !DisableAutoUpgradeMinorVersion.IsPresent, @@ -244,7 +244,7 @@ private VirtualMachineScaleSetExtension GetVmssExtensionParameters() { Name = this.ExtensionName, Publisher = this.ExtensionPublisherName, - VirtualMachineScaleSetExtensionPropertiesType = this.ExtensionType, + VirtualMachineExtensionType = this.ExtensionType, TypeHandlerVersion = (this.TypeHandlerVersion) ?? AzureVmssDiskEncryptionExtensionContext.LinuxExtensionDefaultVersion, Settings = SettingString, AutoUpgradeMinorVersion = !DisableAutoUpgradeMinorVersion.IsPresent, diff --git a/src/Compute/Compute/ExtensionImages/GetAzureVMExtensionImageCommand.cs b/src/Compute/Compute/ExtensionImages/GetAzureVMExtensionImageCommand.cs index 071e9b851024..e0db2c1a0d64 100644 --- a/src/Compute/Compute/ExtensionImages/GetAzureVMExtensionImageCommand.cs +++ b/src/Compute/Compute/ExtensionImages/GetAzureVMExtensionImageCommand.cs @@ -92,7 +92,7 @@ public override void ExecuteCmdlet() OperatingSystem = result.Body.OperatingSystem, ComputeRole = result.Body.ComputeRole, SupportsMultipleExtensions = result.Body.SupportsMultipleExtensions, - VMScaleSetEnabled = result.Body.VmScaleSetEnabled, + VMScaleSetEnabled = result.Body.VMScaleSetEnabled, Version = result.Body.Name, PublisherName = this.PublisherName, Type = this.Type, diff --git a/src/Compute/Compute/Generated/ComputeAutomationBaseCmdlet.cs b/src/Compute/Compute/Generated/ComputeAutomationBaseCmdlet.cs index fc8a73edd7a9..b2c754538dac 100644 --- a/src/Compute/Compute/Generated/ComputeAutomationBaseCmdlet.cs +++ b/src/Compute/Compute/Generated/ComputeAutomationBaseCmdlet.cs @@ -279,11 +279,11 @@ public IVirtualMachineScaleSetVMExtensionsOperations VirtualMachineScaleSetVMExt } } - public IVirtualMachineScaleSetVMsOperations VirtualMachineScaleSetVMsClient + public IVirtualMachineScaleSetVMSOperations VirtualMachineScaleSetVMsClient { get { - return ComputeClient.ComputeManagementClient.VirtualMachineScaleSetVMs; + return ComputeClient.ComputeManagementClient.VirtualMachineScaleSetVMS; } } diff --git a/src/Compute/Compute/Generated/Disk/DiskGrantAccessMethod.cs b/src/Compute/Compute/Generated/Disk/DiskGrantAccessMethod.cs index 16b883afa423..718a32af110e 100644 --- a/src/Compute/Compute/Generated/Disk/DiskGrantAccessMethod.cs +++ b/src/Compute/Compute/Generated/Disk/DiskGrantAccessMethod.cs @@ -48,7 +48,7 @@ public override void ExecuteCmdlet() var grantAccessData = new GrantAccessData(); grantAccessData.Access = this.Access; grantAccessData.DurationInSeconds = this.DurationInSecond; - grantAccessData.GetSecureVMGuestStateSAS = this.SecureVMGuestStateSAS; + grantAccessData.GetSecureVMGuestStateSas = this.SecureVMGuestStateSAS; var result = DisksClient.GrantAccess(resourceGroupName, diskName, grantAccessData); var psObject = new PSAccessUri(); diff --git a/src/Compute/Compute/Generated/GalleryInVMAccessControlProfile/NewAzGalleryInVMAccessControlProfile.cs b/src/Compute/Compute/Generated/GalleryInVMAccessControlProfile/NewAzGalleryInVMAccessControlProfile.cs index 3a8560ed28f9..798fa1b923c1 100644 --- a/src/Compute/Compute/Generated/GalleryInVMAccessControlProfile/NewAzGalleryInVMAccessControlProfile.cs +++ b/src/Compute/Compute/Generated/GalleryInVMAccessControlProfile/NewAzGalleryInVMAccessControlProfile.cs @@ -127,7 +127,7 @@ public override void ExecuteCmdlet() } else if (this.ApplicableHostEndPoint.Equals("IMDS", StringComparison.OrdinalIgnoreCase)) { - galleryInVMAccessControlProfile.Properties.ApplicableHostEndpoint = EndpointTypes.IMDS; + galleryInVMAccessControlProfile.Properties.ApplicableHostEndpoint = EndpointTypes.Imds; } else { diff --git a/src/Compute/Compute/Generated/GalleryInVMAccessControlProfile/UpdateAzGalleryInVMAccessControlProfile.cs b/src/Compute/Compute/Generated/GalleryInVMAccessControlProfile/UpdateAzGalleryInVMAccessControlProfile.cs index acd1fc0114c1..f0cb321a26ac 100644 --- a/src/Compute/Compute/Generated/GalleryInVMAccessControlProfile/UpdateAzGalleryInVMAccessControlProfile.cs +++ b/src/Compute/Compute/Generated/GalleryInVMAccessControlProfile/UpdateAzGalleryInVMAccessControlProfile.cs @@ -109,7 +109,7 @@ public override void ExecuteCmdlet() } else if (this.ApplicableHostEndPoint.Equals("IMDS", StringComparison.OrdinalIgnoreCase)) { - galleryInVMAccessControlProfile.Properties.ApplicableHostEndpoint = EndpointTypes.IMDS; + galleryInVMAccessControlProfile.Properties.ApplicableHostEndpoint = EndpointTypes.Imds; } else { diff --git a/src/Compute/Compute/Generated/Models/ComputeAutoMapperProfile.cs b/src/Compute/Compute/Generated/Models/ComputeAutoMapperProfile.cs index 2c4f46155625..36772f88c90d 100644 --- a/src/Compute/Compute/Generated/Models/ComputeAutoMapperProfile.cs +++ b/src/Compute/Compute/Generated/Models/ComputeAutoMapperProfile.cs @@ -191,9 +191,9 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap() - .ForMember(c => c.Type, o => o.MapFrom(r => r.VirtualMachineScaleSetExtensionPropertiesType)); + .ForMember(c => c.Type, o => o.MapFrom(r => r.VirtualMachineExtensionType)); cfg.CreateMap() - .ForMember(c => c.VirtualMachineScaleSetExtensionPropertiesType, o => o.MapFrom(r => r.Type)); + .ForMember(c => c.VirtualMachineExtensionType, o => o.MapFrom(r => r.Type)); cfg.CreateMap(); cfg.CreateMap(); diff --git a/src/Compute/Compute/Generated/Snapshot/SnapshotGrantAccessMethod.cs b/src/Compute/Compute/Generated/Snapshot/SnapshotGrantAccessMethod.cs index c9369c75c3de..731672c1cc30 100644 --- a/src/Compute/Compute/Generated/Snapshot/SnapshotGrantAccessMethod.cs +++ b/src/Compute/Compute/Generated/Snapshot/SnapshotGrantAccessMethod.cs @@ -48,7 +48,7 @@ public override void ExecuteCmdlet() var grantAccessData = new GrantAccessData(); grantAccessData.Access = this.Access; grantAccessData.DurationInSeconds = this.DurationInSecond; - grantAccessData.GetSecureVMGuestStateSAS = this.SecureVMGuestStateSAS; + grantAccessData.GetSecureVMGuestStateSas = this.SecureVMGuestStateSAS; var result = SnapshotsClient.GrantAccess(resourceGroupName, snapshotName, grantAccessData); var psObject = new PSAccessUri(); diff --git a/src/Compute/Compute/Generated/VirtualMachineScaleSet/VirtualMachineScaleSetDeallocateMethod.cs b/src/Compute/Compute/Generated/VirtualMachineScaleSet/VirtualMachineScaleSetDeallocateMethod.cs index 5206fb8de430..2ca8816678ce 100644 --- a/src/Compute/Compute/Generated/VirtualMachineScaleSet/VirtualMachineScaleSetDeallocateMethod.cs +++ b/src/Compute/Compute/Generated/VirtualMachineScaleSet/VirtualMachineScaleSetDeallocateMethod.cs @@ -54,12 +54,12 @@ public override void ExecuteCmdlet() if (this.ParameterSetName.Equals("FriendMethod")) { bool? skipShutdown = this.SkipShutdown.IsPresent ? (bool?) true : null; - result = VirtualMachineScaleSetsClient.PowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds).GetAwaiter().GetResult(); + result = VirtualMachineScaleSetsClient.PowerOffWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, skipShutdown).GetAwaiter().GetResult(); } else { bool? hibernate = this.Hibernate.IsPresent ? (bool?)true : null; - result = VirtualMachineScaleSetsClient.DeallocateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, hibernate, instanceIds).GetAwaiter().GetResult(); + result = VirtualMachineScaleSetsClient.DeallocateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds, hibernate).GetAwaiter().GetResult(); } PSOperationStatusResponse output = new PSOperationStatusResponse diff --git a/src/Compute/Compute/Generated/VirtualMachineScaleSet/VirtualMachineScaleSetUpdateMethod.cs b/src/Compute/Compute/Generated/VirtualMachineScaleSet/VirtualMachineScaleSetUpdateMethod.cs index d9f4c57facfc..e2845ba0aeb0 100644 --- a/src/Compute/Compute/Generated/VirtualMachineScaleSet/VirtualMachineScaleSetUpdateMethod.cs +++ b/src/Compute/Compute/Generated/VirtualMachineScaleSet/VirtualMachineScaleSetUpdateMethod.cs @@ -1127,7 +1127,7 @@ private void BuildPatchObject() { this.VirtualMachineScaleSetUpdate = new VirtualMachineScaleSetUpdate(); } - this.VirtualMachineScaleSetUpdate.DoNotRunExtensionsOnOverprovisionedVMs = this.SkipExtensionsOnOverprovisionedVMs; + this.VirtualMachineScaleSetUpdate.DoNotRunExtensionsOnOverprovisionedVms = this.SkipExtensionsOnOverprovisionedVMs; } if (this.IsParameterBound(c => c.SkuCapacity)) diff --git a/src/Compute/Compute/StorageServices/AddAzureVhdCommand.cs b/src/Compute/Compute/StorageServices/AddAzureVhdCommand.cs index ec2494ceb5e0..029387e674f7 100644 --- a/src/Compute/Compute/StorageServices/AddAzureVhdCommand.cs +++ b/src/Compute/Compute/StorageServices/AddAzureVhdCommand.cs @@ -240,8 +240,8 @@ public override void ExecuteCmdlet() // 3-3: GENERATE SAS WriteVerbose("Generating SAS"); var accessUri = GenerateSAS(); - Uri sasUri = new Uri(accessUri.AccessSAS); - WriteVerbose("SAS generated: " + accessUri.AccessSAS); + Uri sasUri = new Uri(accessUri.AccessSas); + WriteVerbose("SAS generated: " + accessUri.AccessSas); // 3-4: UPLOAD diff --git a/src/Compute/Compute/Strategies/ComputeRp/ComputeStrategy.cs b/src/Compute/Compute/Strategies/ComputeRp/ComputeStrategy.cs index b2af1ad2390d..02049b345b83 100644 --- a/src/Compute/Compute/Strategies/ComputeRp/ComputeStrategy.cs +++ b/src/Compute/Compute/Strategies/ComputeRp/ComputeStrategy.cs @@ -31,7 +31,7 @@ public static ResourceStrategy Create( Func> getAsync, Func, Task> createOrUpdateAsync, Func createTime) - where TModel : Resource + where TModel : TrackedResource => ResourceStrategy.Create( type: new ResourceType(Namespace, provider), getOperations: getOperations, diff --git a/src/Compute/Compute/Strategies/ComputeRp/ImageEx.cs b/src/Compute/Compute/Strategies/ComputeRp/ImageEx.cs index a5e4661d25dd..98c536880ad4 100644 --- a/src/Compute/Compute/Strategies/ComputeRp/ImageEx.cs +++ b/src/Compute/Compute/Strategies/ComputeRp/ImageEx.cs @@ -171,7 +171,7 @@ static async Task GetGalleryImageAndOsTypeAsync( } return new ImageAndOsType( - localImage.OsType, + localImage.OsType.Value, imageRef, null); } diff --git a/src/Compute/Compute/Strategies/ComputeRp/VirtualMachineScaleSetStrategy.cs b/src/Compute/Compute/Strategies/ComputeRp/VirtualMachineScaleSetStrategy.cs index e588ab6469cc..f9ae396e6fdd 100644 --- a/src/Compute/Compute/Strategies/ComputeRp/VirtualMachineScaleSetStrategy.cs +++ b/src/Compute/Compute/Strategies/ComputeRp/VirtualMachineScaleSetStrategy.cs @@ -200,7 +200,7 @@ internal static ResourceConfig CreateVirtualMachineScale VmSizes = skuProfileVmSize, AllocationStrategy = skuProfileAllocationStrategy }, - DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs ? true : (bool?)null, + DoNotRunExtensionsOnOverprovisionedVms = doNotRunExtensionsOnOverprovisionedVMs ? true : (bool?)null, OrchestrationMode = orchestrationMode }; if (auxAuthHeader != null) @@ -352,7 +352,7 @@ internal static ResourceConfig CreateVirtualMachineScale VmSizes = skuProfileVmSize, AllocationStrategy = skuProfileAllocationStrategy }, - DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs ? true : (bool?)null, + DoNotRunExtensionsOnOverprovisionedVms = doNotRunExtensionsOnOverprovisionedVMs ? true : (bool?)null, OrchestrationMode = orchestrationMode }; if (auxAuthHeader != null)